Skip to content

Commit

Permalink
Promote cronjob e2es to conformance
Browse files Browse the repository at this point in the history
  • Loading branch information
soltysh committed Mar 6, 2021
1 parent bf448a1 commit 3c9bbe4
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 9 deletions.
30 changes: 30 additions & 0 deletions test/conformance/testdata/conformance.yaml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 3c9bbe4

Please sign in to comment.