Skip to content

Commit 7693d8c

Browse files
committed
Introduce new parameter Expected Failures List
The Expected Failures List parameter will help with specifying set of tests whose failures we want to ignore. By adding test to this list, its failure will not have impact on the jobs pass/fail. It can help with not having to re-run long running jobs and save time and resources in specific cases, for example when dealing with flaky tests.
1 parent eae3554 commit 7693d8c

7 files changed

+42
-0
lines changed

api/bases/test.openstack.org_tempests.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ spec:
168168
description: A content of exclude.txt file that is passed to tempest
169169
via --exclude-list
170170
type: string
171+
expectedFailuresList:
172+
description: A content of expected_failures.txt file that is passed
173+
to tempest via --expected-failures-list
174+
type: string
171175
externalPlugin:
172176
description: ExternalPlugin contains information about plugin
173177
that should be installed within the tempest test pod. If this
@@ -603,6 +607,10 @@ spec:
603607
description: A content of exclude.txt file that is passed
604608
to tempest via --exclude-list
605609
type: string
610+
expectedFailuresList:
611+
description: A content of expected_failures.txt file that
612+
is passed to tempest via --expected-failures-list
613+
type: string
606614
externalPlugin:
607615
description: ExternalPlugin contains information about plugin
608616
that should be installed within the tempest test pod.

api/v1beta1/tempest_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ type TempestRunSpec struct {
151151
// A content of exclude.txt file that is passed to tempest via --exclude-list
152152
ExcludeList string `json:"excludeList"`
153153

154+
// +kubebuilder:validation:Optional
155+
// +operator-sdk:csv:customresourcedefinitions:type=spec
156+
// A content of expected_failures.txt file that is passed to tempest via
157+
// --expected-failures-list
158+
ExpectedFailuresList string `json:"expectedFailuresList"`
159+
154160
// +kubebuilder:validation:Optional
155161
// +operator-sdk:csv:customresourcedefinitions:type=spec
156162
// +kubebuilder:default:=0

api/v1beta1/tempest_types_workflow.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ type WorkflowTempestRunSpec struct {
3030
// A content of exclude.txt file that is passed to tempest via --exclude-list
3131
ExcludeList *string `json:"excludeList,omitempty"`
3232

33+
// +kubebuilder:validation:Optional
34+
// +operator-sdk:csv:customresourcedefinitions:type=spec
35+
// A content of expected_failures.txt file that is passed to tempest via
36+
// --expected-failures-list
37+
ExpectedFailuresList *string `json:"expectedFailuresList,omitempty"`
38+
3339
// +kubebuilder:validation:Optional
3440
// +operator-sdk:csv:customresourcedefinitions:type=spec
3541
// Concurrency value that is passed to tempest via --concurrency

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ spec:
168168
description: A content of exclude.txt file that is passed to tempest
169169
via --exclude-list
170170
type: string
171+
expectedFailuresList:
172+
description: A content of expected_failures.txt file that is passed
173+
to tempest via --expected-failures-list
174+
type: string
171175
externalPlugin:
172176
description: ExternalPlugin contains information about plugin
173177
that should be installed within the tempest test pod. If this
@@ -603,6 +607,10 @@ spec:
603607
description: A content of exclude.txt file that is passed
604608
to tempest via --exclude-list
605609
type: string
610+
expectedFailuresList:
611+
description: A content of expected_failures.txt file that
612+
is passed to tempest via --expected-failures-list
613+
type: string
606614
externalPlugin:
607615
description: ExternalPlugin contains information about plugin
608616
that should be installed within the tempest test pod.

config/samples/test_v1beta1_tempest.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ spec:
4646
concurrency: 8
4747
# excludeList: | # <-- Use | to preserve \n
4848
# tempest.api.identity.v3.*
49+
# expectedFailuresList: | # <-- Use | to preserve \n
50+
# tempest.api.identity.v3.*
4951
# workerFile: | # <-- Use | to preserve \n
5052
# - worker:
5153
# - tempest.api.*

controllers/tempest_controller.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,13 @@ func (r *TempestReconciler) setTempestConfigVars(envVars map[string]string,
444444
envVars["TEMPEST_EXCLUDE_LIST"] = testOperatorDir + excludeListFile
445445
}
446446

447+
value = mergeWithWorkflow(tRun.ExpectedFailuresList, wtRun.ExpectedFailuresList)
448+
if len(value) != 0 {
449+
expectedFailuresListFile := "expected_failures.txt"
450+
customData[expectedFailuresListFile] = value
451+
envVats["TEMPEST_EXPECTED_FAILURES_LIST"] = testOperatorDir + expectedFailuresListFile
452+
}
453+
447454
// Bool
448455
tempestBoolEnvVars := map[string]bool{
449456
"TEMPEST_SERIAL": mergeWithWorkflow(tRun.Serial, wtRun.Serial),

0 commit comments

Comments
 (0)