Integration tests

This document covers the integration tests that Konflux triggers after component build pipelines.

Integration tests ensure that all built components conform to some set of requirements. Adding an integration test is as simple as providing a reference to a git repository and the path to the Tekton pipeline that defines the test.

After a successful build pipeline, a snapshot is created with the just-produced component and the remaining component references from the application’s Global Candidate List. The configured integration test scenarios are then run against this snapshot. Note that in order for integration tests to successfully run, the service requires a valid pullspec for the components. If you need to run the snapshots through custom checks, you can also create your own integration tests.

The integration service tracks the most recently promoted component build using its Global Candidate List (or GCL). The GCL is a concept implemented through two status fields on each component CR. The LastPromotedImage and LastBuiltCommit field point to the most recently promoted container image and the associated commit SHA. The integration service updates these fields when a component’s build pipeline completes successfully upon a push event. Users have the ability to reset their component’s GCL to a desired state with a manually created override snapshot. When creating an override snapshot users provide a new valid container image and sha for a component which will reset the component’s Global Candidate List.

Konflux configures one integration test for all applications to enable manage compliance with Conforma by default. As with any other integration test, you can edit the tests including setting parameter values (for example the enterprise contract policy evaluated) and whether the tests are required to pass before the snapshot is promoted.

Additional resources