Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report Code Coverage in Model Tests #44

Open
aaguiarz opened this issue Jan 10, 2024 · 0 comments
Open

Report Code Coverage in Model Tests #44

aaguiarz opened this issue Jan 10, 2024 · 0 comments

Comments

@aaguiarz
Copy link
Member

aaguiarz commented Jan 10, 2024

We can display the relations that were not checked directly in tests, directly or indirectly, and report if there were tests for which the relation returned allowed = true, and allowed = false, as tests should cover both.

For example, for the tests below:

model: |
  model 
    schema 1.1

  type user
  type document
    relations
      define viewer : [user]
      define writer : [user]
      define can_view : viewer or writer
      define can_edit: writer

tuples:
  - user: user:anne
    relation: viewer
    object: document:1

tests:
    - check:
        - user : user:anne
          object : document:1
          assertions:
            can_view : true

We could report that the relation can_edit and writer were not covered at all, and the viewer, can_view were only tested for positive results.

@aaguiarz aaguiarz converted this from a draft issue Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant