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

Add integration test for changes in PR #562 #563

Open
danielvegamyhre opened this issue May 9, 2024 · 4 comments
Open

Add integration test for changes in PR #562 #563

danielvegamyhre opened this issue May 9, 2024 · 4 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

Comments

@danielvegamyhre
Copy link
Contributor

What would you like to be added:
Integration tests for changes in #562

Why is this needed:
Improving test coverage

@danielvegamyhre
Copy link
Contributor Author

@googs1025 if you want to take a shot at this feel free, I was running into some strange issues adding an integration test for this, probably some error I was overlooking with tired eyes. If not no worries, I'll resume work on it tomorrow.

@googs1025
Copy link
Member

@danielvegamyhre Sorry, I just saw it now. Thanks for your invitation.I am not familiar with how to write integration tests. You can finish it first. I will look at this PR to learn how to write integration tests.

@danielvegamyhre danielvegamyhre added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label May 14, 2024
@googs1025
Copy link
Member

Hello, @danielvegamyhre , I'm trying to write this integration test case, but I keep encountering an error. It seems that the jobs are not being deleted properly when performing the deletion. I'm not sure where I went wrong as I'm not familiar with integration testing myself.

ginkgo.Entry("jobset with foreground delete should delete all child jobs", &testCase{
			makeJobSet: testJobSet,
			updates: []*update{
				{
					jobSetUpdateFn: func(js *jobset.JobSet) {
						gomega.Expect(k8sClient.Delete(ctx, js, client.PropagationPolicy(metav1.DeletePropagationForeground))).To(gomega.Succeed())
					},
					checkJobSetState: func(js *jobset.JobSet) {
						expectedJobNum := 0
						gomega.Eventually(func() bool {
							var jobList batchv1.JobList
							gomega.Expect(k8sClient.List(ctx, &jobList, client.InNamespace(js.Namespace))).To(gomega.Succeed())
							return len(jobList.Items) == expectedJobNum
						}, timeout, interval).Should(gomega.Equal(true))
					},
				},
			},
		}),

@danielvegamyhre
Copy link
Contributor Author

@googs1025 yeah I ran into the same issue when writing the integration test. Haven't had a chance to debug it yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Projects
None yet
Development

No branches or pull requests

2 participants