Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #236 from 14rcole/stoneintg-756
Browse files Browse the repository at this point in the history
doc(stoneintg-756): write how to manually re-trigger integration test
  • Loading branch information
gtrivedi88 authored Feb 7, 2024
2 parents 0730f0b + b71a755 commit e0cd39e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav-how-to-guides.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*** xref:how-to-guides/testing_applications/surface-level_tests.adoc[Surface-level tests]
*** xref:how-to-guides/testing_applications/proc_adding_an_integration_test.adoc[Adding an integration test]
*** xref:how-to-guides/testing_applications/proc_creating_custom_test.adoc[Creating a custom integration test]
*** xref:how-to-guides/testing_applications/proc_retriggering_integration_tests.adoc[Retriggering integration tests]
** Managing environments
*** xref:how-to-guides/managing-environments/con_overview_of_environments.adoc[Overview of {ProductName} environments]
*** xref:how-to-guides/managing-environments/proc_creating_your_own_environment.adoc[Creating your own environment]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
= Retriggering Integration Tests

Integration test scenarios for a given snapshot can be re-triggered by adding a label to the snapshot.

== 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 to xref:../../getting-started/getting_started_in_cli.adoc[Getting started in CLI]
- You have an up-to-date kubectl binary. Alternatively, the `oc` binary is also compatible.

== Procedure
. Identify the IntegrationTestScenario that needs to be rerun. For a given snapshot, you can only rerun one IntegrationTestScenario.
. Label the snapshot with `test.appstudio.openshift.io/run`, assigning the scenario name you wish to rerun as its value.
[source]
$ kubectl label [snapshot name] test.appstudio.openshift.io/run=[scenario name]

. 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.
[source]
$ tkn pipelinerun list

[Example Output]
NAME STARTED DURATION STATUS
integration-pipelinerun-jfrdb 4 seconds ago --- Running

. To verify the tests, run `tkn pipelinerun describe [pipelinerun]` and ensure that the labels `appstudio.openshift.io/snapshot` and `test.appstudio.openshift.io/scenario` reference the correct snapshot and scenario.
[source]
$ 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
...

0 comments on commit e0cd39e

Please sign in to comment.