Skip to content

Commit 58be8ac

Browse files
committed
Reuse timing data in Tempest
We want to reuse timing data stored in the .stestr directory across multiple Tempest runs. This will help executed tempest tests to save time by optimizing the test order. This patch introduces a new parameter that will be used to specify where to find timing data to reuse.
1 parent bd8be4a commit 58be8ac

File tree

6 files changed

+50
-0
lines changed

6 files changed

+50
-0
lines changed

api/bases/test.openstack.org_tempests.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,13 @@ spec:
16301630
executed with --verbose
16311631
type: boolean
16321632
type: object
1633+
timingDataUrl:
1634+
description: |-
1635+
An URL pointing to an archive that contains the saved stestr timing data.
1636+
This data is used to optimize the tests order, which helps to reduce the
1637+
total Tempest execution time.
1638+
format: uri
1639+
type: string
16331640
tolerations:
16341641
description: |-
16351642
This value contains a toleration that is applied to pods spawned by the
@@ -2152,6 +2159,13 @@ spec:
21522159
be executed with --verbose
21532160
type: boolean
21542161
type: object
2162+
timingDataUrl:
2163+
description: |-
2164+
An URL pointing to an archive that contains the saved stestr timing data.
2165+
This data is used to optimize the tests order, which helps to reduce the
2166+
total Tempest execution time.
2167+
format: uri
2168+
type: string
21552169
tolerations:
21562170
description: |-
21572171
This value contains a toleration that is applied to pods spawned by the

api/v1beta1/tempest_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,14 @@ type TempestSpec struct {
442442
// overridden with a result of the tempest run on the set of failed tests.
443443
RerunOverrideStatus bool `json:"rerunOverrideStatus"`
444444

445+
// +kubebuilder:validation:Optional
446+
// +kubebuilder:validation:Format=uri
447+
// +operator-sdk:csv:customresourcedefinitions:type=spec
448+
// An URL pointing to an archive that contains the saved stestr timing data.
449+
// This data is used to optimize the tests order, which helps to reduce the
450+
// total Tempest execution time.
451+
TimingDataUrl string `json:"timingDataUrl,omitempty"`
452+
445453
// +kubebuilder:validation:Optional
446454
// +operator-sdk:csv:customresourcedefinitions:type=spec
447455
// NetworkAttachments is a list of NetworkAttachment resource names to expose

api/v1beta1/tempest_types_workflow.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,14 @@ type WorkflowTempestSpec struct {
266266
// overridden with a result of the tempest run on the set of failed tests.
267267
RerunOverrideStatus *bool `json:"rerunOverrideStatus,omitempty"`
268268

269+
// +kubebuilder:validation:Optional
270+
// +kubebuilder:validation:Format=uri
271+
// +operator-sdk:csv:customresourcedefinitions:type=spec
272+
// An URL pointing to an archive that contains the saved stestr timing data.
273+
// This data is used to optimize the tests order, which helps to reduce the
274+
// total Tempest execution time.
275+
TimingDataUrl *string `json:"timingDataUrl,omitempty"`
276+
269277
// +kubebuilder:validation:Optional
270278
// +operator-sdk:csv:customresourcedefinitions:type=spec
271279
// NetworkAttachments is a list of NetworkAttachment resource names to expose

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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,13 @@ spec:
16301630
executed with --verbose
16311631
type: boolean
16321632
type: object
1633+
timingDataUrl:
1634+
description: |-
1635+
An URL pointing to an archive that contains the saved stestr timing data.
1636+
This data is used to optimize the tests order, which helps to reduce the
1637+
total Tempest execution time.
1638+
format: uri
1639+
type: string
16331640
tolerations:
16341641
description: |-
16351642
This value contains a toleration that is applied to pods spawned by the
@@ -2152,6 +2159,13 @@ spec:
21522159
be executed with --verbose
21532160
type: boolean
21542161
type: object
2162+
timingDataUrl:
2163+
description: |-
2164+
An URL pointing to an archive that contains the saved stestr timing data.
2165+
This data is used to optimize the tests order, which helps to reduce the
2166+
total Tempest execution time.
2167+
format: uri
2168+
type: string
21552169
tolerations:
21562170
description: |-
21572171
This value contains a toleration that is applied to pods spawned by the

controllers/tempest_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ func (r *TempestReconciler) generateServiceConfigMaps(
593593
envVars["TEMPEST_CLEANUP"] = r.GetDefaultBool(instance.Spec.Cleanup)
594594
envVars["TEMPEST_RERUN_FAILED_TESTS"] = r.GetDefaultBool(instance.Spec.RerunFailedTests)
595595
envVars["TEMPEST_RERUN_OVERRIDE_STATUS"] = r.GetDefaultBool(instance.Spec.RerunOverrideStatus)
596+
envVars["TEMPEST_TIMING_DATA_URL"] = instance.Spec.TimingDataUrl
596597

597598
cms := []util.Template{
598599
// ConfigMap

0 commit comments

Comments
 (0)