Debugging Integration Tests
In case of an integration test scenario failing, there are several steps to take in order to debug the issue before rerunning the test in question. These steps are outlined below.
-
You have a snapshot that has completed all build-time tests. These must be completed before attempting to debug the failed test.
-
You have access to the Konflux UI in order to view the logs of the failed test.
-
Identify the IntegrationTestScenario that has failed
-
Open the Konflux and navigate to Application/your_application_name/activity
-
Select "Pipeline Runs" under "Activity By"
-
Your view should look similar to the below image.
-
-
Click on the pipeline run that has a status of "Failed". This will take you to a detailed view of the failed run.
-
Examine the "Log Snippet" section on the right side of this page. It contains the most recent error returned by the integration test. For more comprehensive logs, click on "See Logs". See the below image for reference.
-
In this example the output suggests that the pipelineRun is missing an expected parameter, "username". To edit the integration test, follow the procedure provided here.
-
Rerun the test by following the steps here.
-
Once the test has been rerun, verify that the test has passed by checking the "Pipeline Runs" tab in the Konflux console. The status of the test should now be "Succeeded". See the below image for reference.
Checking the service account of a test
An integration PipelineRun for a component snapshot normally uses the its-pipeline-<component-name> service account. To see which service account a PipelineRun used, run kubectl get pipelinerun <pipelinerun-name> -o yaml and read spec.taskRunTemplate.serviceAccountName. The annotations are under metadata.annotations.
If the PipelineRun used konflux-integration-runner and has the test.appstudio.openshift.io/service-account-fallback or integration.konflux-ci.dev/service-account-fallback annotation, the value of the annotation is the reason. For the values, see Service account of the integration PipelineRun.
The annotation is set only when Konflux replaced its-pipeline-<component-name> with konflux-integration-runner. It does not explain other failures.
If the PipelineRun used its-pipeline-<component-name> and the test failed with a forbidden error, a Role that you bound to konflux-integration-runner might not be bound to the service account of the component. See Roles that you bound to konflux-integration-runner.