|
| 1 | +# Konflux integration test cases |
| 2 | +As RedHat uses Konflux to build, verify and release containers now, all fdo containers will be built in konflux. The integration test cases defined in this folder will be triggered by konflux when new fdo container images are built. |
| 3 | + |
| 4 | +## How konflux trigger test cases |
| 5 | +konflux defines integration test workflow in this file: (when writing this doc, below files are not merged into konflux yet, will update it later) |
| 6 | +- https://gitlab.cee.redhat.com/releng/konflux-release-data/-/merge_requests/2167/diffs#3904e36f53d22f073f197dedd0bd6355289a0053 |
| 7 | + |
| 8 | +Within this file, it defines fdo repo url and test file path: |
| 9 | +- fdo repo: https://gitlab.cee.redhat.com/releng/konflux-release-data/-/merge_requests/2167/diffs#3904e36f53d22f073f197dedd0bd6355289a0053_0_15 |
| 10 | +- test file: https://gitlab.cee.redhat.com/releng/konflux-release-data/-/merge_requests/2167/diffs#3904e36f53d22f073f197dedd0bd6355289a0053_0_19 |
| 11 | + |
| 12 | +When konflux trigger integration test workflow, it will go to fdo repo and get the test file, and execute the tasks defined in test file. |
| 13 | + |
| 14 | +## Test files in this folder |
| 15 | +There are four pipeline files and one test file in this folder. |
| 16 | +- fdo-manufacturing-server-integration-tests.yaml |
| 17 | +- fdo-owner-onboarding-server-integration-tests.yaml |
| 18 | +- fdo-rendezvous-server-integration-tests.yaml |
| 19 | +- fdo-serviceinfo-api-server-integration-tests.yaml |
| 20 | +- fdo-container-test.yaml |
| 21 | + |
| 22 | +## Test case definition (manufacturing server test case as example) |
| 23 | +There are two yaml files for manufacturing server test. |
| 24 | + |
| 25 | +- fdo-manufacturing-server-integration-tests.yaml: This is the test file defined in konflux integration test workflow file, this file defines parameters, env variables and tasks. It also defines a task file path and pass all the parameters to that task file. |
| 26 | + Example of parameters: |
| 27 | + - SNAPSHOT: a parameter from konflux, it is basically the description of container that was built. |
| 28 | + - GIT_URL: tell konflux which git repo to get |
| 29 | + - GIT_REF: tell konflux which branch to use |
| 30 | + |
| 31 | +- fdo-container-test.yaml: This is the task file that defined in fdo-manufacturing-server-integration-tests.yaml, it defines some actions: |
| 32 | + - get secrets from konflux |
| 33 | + - set parameters |
| 34 | + - get the url of fdo container we want to test |
| 35 | + - run bash script |
| 36 | + |
| 37 | +## How to get fdo container |
| 38 | +In task yaml file, we can use parameter SNAPSHOT to retrieve container image url, the returned value will be like quay.io/fido-fdo/serviceinfo-api-server |
| 39 | +- IMAGE=$(echo "${SNAPSHOT}" | jq -r ".components[]|select(.name==\"$COMPONENT\")|.containerImage") |
| 40 | + |
| 41 | +## How to set test runner |
| 42 | +In task yaml file, we can specify the os and version of test runner to execute all the actions. |
| 43 | +Set image like this, "- image: quay.io/testing-farm/cli:latest" |
| 44 | +- It means to use the latest testing-farm cli container as runner, the benefit is that if you want to reserve a testing-farm machine to run test cases, you can use testing-farm command directly in script section and no need to install testing-farm related packages. |
| 45 | +- If you want to run test cases in this runner directly, just write all test cases in script section. |
| 46 | + |
| 47 | +Depends on the os of test runner, you need to use different commands in bash script. |
| 48 | + - For testing-farm runner, run apk to install packages |
| 49 | + - For RHEL, Centos-Stream, Fedora, run dnf or yum to install packages. |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
0 commit comments