Skip to content

Commit e632356

Browse files
Merge pull request #330 from sdatko/tempest-rerun
Add support for tempest re-run feature
2 parents 930587e + 4712306 commit e632356

File tree

5 files changed

+84
-0
lines changed

5 files changed

+84
-0
lines changed

api/bases/test.openstack.org_tempests.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,19 @@ spec:
12211221
needed for certain test-operator functionalities to work properly (e.g.:
12221222
extraRPMs in Tempest CR, or certain set of tobiko tests).
12231223
type: boolean
1224+
rerunFailedTests:
1225+
default: false
1226+
description: |-
1227+
Activate tempest re-run feature. When activated, tempest will perform
1228+
another run of the tests that failed during the first execution.
1229+
type: boolean
1230+
rerunOverrideStatus:
1231+
default: false
1232+
description: |-
1233+
Allow override of exit status with the tempest re-run feature.
1234+
When activated, the original return value of the tempest run will be
1235+
overridden with a result of the tempest run on the set of failed tests.
1236+
type: boolean
12241237
resources:
12251238
default:
12261239
limits:
@@ -1762,6 +1775,19 @@ spec:
17621775
functionalities to work properly (e.g.: extraRPMs in Tempest CR, or certain set
17631776
of tobiko tests).
17641777
type: boolean
1778+
rerunFailedTests:
1779+
default: false
1780+
description: |-
1781+
Activate tempest re-run feature. When activated, tempest will perform
1782+
another run of the tests that failed during the first execution.
1783+
type: boolean
1784+
rerunOverrideStatus:
1785+
default: false
1786+
description: |-
1787+
Allow override of exit status with the tempest re-run feature.
1788+
When activated, the original return value of the tempest run will be
1789+
overridden with a result of the tempest run on the set of failed tests.
1790+
type: boolean
17651791
resources:
17661792
description: |-
17671793
The desired amount of resources that should be assigned to each test pod

api/v1beta1/tempest_types.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,21 @@ type TempestSpec struct {
427427
// that may have been left out.
428428
Cleanup bool `json:"cleanup"`
429429

430+
// +kubebuilder:validation:Optional
431+
// +operator-sdk:csv:customresourcedefinitions:type=spec
432+
// +kubebuilder:default:=false
433+
// Activate tempest re-run feature. When activated, tempest will perform
434+
// another run of the tests that failed during the first execution.
435+
RerunFailedTests bool `json:"rerunFailedTests"`
436+
437+
// +kubebuilder:validation:Optional
438+
// +operator-sdk:csv:customresourcedefinitions:type=spec
439+
// +kubebuilder:default:=false
440+
// Allow override of exit status with the tempest re-run feature.
441+
// When activated, the original return value of the tempest run will be
442+
// overridden with a result of the tempest run on the set of failed tests.
443+
RerunOverrideStatus bool `json:"rerunOverrideStatus"`
444+
430445
// +kubebuilder:validation:Optional
431446
// +operator-sdk:csv:customresourcedefinitions:type=spec
432447
// NetworkAttachments is a list of NetworkAttachment resource names to expose

api/v1beta1/tempest_types_workflow.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,21 @@ type WorkflowTempestSpec struct {
253253
// behaviour then set this option to true.
254254
Parallel *bool `json:"parallel,omitempty"`
255255

256+
// +kubebuilder:validation:Optional
257+
// +operator-sdk:csv:customresourcedefinitions:type=spec
258+
// +kubebuilder:default:=false
259+
// Activate tempest re-run feature. When activated, tempest will perform
260+
// another run of the tests that failed during the first execution.
261+
RerunFailedTests bool `json:"rerunFailedTests"`
262+
263+
// +kubebuilder:validation:Optional
264+
// +operator-sdk:csv:customresourcedefinitions:type=spec
265+
// +kubebuilder:default:=false
266+
// Allow override of exit status with the tempest re-run feature.
267+
// When activated, the original return value of the tempest run will be
268+
// overridden with a result of the tempest run on the set of failed tests.
269+
RerunOverrideStatus bool `json:"rerunOverrideStatus"`
270+
256271
// +kubebuilder:validation:Optional
257272
// +operator-sdk:csv:customresourcedefinitions:type=spec
258273
// NetworkAttachments is a list of NetworkAttachment resource names to expose

config/crd/bases/test.openstack.org_tempests.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,19 @@ spec:
12211221
needed for certain test-operator functionalities to work properly (e.g.:
12221222
extraRPMs in Tempest CR, or certain set of tobiko tests).
12231223
type: boolean
1224+
rerunFailedTests:
1225+
default: false
1226+
description: |-
1227+
Activate tempest re-run feature. When activated, tempest will perform
1228+
another run of the tests that failed during the first execution.
1229+
type: boolean
1230+
rerunOverrideStatus:
1231+
default: false
1232+
description: |-
1233+
Allow override of exit status with the tempest re-run feature.
1234+
When activated, the original return value of the tempest run will be
1235+
overridden with a result of the tempest run on the set of failed tests.
1236+
type: boolean
12241237
resources:
12251238
default:
12261239
limits:
@@ -1762,6 +1775,19 @@ spec:
17621775
functionalities to work properly (e.g.: extraRPMs in Tempest CR, or certain set
17631776
of tobiko tests).
17641777
type: boolean
1778+
rerunFailedTests:
1779+
default: false
1780+
description: |-
1781+
Activate tempest re-run feature. When activated, tempest will perform
1782+
another run of the tests that failed during the first execution.
1783+
type: boolean
1784+
rerunOverrideStatus:
1785+
default: false
1786+
description: |-
1787+
Allow override of exit status with the tempest re-run feature.
1788+
When activated, the original return value of the tempest run will be
1789+
overridden with a result of the tempest run on the set of failed tests.
1790+
type: boolean
17651791
resources:
17661792
description: |-
17671793
The desired amount of resources that should be assigned to each test pod

controllers/tempest_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,8 @@ func (r *TempestReconciler) generateServiceConfigMaps(
591591

592592
envVars["TEMPEST_DEBUG_MODE"] = r.GetDefaultBool(instance.Spec.Debug)
593593
envVars["TEMPEST_CLEANUP"] = r.GetDefaultBool(instance.Spec.Cleanup)
594+
envVars["TEMPEST_RERUN_FAILED_TESTS"] = r.GetDefaultBool(instance.Spec.RerunFailedTests)
595+
envVars["TEMPEST_RERUN_OVERRIDE_STATUS"] = r.GetDefaultBool(instance.Spec.RerunOverrideStatus)
594596

595597
cms := []util.Template{
596598
// ConfigMap

0 commit comments

Comments
 (0)