-
Notifications
You must be signed in to change notification settings - Fork 71
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
feature(backend): Required Gates #2888
Conversation
@@ -0,0 +1,51 @@ | |||
openapi: 3.0.0 |
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.
I went with the proposed option @danielbdias suggested of creating a new test runner resource, I think this will allow us to have a more flexible way of dealing with customizable options when executing a test.
server/executor/runner.go
Outdated
@@ -152,6 +160,14 @@ func (r persistentRunner) Run(ctx context.Context, testObj test.Test, metadata t | |||
|
|||
r.listenForStopRequests(ctx, cancelCtx, run) | |||
|
|||
// configuring required gates | |||
if requiredGates != nil { |
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.
Required gates can be overwritten by the clients when executing a test run and if it's not part of the request we fallback to the global configuration
return r | ||
} | ||
|
||
func (r Run) ConfigureRequiredGates(gates []testrunner.RequiredGate) Run { |
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.
This logic is to support side effects from the linter and analyzer results to update the gates.
It also includes logic to generate the results from a test run without it for retro-compat
server/executor/runner.go
Outdated
@@ -31,14 +32,18 @@ type RunResult struct { | |||
} | |||
|
|||
type Runner interface { | |||
Run(context.Context, test.Test, test.RunMetadata, environment.Environment) test.Run | |||
Run(context.Context, test.Test, test.RunMetadata, environment.Environment, *testrunner.RequiredGates) test.Run |
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.
I was thinking of moving both the env and test runner gates to an options struct, but I think this will be something that will change soon as part of the event-driven logic we might be applying for the next big September update 👁️
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.
Looks great 💥
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.
My main request change is to remove the reference to resourcemanager for the unused list of operations. The rest are readability suggestions
@schoren thanks for your review! I think I addressed all of your comments, I'm going to merge this to the feature branch so we can move forward |
* feature(backend): Required Gates (#2888) * feature(backend): Required Gates * adding tests and fixing bugs * adding tests and fixing bugs * addressing PR comments * addressing PR comments * updating go.modsum * feature(frontend): Required Gates (#2932) * feature(frontend): Test Runner Configuration * feature(frontend): cleanup * feature(frontend): removing unnecessary prop * feature(frontend): addressing PR review comments
This PR adds the capability for the server to handle required gates for test runs.
Required gates are a list of checkpoints where the test runner can be configured to mark the execution as failed or passed, without stopping the state machine steps.
Changes
Fixes
Checklist
https://www.loom.com/share/2d16fb9a483e4becb75832a2e591d10c