-
Notifications
You must be signed in to change notification settings - Fork 743
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
[gk-test] Refactor run code into Runner #1445
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1445 +/- ##
==========================================
+ Coverage 50.35% 50.75% +0.40%
==========================================
Files 77 78 +1
Lines 5108 5111 +3
==========================================
+ Hits 2572 2594 +22
+ Misses 2185 2170 -15
+ Partials 351 347 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
1fcbd99
to
ff33863
Compare
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.
Now that much of the test running logic is defined, it is more apparent how to organize it. Code specific to running tests, but which does not change with the nature of the tests being run or how the results are printed, should live in its own place. It may be decorated in the future with objects (like Printers) which are specified by the user. This PR has zero changes to logic - it only moves logic around. Signed-off-by: Will Beason <willbeason@google.com>
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.
LGTM
Now that much of the test running logic is defined, it is more apparent how to organize it. Code specific to running tests, but which does not change with the nature of the tests being run or how the results are printed, should live in its own place. It may be decorated in the future with objects (like Printers) which are specified by the user. This PR has zero changes to logic - it only moves logic around. Signed-off-by: Will Beason <willbeason@google.com> Signed-off-by: juliankatz <juliankatz@google.com>
I recently ran `make vendor` on gatekeeper master and noticed that a number of files from frameworks/constraint were being deleted. Why? It runs out that a recent PR (open-policy-agent#1445) removed a dependency on frameworks/constraint/pkg/apis and `make vendor` was pruning the unused code from the vendor/ directory. As the API types declared in frameworks/constraint are part of the API used in g8r, I thought it appropriate to add them to the scheme. This fixes the problem with make vendor. Signed-off-by: juliankatz <juliankatz@google.com>
I recently ran `make vendor` on gatekeeper master and noticed that a number of files from frameworks/constraint were being deleted. Why? It runs out that a recent PR (open-policy-agent#1445) removed a dependency on frameworks/constraint/pkg/apis and `make vendor` was pruning the unused code from the vendor/ directory. Further, while we might expect the AddToScheme calls to be used when we setup the scheme in main.go, it turns out that we were making essentially duplicate versions of the AddToScheme files in g8r. I've replaced these with a single file that calls all the AddToScheme functions in frameworks/constraint. Signed-off-by: juliankatz <juliankatz@google.com>
* Add frameworks apis to scheme I recently ran `make vendor` on gatekeeper master and noticed that a number of files from frameworks/constraint were being deleted. Why? It runs out that a recent PR (#1445) removed a dependency on frameworks/constraint/pkg/apis and `make vendor` was pruning the unused code from the vendor/ directory. As the API types declared in frameworks/constraint are part of the API used in g8r, I thought it appropriate to add them to the scheme. This fixes the problem with make vendor. Signed-off-by: juliankatz <juliankatz@google.com> * Add frameworks apis to scheme I recently ran `make vendor` on gatekeeper master and noticed that a number of files from frameworks/constraint were being deleted. Why? It runs out that a recent PR (#1445) removed a dependency on frameworks/constraint/pkg/apis and `make vendor` was pruning the unused code from the vendor/ directory. Further, while we might expect the AddToScheme calls to be used when we setup the scheme in main.go, it turns out that we were making essentially duplicate versions of the AddToScheme files in g8r. I've replaced these with a single file that calls all the AddToScheme functions in frameworks/constraint. Signed-off-by: juliankatz <juliankatz@google.com>
Now that much of the test running logic is defined, it is more apparent
how to organize it.
Code specific to running tests, but which does not change with the
nature of the tests being run or how the results are printed, should
live in its own place. It may be decorated in the future with objects
(like Printers) which are specified by the user.
This PR has zero changes to logic - it only moves logic around.
Signed-off-by: Will Beason willbeason@google.com