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

feat: Add file path to failing tests to make debugging failing tests easier #4461

Merged

Conversation

liamg
Copy link
Contributor

@liamg liamg commented Mar 22, 2022

opa test now prints the test file path above each group of failing tests for that path (or all tests in verbose mode).

e.g.

policy1.rego:
data.foo.bar.test_baz: PASS (0s)
data.foo.bar.test_qux: ERROR (0s)
  some err

policy2.rego:
data.foo.bar.test_corge: FAIL (0s)
data.foo.bar.todo_test_qux: SKIPPED

policy3.rego:
data.foo.bar.test_contains_print: PASS (0s)

Resolves #4457

@liamg liamg force-pushed the liamg-add-file-location-of-failure branch 7 times, most recently from ed3ef44 to 260d904 Compare March 22, 2022 14:32
@liamg liamg force-pushed the liamg-add-file-location-of-failure branch from 7253fa3 to 009351d Compare March 22, 2022 20:56
…easier

Signed-off-by: Liam Galvin <liamgalvin@protonmail.com>
@liamg liamg force-pushed the liamg-add-file-location-of-failure branch from 009351d to 474ef39 Compare March 22, 2022 20:58
Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@anderseknert anderseknert merged commit 90b91e6 into open-policy-agent:main Mar 22, 2022
@liamg liamg deleted the liamg-add-file-location-of-failure branch March 22, 2022 21:17
@anderseknert
Copy link
Member

Thanks for contributing @liamg 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print file name in output when tests fail
2 participants