Skip to content
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

Merged
merged 3 commits into from
Jul 27, 2023

Conversation

stuton
Copy link
Contributor

@stuton stuton commented Jul 12, 2023

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?

NONE

Anton Stuchinskii and others added 2 commits July 12, 2023 14:42
* New tests validate that job is suspended if it's parent
  workload is not found, or if it's admitted.
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Jul 12, 2023
@k8s-ci-robot k8s-ci-robot requested review from tenzen-y and trasc July 12, 2023 15:35
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 12, 2023
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 12, 2023
@netlify
Copy link

netlify bot commented Jul 12, 2023

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 164145d
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/64c2344d253b230008b93c3c

@stuton
Copy link
Contributor Author

stuton commented Jul 12, 2023

/assign @trasc

@alculquicondor
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 12, 2023
@stuton stuton force-pushed the extend-unit-test-coverage branch 2 times, most recently from 37507b8 to cfba333 Compare July 12, 2023 15:57
Copy link
Contributor

@trasc trasc left a 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).

@stuton stuton force-pushed the extend-unit-test-coverage branch from cfba333 to 2d9ce49 Compare July 14, 2023 15:23
@stuton stuton force-pushed the extend-unit-test-coverage branch from 2d9ce49 to 057c254 Compare July 21, 2023 10:50
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 21, 2023
@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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() {
Copy link
Contributor

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

@stuton stuton force-pushed the extend-unit-test-coverage branch 2 times, most recently from 755849e to d89274b Compare July 24, 2023 12:46
Copy link
Contributor

@mimowo mimowo left a 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 25, 2023
@stuton stuton force-pushed the extend-unit-test-coverage branch from d89274b to 712aa75 Compare July 26, 2023 15:40
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 26, 2023
@stuton stuton force-pushed the extend-unit-test-coverage branch from 712aa75 to 164145d Compare July 27, 2023 09:09
Copy link
Contributor

@mimowo mimowo left a 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))
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 27, 2023
Copy link
Contributor

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 27, 2023
@alculquicondor alculquicondor added this to the v0.5 milestone Jul 27, 2023
@k8s-ci-robot k8s-ci-robot merged commit 24ea2ac into kubernetes-sigs:main Jul 27, 2023
@k8s-ci-robot k8s-ci-robot modified the milestones: v0.5, v0.4 Jul 27, 2023
@trasc trasc deleted the extend-unit-test-coverage branch March 12, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend the unit-test coverage for jobframework,
6 participants