-
Notifications
You must be signed in to change notification settings - Fork 301
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
Extend unit-test coverage for jobframework #979
Extend unit-test coverage for jobframework #979
Conversation
* New tests validate that job is suspended if it's parent workload is not found, or if it's admitted.
Hi @stuton. 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. Instructions 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/test-infra repository. |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
/assign @trasc |
/ok-to-test |
37507b8
to
cfba333
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.
Can you add some scenarios for suspending/unsuspending the job (verifying how the node selectors and job counts (parraleism) are managed).
cfba333
to
2d9ce49
Compare
2d9ce49
to
057c254
Compare
@@ -149,7 +149,7 @@ vet: ## Run go vet against code. | |||
|
|||
.PHONY: test | |||
test: generate gotestsum ## Run tests. | |||
$(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml -- $(GO_TEST_FLAGS) $(shell $(GO_CMD) list ./... | grep -v '/test/') -coverprofile $(ARTIFACTS)/cover.out | |||
$(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml -- $(GO_TEST_FLAGS) $(shell $(GO_CMD) list ./... | grep -v '/test/') -coverpkg=./... -coverprofile $(ARTIFACTS)/cover.out |
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.
what is this change for?
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.
since we are using reconciler in integration tests we need to enable coverage of this external package. This option helps calculate coverage for reconciler package
@@ -434,58 +434,6 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu | |||
}) | |||
}) | |||
|
|||
var _ = ginkgo.Describe("Job controller for workloads with no queue set", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() { |
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.
Awesome, reducing integration tests without losing coverage is a good outcome
755849e
to
d89274b
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.
/lgtm
Just some non-blocking nits, like adding test cases, but they can be added in follow ups
d89274b
to
712aa75
Compare
Added two unit tests for reconciler.go
712aa75
to
164145d
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.
/lgtm
+1, The unit tests run much faster than integration tests and allow to easily use debugger. While there is value in integration tests, we can add less of them for the new integrations.
/assign @alculquicondor
} | ||
return nil, fmt.Errorf("%w: deleted %d workloads", ErrExtraWorkloads, len(workloads.Items)) | ||
return nil, fmt.Errorf("%w: deleted %d workloads", ErrExtraWorkloads, len(toDelete)) |
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.
Actually, IIUC, this fixes a bug in logging, nice.
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, stuton The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs 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:
Which issue(s) this PR fixes:
Fixes #922
Special notes for your reviewer:
Does this PR introduce a user-facing change?