Skip to content

Commit 6028f18

Browse files
Merge pull request #334 from openshift-cherrypick-robot/cherry-pick-330-to-18.0-fr3
[18.0-fr3] Add support for tempest re-run feature
2 parents 2d48bbe + 3f458c4 commit 6028f18

5 files changed

Lines changed: 84 additions & 0 deletions

File tree

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:
@@ -1744,6 +1757,19 @@ spec:
17441757
functionalities to work properly (e.g.: extraRPMs in Tempest CR, or certain set
17451758
of tobiko tests).
17461759
type: boolean
1760+
rerunFailedTests:
1761+
default: false
1762+
description: |-
1763+
Activate tempest re-run feature. When activated, tempest will perform
1764+
another run of the tests that failed during the first execution.
1765+
type: boolean
1766+
rerunOverrideStatus:
1767+
default: false
1768+
description: |-
1769+
Allow override of exit status with the tempest re-run feature.
1770+
When activated, the original return value of the tempest run will be
1771+
overridden with a result of the tempest run on the set of failed tests.
1772+
type: boolean
17471773
resources:
17481774
description: |-
17491775
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
@@ -409,6 +409,21 @@ type TempestSpec struct {
409409
// that may have been left out.
410410
Cleanup bool `json:"cleanup"`
411411

412+
// +kubebuilder:validation:Optional
413+
// +operator-sdk:csv:customresourcedefinitions:type=spec
414+
// +kubebuilder:default:=false
415+
// Activate tempest re-run feature. When activated, tempest will perform
416+
// another run of the tests that failed during the first execution.
417+
RerunFailedTests bool `json:"rerunFailedTests"`
418+
419+
// +kubebuilder:validation:Optional
420+
// +operator-sdk:csv:customresourcedefinitions:type=spec
421+
// +kubebuilder:default:=false
422+
// Allow override of exit status with the tempest re-run feature.
423+
// When activated, the original return value of the tempest run will be
424+
// overridden with a result of the tempest run on the set of failed tests.
425+
RerunOverrideStatus bool `json:"rerunOverrideStatus"`
426+
412427
// +kubebuilder:validation:Optional
413428
// +operator-sdk:csv:customresourcedefinitions:type=spec
414429
// 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
@@ -249,6 +249,21 @@ type WorkflowTempestSpec struct {
249249
// behaviour then set this option to true.
250250
Parallel *bool `json:"parallel,omitempty"`
251251

252+
// +kubebuilder:validation:Optional
253+
// +operator-sdk:csv:customresourcedefinitions:type=spec
254+
// +kubebuilder:default:=false
255+
// Activate tempest re-run feature. When activated, tempest will perform
256+
// another run of the tests that failed during the first execution.
257+
RerunFailedTests bool `json:"rerunFailedTests"`
258+
259+
// +kubebuilder:validation:Optional
260+
// +operator-sdk:csv:customresourcedefinitions:type=spec
261+
// +kubebuilder:default:=false
262+
// Allow override of exit status with the tempest re-run feature.
263+
// When activated, the original return value of the tempest run will be
264+
// overridden with a result of the tempest run on the set of failed tests.
265+
RerunOverrideStatus bool `json:"rerunOverrideStatus"`
266+
252267
// +kubebuilder:validation:Optional
253268
// +operator-sdk:csv:customresourcedefinitions:type=spec
254269
// 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:
@@ -1744,6 +1757,19 @@ spec:
17441757
functionalities to work properly (e.g.: extraRPMs in Tempest CR, or certain set
17451758
of tobiko tests).
17461759
type: boolean
1760+
rerunFailedTests:
1761+
default: false
1762+
description: |-
1763+
Activate tempest re-run feature. When activated, tempest will perform
1764+
another run of the tests that failed during the first execution.
1765+
type: boolean
1766+
rerunOverrideStatus:
1767+
default: false
1768+
description: |-
1769+
Allow override of exit status with the tempest re-run feature.
1770+
When activated, the original return value of the tempest run will be
1771+
overridden with a result of the tempest run on the set of failed tests.
1772+
type: boolean
17471773
resources:
17481774
description: |-
17491775
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)