From e6ba014d293674552a4cc28bc50cde2a489fa7c7 Mon Sep 17 00:00:00 2001 From: dirgim Date: Thu, 5 Dec 2024 14:20:33 +0100 Subject: [PATCH] doc: custom timeout annotations for integration tests * It is possible to set custom pipeline timeouts via annotations Signed-off-by: dirgim rh-pre-commit.version: 2.2.0 rh-pre-commit.check-secrets: ENABLED --- .../how-tos/testing/integration/creating.adoc | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/modules/ROOT/pages/how-tos/testing/integration/creating.adoc b/docs/modules/ROOT/pages/how-tos/testing/integration/creating.adoc index 90904d51..3cc60962 100644 --- a/docs/modules/ROOT/pages/how-tos/testing/integration/creating.adoc +++ b/docs/modules/ROOT/pages/how-tos/testing/integration/creating.adoc @@ -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.