diff --git a/api/bases/test.openstack.org_tempests.yaml b/api/bases/test.openstack.org_tempests.yaml index 48c2e5e4..c2b4e883 100644 --- a/api/bases/test.openstack.org_tempests.yaml +++ b/api/bases/test.openstack.org_tempests.yaml @@ -168,6 +168,11 @@ spec: description: A content of exclude.txt file that is passed to tempest via --exclude-list type: string + expectedFailuresList: + description: The expected_failures.txt file contains tests that + should not count as failures for the job, as they are expected + to fail. + type: string externalPlugin: description: ExternalPlugin contains information about plugin that should be installed within the tempest test pod. If this @@ -603,6 +608,11 @@ spec: description: A content of exclude.txt file that is passed to tempest via --exclude-list type: string + expectedFailuresList: + description: The expected_failures.txt file contains tests + that should not count as failures for the job, as they + are expected to fail. + type: string externalPlugin: description: ExternalPlugin contains information about plugin that should be installed within the tempest test pod. diff --git a/api/v1beta1/tempest_types.go b/api/v1beta1/tempest_types.go index 896ccb08..b8f02aa2 100644 --- a/api/v1beta1/tempest_types.go +++ b/api/v1beta1/tempest_types.go @@ -151,6 +151,12 @@ type TempestRunSpec struct { // A content of exclude.txt file that is passed to tempest via --exclude-list ExcludeList string `json:"excludeList"` + // +kubebuilder:validation:Optional + // +operator-sdk:csv:customresourcedefinitions:type=spec + // The expected_failures.txt file contains tests that should not count + // as failures for the job, as they are expected to fail. + ExpectedFailuresList string `json:"expectedFailuresList"` + // +kubebuilder:validation:Optional // +operator-sdk:csv:customresourcedefinitions:type=spec // +kubebuilder:default:=0 diff --git a/api/v1beta1/tempest_types_workflow.go b/api/v1beta1/tempest_types_workflow.go index a1b74ae4..4a9aa54a 100644 --- a/api/v1beta1/tempest_types_workflow.go +++ b/api/v1beta1/tempest_types_workflow.go @@ -30,6 +30,12 @@ type WorkflowTempestRunSpec struct { // A content of exclude.txt file that is passed to tempest via --exclude-list ExcludeList *string `json:"excludeList,omitempty"` + // +kubebuilder:validation:Optional + // +operator-sdk:csv:customresourcedefinitions:type=spec + // The expected_failures.txt file contains tests that should not count + // as failures for the job, as they are expected to fail. + ExpectedFailuresList *string `json:"expectedFailuresList,omitempty"` + // +kubebuilder:validation:Optional // +operator-sdk:csv:customresourcedefinitions:type=spec // Concurrency value that is passed to tempest via --concurrency diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 211c2d77..0f1882d7 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -715,6 +715,11 @@ func (in *WorkflowTempestRunSpec) DeepCopyInto(out *WorkflowTempestRunSpec) { *out = new(string) **out = **in } + if in.ExpectedFailuresList != nil { + in, out := &in.ExpectedFailuresList, &out.ExpectedFailuresList + *out = new(string) + **out = **in + } if in.Concurrency != nil { in, out := &in.Concurrency, &out.Concurrency *out = new(int64) diff --git a/config/crd/bases/test.openstack.org_tempests.yaml b/config/crd/bases/test.openstack.org_tempests.yaml index 48c2e5e4..c2b4e883 100644 --- a/config/crd/bases/test.openstack.org_tempests.yaml +++ b/config/crd/bases/test.openstack.org_tempests.yaml @@ -168,6 +168,11 @@ spec: description: A content of exclude.txt file that is passed to tempest via --exclude-list type: string + expectedFailuresList: + description: The expected_failures.txt file contains tests that + should not count as failures for the job, as they are expected + to fail. + type: string externalPlugin: description: ExternalPlugin contains information about plugin that should be installed within the tempest test pod. If this @@ -603,6 +608,11 @@ spec: description: A content of exclude.txt file that is passed to tempest via --exclude-list type: string + expectedFailuresList: + description: The expected_failures.txt file contains tests + that should not count as failures for the job, as they + are expected to fail. + type: string externalPlugin: description: ExternalPlugin contains information about plugin that should be installed within the tempest test pod. diff --git a/config/samples/test_v1beta1_tempest.yaml b/config/samples/test_v1beta1_tempest.yaml index 47cc9e8d..1f47b59b 100644 --- a/config/samples/test_v1beta1_tempest.yaml +++ b/config/samples/test_v1beta1_tempest.yaml @@ -46,6 +46,8 @@ spec: concurrency: 8 # excludeList: | # <-- Use | to preserve \n # tempest.api.identity.v3.* + # expectedFailuresList: | # <-- Use | to preserve \n + # tempest.api.identity.v3.* # workerFile: | # <-- Use | to preserve \n # - worker: # - tempest.api.* diff --git a/controllers/tempest_controller.go b/controllers/tempest_controller.go index 99757300..6a57b292 100644 --- a/controllers/tempest_controller.go +++ b/controllers/tempest_controller.go @@ -444,6 +444,13 @@ func (r *TempestReconciler) setTempestConfigVars(envVars map[string]string, envVars["TEMPEST_EXCLUDE_LIST"] = testOperatorDir + excludeListFile } + value = mergeWithWorkflow(tRun.ExpectedFailuresList, wtRun.ExpectedFailuresList) + if len(value) != 0 { + expectedFailuresListFile := "expected_failures.txt" + customData[expectedFailuresListFile] = value + envVars["TEMPEST_EXPECTED_FAILURES_LIST"] = testOperatorDir + expectedFailuresListFile + } + // Bool tempestBoolEnvVars := map[string]bool{ "TEMPEST_SERIAL": mergeWithWorkflow(tRun.Serial, wtRun.Serial),