Skip to content

Commit 1f917b1

Browse files
Merge pull request openstack-k8s-operators#233 from kstrenkova/add-expected-failures-list
Introduce new parameter Expected Failures List
2 parents bda006a + 356f40e commit 1f917b1

File tree

8 files changed

+54
-0
lines changed

8 files changed

+54
-0
lines changed

.zuul.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
tempest.api.identity.admin.v3.test_credentials.CredentialsTestJSON
5858
tempest.api.identity.admin.v3.test_tokens.TokensV3TestJSON.test_rescope_token
5959
tempest.api.identity.admin.v3.test_users.UsersV3TestJSON.test_update_user_password
60+
cifmw_test_operator_tempest_expected_failures_list: |
61+
foobar
6062
cifmw_tempest_tempestconf_config:
6163
overrides: |
6264
compute-feature-enabled.dhcp_domain ''

api/bases/test.openstack.org_tempests.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ 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: The expectedFailuresList parameter contains tests
173+
that should not count as failures. When a test from this list
174+
fails, the test pod ends with Completed state rather than with
175+
Error state.
176+
type: string
171177
externalPlugin:
172178
description: ExternalPlugin contains information about plugin
173179
that should be installed within the tempest test pod. If this
@@ -603,6 +609,12 @@ spec:
603609
description: A content of exclude.txt file that is passed
604610
to tempest via --exclude-list
605611
type: string
612+
expectedFailuresList:
613+
description: The expectedFailuresList parameter contains
614+
tests that should not count as failures. When a test from
615+
this list fails, the test pod ends with Completed state
616+
rather than with Error state.
617+
type: string
606618
externalPlugin:
607619
description: ExternalPlugin contains information about plugin
608620
that should be installed within the tempest test pod.

api/v1beta1/tempest_types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ 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+
// The expectedFailuresList parameter contains tests that should not count
157+
// as failures. When a test from this list fails, the test pod ends with
158+
// Completed state rather than with Error state.
159+
ExpectedFailuresList string `json:"expectedFailuresList"`
160+
154161
// +kubebuilder:validation:Optional
155162
// +operator-sdk:csv:customresourcedefinitions:type=spec
156163
// +kubebuilder:default:=0

api/v1beta1/tempest_types_workflow.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ 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+
// The expectedFailuresList parameter contains tests that should not count
36+
// as failures. When a test from this list fails, the test pod ends with
37+
// Completed state rather than with Error state.
38+
ExpectedFailuresList *string `json:"expectedFailuresList,omitempty"`
39+
3340
// +kubebuilder:validation:Optional
3441
// +operator-sdk:csv:customresourcedefinitions:type=spec
3542
// 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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ 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: The expectedFailuresList parameter contains tests
173+
that should not count as failures. When a test from this list
174+
fails, the test pod ends with Completed state rather than with
175+
Error state.
176+
type: string
171177
externalPlugin:
172178
description: ExternalPlugin contains information about plugin
173179
that should be installed within the tempest test pod. If this
@@ -603,6 +609,12 @@ spec:
603609
description: A content of exclude.txt file that is passed
604610
to tempest via --exclude-list
605611
type: string
612+
expectedFailuresList:
613+
description: The expectedFailuresList parameter contains
614+
tests that should not count as failures. When a test from
615+
this list fails, the test pod ends with Completed state
616+
rather than with Error state.
617+
type: string
606618
externalPlugin:
607619
description: ExternalPlugin contains information about plugin
608620
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.test_tokens.TokensV3Test.test_create_token
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
@@ -473,6 +473,13 @@ func (r *TempestReconciler) setTempestConfigVars(envVars map[string]string,
473473
envVars["TEMPEST_EXCLUDE_LIST"] = testOperatorDir + excludeListFile
474474
}
475475

476+
value = mergeWithWorkflow(tRun.ExpectedFailuresList, wtRun.ExpectedFailuresList)
477+
if len(value) != 0 {
478+
expectedFailuresListFile := "expected_failures.txt"
479+
customData[expectedFailuresListFile] = value
480+
envVars["TEMPEST_EXPECTED_FAILURES_LIST"] = testOperatorDir + expectedFailuresListFile
481+
}
482+
476483
// Bool
477484
tempestBoolEnvVars := map[string]bool{
478485
"TEMPEST_SERIAL": mergeWithWorkflow(tRun.Serial, wtRun.Serial),

0 commit comments

Comments
 (0)