-
Notifications
You must be signed in to change notification settings - Fork 12
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
Integration tests infrastructure #4
Conversation
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.
A few comments here and there, but overall I like this a lot! Thanks for putting that together :)
I really would like to see the UUID implementation in another PR (possibly on top of that one for the integration tests) so I can properly review them independently
Co-authored-by: Quentin Gliech <[email protected]>
Co-authored-by: Quentin Gliech <[email protected]>
Thanks for the comments, I had a few 🤦 moments and also a learning experience :) |
Just a heads-up that I did two things recently:
|
Perfect, thanks for the heads up! |
One thing I just realised, is that we usually require a license header in each file, and I need you to signoff your PR. Could you please:
Thanks a lot! |
Thanks for the note, I'll be sure to do that, no problem 👍 |
Just updating that I've allocated some free time to work on this, I'll probably finish it up in a few days. |
56cb2e5
to
425199b
Compare
Signed-off-by: Dotan Nahum <[email protected]>
Signed-off-by: Dotan Nahum <[email protected]>
Done with this PR 🎊 |
Signed-off-by: Dotan Nahum <[email protected]>
Signed-off-by: Dotan Nahum <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #4 +/- ##
==========================================
+ Coverage 2.36% 33.05% +30.68%
==========================================
Files 31 32 +1
Lines 1478 1543 +65
==========================================
+ Hits 35 510 +475
+ Misses 1443 1033 -410
Continue to review full report at Codecov.
|
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.
Some nitpicks, but other than that, LGTM! 👍
Signed-off-by: Dotan Nahum <[email protected]>
Signed-off-by: Dotan Nahum <[email protected]>
Nice work, thanks a lot for all this! I'll let the CI run and merge once it passes. I will try introduce an "evaluation context" which is carried throughout the evaluation, where builtins can grab a RNG and a cache |
Thanks! -- it's been a learning experience, and I grabbed a few tricks from you here and there in my day to day work 😃 |
Built some infra for mainly integration tests, so I could have a good development experience.
Did the UUID builtin, to test the waters.
Looking for thoughts?
Workflow
Test:
Development:
rego
policy in the fixture folderjson
file for it, one or moremake build-opa
so that a new bundle would appear in fixturesTESTS
array, (<bundle name>
,<json input test case>
), prefer a common prefix.Run tests:
Implement your code to pass the
rego
andjson
combo.Follow
insta
to review failuresPrinciples
insta
to have a minimal effort for verifying tests, as well as enjoy theinsta
toolchain + serialization benefitsopa
, but be less opinionated about how it gets to the fixtures folder (right now it's just a shell script and a makefile which can be replaced easily with more sophisticated mechanisms such as storing / caching it for speed)wasm
policy again and again: stateless and parallelizable