-
Notifications
You must be signed in to change notification settings - Fork 104
Add FailurePolicyAction unit tests #967
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
Add FailurePolicyAction unit tests #967
Conversation
✅ Deploy Preview for kubernetes-sigs-jobset canceled.
|
|
Hi @carreter. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
/assign @GiuseppeTT |
516e95a to
5a6323b
Compare
|
Sorry for the force-push, @GiuseppeTT this is ready for review. |
|
/lgtm |
|
/assign @andreyvelich |
kannon92
left a comment
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.
One very minor typo:
andreyvelich
left a comment
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.
Thank you for this @carreter!
| matchingFailedJob *batchv1.Job | ||
| failurePolicyAction jobset.FailurePolicyAction | ||
| expectedJobSetStatus jobset.JobSetStatus | ||
| shouldUpdateStatusOpts bool |
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.
Do we need this if that is always = true ?
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.
Nice catch!
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.
Fixed, thanks for the catch!
| t.Fatalf("unexpected error: %v", err) | ||
| } | ||
|
|
||
| if !updateStatusOpts.shouldUpdate { |
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.
Can you add a test case that doesn't require an 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.
AFAIK, all failure policies result in an update. I need to double-check though.
kannon92
left a comment
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
/approve
one minor nit: https://github.com/kubernetes-sigs/jobset/pull/967/files#r2267383874
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carreter, kannon92 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Adds unit tests for how FailurePolicyActions should modify the JobSet status when applied.
Which issue(s) this PR fixes:
Fixes #963
Special notes for your reviewer:
Conflicts with #958 due to the status API change. Whichever PR gets merged second will have to be updated.
Test rigging written by hand, specific test cases generated with Gemini 2.5 Pro and manually edited to fix. Quite surprised at how well it worked, honestly.
Does this PR introduce a user-facing change?