This test simulates typical user scenario (creation of Application, Component, build of a container image, testing it and releasing it).
It is possible to run this test against "downstream" (deployed via scripts in infra-deployments) and "upstream" (deployed via scripts in konflux-ci repository) version of Konflux.
- Fork https://github.com/redhat-appstudio-qe/hacbs-test-project to your GitHub org (specified in
MY_GITHUB_ORG
env var) - Make sure the cluster you are about to run this test against is public (i.e. hosted on a public cloud provider)
- Fork https://github.com/konflux-ci/testrepo to your GitHub org (specified in
MY_GITHUB_ORG
env var) - Make sure the cluster you are about to run this test against is public (i.e. hosted on a public cloud provider)
-
Setup
-
Test Scenario
- The application was created successfully
- The Component (default) Build finished successfully
- Snapshot was created and integration test finished successfully
- Setup
- Create a user namespace
- Create a managed namespace used by release service for validating and releasing the built image
- Create required resources in managed-namespace
- Secret with container image registry credentials (used for pushing the image to container registry)
- Service account that mounts the secret, including required roles and rolebindings
- PVC for the release pipeline
- Secret with cosign-public-key (used for validating the built image by EC)
- Release plan for the targeted application and (user) namespace
- Release strategy, Release plan admission
- Enterprise contract policy
- Test scenario
- The application and component were created successfully
- Verify that the initial PaC pull request was created in the component's repo (this will also trigger the default build pipelinerun)
- After merging the PR, there should be another build pipelinerun triggered in user namespace
- Make sure the pipelinerun completes successfully
- Make sure that the resulting SBOM file can be pulled from the container registry (where also the image was pushed) and it is saved in expected format
- Make sure that integration test pipelinerun is created and completes successfully
- The release pipeline should succeed and the release should be marked as successful
Steps to run Konflux demo test:
- Follow the instructions from the Readme scripts to install Konflux in E2E mode
- Run the E2E test:
ginkgo -v --label-filter="konflux"
- Follow the instructions in the konflux-ci repository to install Konflux and run tests in your Kubernetes/OpenShift cluster.
- To run the E2E test from this repository:
ginkgo -v --label-filter="upstream-konflux"
Note
The test specs in konflux-demo-suite are generated dynamically using ginkgo specs.
If you want to test your own Component (repository), all you need to do is to update the TestScenarios
variable in scenarios.go
- Define in your configuration for the application and the component Example of a test scenario for GitHub private repository:
var ApplicationSpecs = []ApplicationSpec{
{
Name: "nodejs private component test",
ApplicationName: "nodejs-private-app",
ComponentSpec: ComponentSpec{
{
Name: "nodejs-private-comp",
Private: true,
Language: "JavaScript",
GitSourceUrl: "https://github.com/redhat-appstudio-qe-bot/nodejs-health-check.git",
},
},
},
}
- Run the e2e tests