Skip to content

Commit

Permalink
Introduce new parameter Expected Failures List
Browse files Browse the repository at this point in the history
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.

Depends-On: openstack-k8s-operators/ci-framework#2513
  • Loading branch information
kstrenkova committed Nov 7, 2024
1 parent e077108 commit 356f40e
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
tempest.api.identity.admin.v3.test_credentials.CredentialsTestJSON
tempest.api.identity.admin.v3.test_tokens.TokensV3TestJSON.test_rescope_token
tempest.api.identity.admin.v3.test_users.UsersV3TestJSON.test_update_user_password
cifmw_test_operator_tempest_expected_failures_list: |
foobar
cifmw_tempest_tempestconf_config:
overrides: |
compute-feature-enabled.dhcp_domain ''
Expand Down
12 changes: 12 additions & 0 deletions api/bases/test.openstack.org_tempests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ spec:
description: A content of exclude.txt file that is passed to tempest
via --exclude-list
type: string
expectedFailuresList:
description: The expectedFailuresList parameter contains tests
that should not count as failures. When a test from this list
fails, the test pod ends with Completed state rather than with
Error state.
type: string
externalPlugin:
description: ExternalPlugin contains information about plugin
that should be installed within the tempest test pod. If this
Expand Down Expand Up @@ -603,6 +609,12 @@ spec:
description: A content of exclude.txt file that is passed
to tempest via --exclude-list
type: string
expectedFailuresList:
description: The expectedFailuresList parameter contains
tests that should not count as failures. When a test from
this list fails, the test pod ends with Completed state
rather than with Error state.
type: string
externalPlugin:
description: ExternalPlugin contains information about plugin
that should be installed within the tempest test pod.
Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/tempest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ 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 expectedFailuresList parameter contains tests that should not count
// as failures. When a test from this list fails, the test pod ends with
// Completed state rather than with Error state.
ExpectedFailuresList string `json:"expectedFailuresList"`

// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +kubebuilder:default:=0
Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/tempest_types_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ 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 expectedFailuresList parameter contains tests that should not count
// as failures. When a test from this list fails, the test pod ends with
// Completed state rather than with Error state.
ExpectedFailuresList *string `json:"expectedFailuresList,omitempty"`

// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec
// Concurrency value that is passed to tempest via --concurrency
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions config/crd/bases/test.openstack.org_tempests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ spec:
description: A content of exclude.txt file that is passed to tempest
via --exclude-list
type: string
expectedFailuresList:
description: The expectedFailuresList parameter contains tests
that should not count as failures. When a test from this list
fails, the test pod ends with Completed state rather than with
Error state.
type: string
externalPlugin:
description: ExternalPlugin contains information about plugin
that should be installed within the tempest test pod. If this
Expand Down Expand Up @@ -603,6 +609,12 @@ spec:
description: A content of exclude.txt file that is passed
to tempest via --exclude-list
type: string
expectedFailuresList:
description: The expectedFailuresList parameter contains
tests that should not count as failures. When a test from
this list fails, the test pod ends with Completed state
rather than with Error state.
type: string
externalPlugin:
description: ExternalPlugin contains information about plugin
that should be installed within the tempest test pod.
Expand Down
2 changes: 2 additions & 0 deletions config/samples/test_v1beta1_tempest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.test_tokens.TokensV3Test.test_create_token
# workerFile: | # <-- Use | to preserve \n
# - worker:
# - tempest.api.*
Expand Down
7 changes: 7 additions & 0 deletions controllers/tempest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 356f40e

Please sign in to comment.