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

Promote cronjob e2es to conformance #99851

Merged
merged 1 commit into from Mar 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions test/conformance/testdata/conformance.yaml
Expand Up @@ -598,6 +598,36 @@
and minor versions MUST only be an integer.
release: v1.19
file: test/e2e/apimachinery/server_version.go
- testname: CronJob Suspend
codename: '[sig-apps] CronJob should not schedule jobs when suspended [Slow] [Conformance]'
description: CronJob MUST support suspension, which suppresses creation of new jobs.
release: v1.21
file: test/e2e/apps/cronjob.go
- testname: CronJob FrobidConcurrent
codename: '[sig-apps] CronJob should not schedule new jobs when ForbidConcurrent
[Slow] [Conformance]'
description: CronJob MUST support ForbidConcurrent policy, allowing to run single,
previous job at the time.
release: v1.21
file: test/e2e/apps/cronjob.go
- testname: CronJob ReplaceConcurrent
codename: '[sig-apps] CronJob should replace jobs when ReplaceConcurrent [Conformance]'
description: CronJob MUST support ReplaceConcurrent policy, allowing to run single,
newer job at the time.
release: v1.21
file: test/e2e/apps/cronjob.go
- testname: CronJob AllowConcurrent
codename: '[sig-apps] CronJob should schedule multiple jobs concurrently [Conformance]'
description: CronJob MUST support AllowConcurrent policy, allowing to run multiple
jobs at the same time.
release: v1.21
file: test/e2e/apps/cronjob.go
- testname: CronJob API Operations
codename: '[sig-apps] CronJob should support CronJob API operations [Conformance]'
description: ' CronJob MUST support create, get, list, watch, update, patch, delete,
and deletecollection. CronJob/status MUST support get, update and patch.'
release: v1.21
file: test/e2e/apps/cronjob.go
- testname: DaemonSet-FailedPodCreation
codename: '[sig-apps] Daemon set [Serial] should retry creating failed daemon pods
[Conformance]'
Expand Down
41 changes: 32 additions & 9 deletions test/e2e/apps/cronjob.go
Expand Up @@ -64,8 +64,12 @@ var _ = SIGDescribe("CronJob", func() {
e2eskipper.SkipIfMissingResource(f.DynamicClient, CronJobGroupVersionResourceBeta, f.Namespace.Name)
})

// multiple jobs running at once
ginkgo.It("should schedule multiple jobs concurrently", func() {
/*
Release: v1.21
Testname: CronJob AllowConcurrent
Description: CronJob MUST support AllowConcurrent policy, allowing to run multiple jobs at the same time.
*/
framework.ConformanceIt("should schedule multiple jobs concurrently", func() {
ginkgo.By("Creating a cronjob")
cronJob := newTestCronJob("concurrent", "*/1 * * * ?", batchv1.AllowConcurrent,
sleepCommand, nil, nil)
Expand All @@ -87,8 +91,12 @@ var _ = SIGDescribe("CronJob", func() {
framework.ExpectNoError(err, "Failed to delete CronJob %s in namespace %s", cronJob.Name, f.Namespace.Name)
})

// suspended should not schedule jobs
ginkgo.It("should not schedule jobs when suspended [Slow]", func() {
/*
Release: v1.21
Testname: CronJob Suspend
Description: CronJob MUST support suspension, which suppresses creation of new jobs.
*/
framework.ConformanceIt("should not schedule jobs when suspended [Slow]", func() {
ginkgo.By("Creating a suspended cronjob")
cronJob := newTestCronJob("suspended", "*/1 * * * ?", batchv1.AllowConcurrent,
sleepCommand, nil, nil)
Expand All @@ -111,8 +119,12 @@ var _ = SIGDescribe("CronJob", func() {
framework.ExpectNoError(err, "Failed to delete CronJob %s in namespace %s", cronJob.Name, f.Namespace.Name)
})

// only single active job is allowed for ForbidConcurrent
ginkgo.It("should not schedule new jobs when ForbidConcurrent [Slow]", func() {
/*
Release: v1.21
Testname: CronJob FrobidConcurrent
Description: CronJob MUST support ForbidConcurrent policy, allowing to run single, previous job at the time.
*/
framework.ConformanceIt("should not schedule new jobs when ForbidConcurrent [Slow]", func() {
ginkgo.By("Creating a ForbidConcurrent cronjob")
cronJob := newTestCronJob("forbid", "*/1 * * * ?", batchv1.ForbidConcurrent,
sleepCommand, nil, nil)
Expand Down Expand Up @@ -143,8 +155,12 @@ var _ = SIGDescribe("CronJob", func() {
framework.ExpectNoError(err, "Failed to delete CronJob %s in namespace %s", cronJob.Name, f.Namespace.Name)
})

// only single active job is allowed for ReplaceConcurrent
ginkgo.It("should replace jobs when ReplaceConcurrent", func() {
/*
Release: v1.21
Testname: CronJob ReplaceConcurrent
Description: CronJob MUST support ReplaceConcurrent policy, allowing to run single, newer job at the time.
*/
framework.ConformanceIt("should replace jobs when ReplaceConcurrent", func() {
ginkgo.By("Creating a ReplaceConcurrent cronjob")
cronJob := newTestCronJob("replace", "*/1 * * * ?", batchv1.ReplaceConcurrent,
sleepCommand, nil, nil)
Expand Down Expand Up @@ -285,7 +301,14 @@ var _ = SIGDescribe("CronJob", func() {
ensureHistoryLimits(f.ClientSet, f.Namespace.Name, cronJob)
})

ginkgo.It("should support CronJob API operations", func() {
/*
Release: v1.21
Testname: CronJob API Operations
Description:
CronJob MUST support create, get, list, watch, update, patch, delete, and deletecollection.
CronJob/status MUST support get, update and patch.
*/
framework.ConformanceIt("should support CronJob API operations", func() {
ginkgo.By("Creating a cronjob")
successLimit := int32(1)
failedLimit := int32(0)
Expand Down