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

Commit ca36fd0

Browse files
Merge pull request #185 from Chr1st1anSears/data-injection-custom-test
Add section about data injection
2 parents cd21332 + 3c43c4e commit ca36fd0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/modules/ROOT/pages/how-to-guides/testing_applications/proc_creating_custom_test.adoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,23 @@ spec:
9191
. Add your new custom test as an integration test in {ProductName}.
9292
.. For additional instructions on adding an integration test, see this document: xref:how-to-guides/testing_applications/proc_adding_an_integration_test.adoc[Adding an integration test].
9393

94+
.Data injected into the PipelineRun of the integration test
95+
96+
When you create a custom integration test, {ProductName} automatically adds certain parameters and labels to the PipelineRun of the integration test. This section explains what those parameters and labels are, and how they can help you.
97+
98+
Parameters:
99+
100+
* *`SNAPSHOT`*: contains the xref:../../glossary/index.adoc#_snapshot[snapshot] of the whole application as a JSON string. This JSON string provides useful information about the test, such as which components {ProductName} is testing, and what git repository and commit {ProductName} is using to build those components. For information about snapshot JSON string, see link:https://github.com/redhat-appstudio/integration-examples/blob/main/examples/snapshot_json_string_example[an example snapshot JSON string].
101+
* *`NAMESPACE`*: indicates which namespace {ProductName} uses for temporary deployment, but only if your integration test specifies that {ProductName} should deploy the snapshot to an ephemeral environment during testing. This parameter can help you query Kubernetes resources that are deployed in the test environment, such as routes, deployments, and pods.
102+
103+
Labels:
104+
105+
* *`appstudio.openshift.io/application`*: contains the name of the application.
106+
* *`appstudio.openshift.io/component`*: contains the name of the component.
107+
* *`appstudio.openshift.io/snapshot`*: contains the name of the snapshot.
108+
* *`test.appstudio.openshift.io/optional`*: contains the optional flag, which specifies whether or not components must pass the integration test before deployment.
109+
* *`test.appstudio.openshift.io/scenario`*: contains the name of the integration test (this label ends with "scenario," because each test is technically a custom resource called an `IntegrationTestScenario`).
110+
94111
.Verification
95112

96113
After adding the integration test to an application, you need to trigger a new build of its components to make {ProductName} run the integration test. Make a commit to the GitHub repositories of your components to trigger a new build.

0 commit comments

Comments
 (0)