Skip to content

Commit

Permalink
doc: custom timeout annotations for integration tests
Browse files Browse the repository at this point in the history
* It is possible to set custom pipeline timeouts via annotations

Signed-off-by: dirgim <[email protected]>

rh-pre-commit.version: 2.2.0
rh-pre-commit.check-secrets: ENABLED
  • Loading branch information
dirgim committed Dec 5, 2024
1 parent 4b4843f commit e6ba014
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/modules/ROOT/pages/how-tos/testing/integration/creating.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,28 @@ link:https://github.com/konflux-ci/integration-examples/blob/main/tasks/test_met
link:https://github.com/konflux-ci/integration-examples/blob/main/pipelines/integration_resolver_pipeline_pass_metadata.yaml[example integration pipeline]
which uses the information from that task's results to influence its workflow.

.Timeouts

It is possible to define custom timeouts on the pipeline level for individual IntegrationTestScenarios.
There are three timeouts that need to be defined:

* `Tasks` - specifies the timeout for the cumulative time taken by Tasks specified in `pipeline.spec.tasks`
* `Finally` - specifies the timeout for the cumulative time taken by finally Tasks specified in `pipeline.spec.finally`
* `Pipeline` - specifies the timeout for the entire PipelineRun.
** The sum of the other two timeouts must be equal to this timeout, otherwise the integration pipelineRuns will fail on creation.
NOTE: Since the integration service already sets default timeouts to integration pipelineRuns, it is necessary to set all of the above timeouts to prevent errors.

You can define the above timeouts by setting the annotations on the IntegrationTestScenario in the following
way through the CLI (consult the steps listed in the xref:/getting-started/cli.adoc[Getting started in the CLI] page):

[source,bash]
----
kubectl annotate integrationtestscenario/[scenario name] test.appstudio.openshift.io/finally_timeout=3h --overwrite
kubectl annotate integrationtestscenario/[scenario name] test.appstudio.openshift.io/tasks_timeout=5h --overwrite
kubectl annotate integrationtestscenario/[scenario name] test.appstudio.openshift.io/pipeline_timeout=8h --overwrite
----

.Verification

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.
Expand Down

0 comments on commit e6ba014

Please sign in to comment.