-
Notifications
You must be signed in to change notification settings - Fork 107
More integration test refactoring #725
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
Conversation
Signed-off-by: Kesha Hietala <[email protected]>
Signed-off-by: Kesha Hietala <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny nits
@@ -0,0 +1,25 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to have main.rs
instead of lib.rs
? this is a library crate, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No special reason, I was just copying the structure of the CLI tests. The files just contain #[test]
s. Is lib or main more appropriate? Or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib.rs
is used for crates that provide libraries, main.rs
is used for crates compiling an executable. (main.rs
usually contains a main()
-- in fact, I'm surprised Cargo isn't complaining that this one doesn't.) See https://doc.rust-lang.org/cargo/guide/project-layout.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on that link, I think that using a main.rs
file in the tests
subfolder is the correct structure.
If a binary, example, bench, or integration test consists of multiple source files, place a main.rs file along with the extra modules within a subdirectory of the src/bin, examples, benches, or tests directory. The name of the executable will be the directory name.
Also learned: the reason that the cedar-policy
integration tests weren't running after #707 was the nested directory structure I introduced under tests/
.
Signed-off-by: Kesha Hietala <[email protected]>
Signed-off-by: Kesha Hietala <[email protected]>
Signed-off-by: Kesha Hietala <[email protected]>
Fix for the CedarDRT build failure in cedar-spec#253. |
Signed-off-by: Kesha Hietala <[email protected]>
Description of changes
ImpossiblePolicy
from error to warning #716 I noticed that the cedar-policy integration tests weren't actually running after Refactoring in integration testing code #707 (oops). Added a main file to fix this.ValidationComparisonMode
toCedarTestImplementation
that controls how validation results are used during testing. This should allow me to easily fix the CI failure in MoveImpossiblePolicy
from error to warning #716, which is caused by validation differences in the corpus tests. I can also reuse this to clean up the implementation of cedar-spec#210, which updated the property tested in validation DRT.Issue #, if available
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
I confirm that this PR (choose one, and delete the other options):
I confirm that
cedar-spec
(choose one, and delete the other options):cedar-spec
, and how you have tested that your updates are correct.)Disclaimer
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.