Retriggering Integration Tests
Integration test(s) for a given snapshot can be re-triggered by adding the test.appstudio.openshift.io/run
label to the snapshot.
See also Retriggering build pipelines.
Supported Values for the label
-
all
: Reruns all the IntegrationTestScenarios (both optional and required) whose contexts match the snapshot. Example command:
$ kubectl label snapshot [snapshot name] test.appstudio.openshift.io/run=all
-
[scenario name]
: Reruns a specific IntegrationTestScenario, regardless of whether its context matches the snapshot. Replace [scenario name] with the name of the IntegrationTestScenario you want to retrigger. Example command:
$ kubectl label snapshot [snapshot name] test.appstudio.openshift.io/run=[scenario name]
Prerequisites
-
You have a snapshot that has completed all its initial tests. All initial tests must be finished before you trigger subsequent tests.
-
The snapshot for which tests will be retriggered has completed its initial tests.
-
You have CLI access to the specific OpenShift cluster. For information on obtaining CLI access, refer Getting started with the CLI.
Procedure
Identify the snapshot to retrigger tests for. You can find the related snapshot on the pipelineRun details page in the UI. Example:
Retrigger via UI:
-
Click on the three vertical dots on the right side of the pipelineRun details page seen above.
-
From the expanded menu, select "Rerun".
Retrigger via CLI:
-
Add the
test.appstudio.openshift.io/run
label to the snapshot, with any of the supported values as shown above. -
The tests are re-triggered automatically. Once they are re-triggered, the system removes the label, allowing you to apply a new label for a different scenario if you wish to test multiple scenarios. Verify that the test(s) have started.
$ tkn pipelinerun list [Example Output] NAME STARTED DURATION STATUS integration-pipelinerun-jfrdb 4 seconds ago --- Running
If you run the command long after retriggering, the pipelineRun might have been pruned. The output may also include other unrelated pipelineRuns.
Verification
-
To verify the tests, run
tkn pipelinerun describe [pipelinerun]
and ensure that the labelsappstudio.openshift.io/snapshot
andtest.appstudio.openshift.io/scenario
reference the correct snapshot and scenario.$ tkn pipelinerun describe integration-pipelinerun-jfrdb [Expected labels in the output] Name: integration-pipelinerun-jfrdb Namespace: default Service Account: appstudio-pipeline Labels: ... appstudio.openshift.io/snapshot=snapshot-sample ... test.appstudio.openshift.io/test=component ...