Editing integration tests

Once you have added an Integration Test Scenario to Konflux, you may want to change the configurations for it.

Prerequisites
Procedure

Complete the following steps in the Konflux console:

  1. Open an existing application and go to the Integration tests tab.

  2. Select the three dots on the right side of the table.

  3. Select the Edit action.

  4. Make any changes to the test that are needed

    • Modify the GitHub URL if you need to specify a different repository.

    • Modify the Revision if you need to use a different branch, tag, or commit in the repository.

    • Modify the Path in repository to point to a new location for the .yaml file.

    • Add or remove Parameters which are passed to the integration test scenario.

    • Modify whether this integration test scenario is required or optional for release.

    A failing integration test marks the application snapshot as failed. A failing required test will prevent the automated release. If you have selected Mark as optional for release, a failure in this test will still result in an automated release of the application snapshot.
  5. Select Save changes.

  6. To start building a new component (and afterwards trigger a new integration test), either open a new pull request (PR) that targets the tracked branch of a component in the application, or comment '/retest' on an existing PR.

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.

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 Getting started in the CLI page):

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

Configuring the enterprise contract policy

All applications created in Konflux will have one integration test scenario to enable manage compliance with Enterprise Contract by default. You can configure your tests to use a customized Kubernetes Custom Resource policy on the cluster.

Procedure

Complete the following steps in the Konflux console:

  1. Open an existing application and go to the Integration tests tab.

  2. Select the three dots on the right side of the table.

  3. Select the Edit action.

  4. Click on Add parameter.

    • In Name, write POLICY_CONFIGURATION

    • In Value, write the namespace and CR name for the policy, <namespace>/<policy-name>

  5. Click on Save changes.

  6. To start building a new component (and afterwards trigger a new integration test), either open a new pull request (PR) that targets the tracked branch of a component in the application, or comment '/retest' on an existing PR.

Verification

When the new build is finished:

  1. Go to the Integration tests tab and select the highlighted name of your test.

  2. Go to the Pipeline runs tab of that test and select the most recent run.

  3. On the Details page, you can see if the test succeeded for that component. The policy used by the test should be updated.