-
Notifications
You must be signed in to change notification settings - Fork 190
ci: add Testing Farm test via tmt for Konflux CI #4515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Roshan-R
wants to merge
3
commits into
coreos:main
Choose a base branch
from
Roshan-R:tmt-testing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| adjust+: | ||
| - when: arch == x86_64 or arch == aarch64 | ||
| provision: | ||
| hardware: | ||
| cpu: | ||
| processors: ">= 4" | ||
| memory: ">= 8 GB" | ||
| disk: | ||
| - size: ">= 50 GB" | ||
| virtualization: | ||
| is-supported: true | ||
| prepare: | ||
| - how: install | ||
| package: | ||
| - libvirt | ||
| - qemu-kvm | ||
| - qemu-img | ||
| - virt-install | ||
| - jq | ||
| - git-core | ||
| - skopeo | ||
| - podman | ||
| execute: | ||
| how: tmt | ||
| exit-first: true | ||
|
|
||
| /kola-qemu: | ||
| summary: run kola qemu tests | ||
| discover+: | ||
| how: fmf | ||
| test: | ||
| - init | ||
| - build-fcos | ||
| - build-qemu | ||
| - test-qemu | ||
|
|
||
| /kola-self-tests: | ||
| summary: run self-tests | ||
| discover+: | ||
| how: fmf | ||
| test: | ||
| - init | ||
| - build-fcos | ||
| - build-qemu | ||
| - test-kola-self | ||
|
|
||
| /kola-test-upgrade: | ||
| summary: run kola upgrade test | ||
| discover+: | ||
| how: fmf | ||
| test: | ||
| - init | ||
| - build-fcos | ||
| - build-qemu | ||
| - test-kola-upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/bin/bash | ||
| set -eo pipefail | ||
| set -x | ||
|
|
||
| source "utils.sh" | ||
|
|
||
| if [ "$TEST_CASE" = "build-fcos" ]; then | ||
| cosa build | ||
| elif [ "$TEST_CASE" = "build-qemu" ]; then | ||
| cosa osbuild qemu | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| export TEST_CASE="$TEST_CASE" | ||
| case "$TEST_CASE" in | ||
| "init") | ||
| ./init.sh | ||
| ;; | ||
| "build-fcos"|"build-qemu") | ||
| ./build.sh | ||
| ;; | ||
| "test-qemu"|"test-kola-upgrade"|"test-kola-self") | ||
| ./test.sh | ||
| ;; | ||
| *) | ||
| echo "Error: Test case '$TEST_CASE' not found!" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/bin/bash | ||
| set -eEuo pipefail | ||
| set -x | ||
|
|
||
| source "utils.sh" | ||
|
|
||
| CONFIG_GIT_URL="https://github.com/coreos/fedora-coreos-config" | ||
| CONFIG_GIT_REF="testing-devel" | ||
|
|
||
| echo "cosa container: $COREOS_ASSEMBLER_CONTAINER" | ||
| echo "arch: $(arch)" | ||
|
|
||
| echo "git version: $(git --version)" | ||
| echo "git url: ${CONFIG_GIT_URL}" | ||
| echo "git branch: ${CONFIG_GIT_REF}" | ||
|
|
||
| mkdir -p "$COSA_DIR" | ||
| cosa init --force "${CONFIG_GIT_URL}" --branch "${CONFIG_GIT_REF}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| test: ./entrypoint.sh | ||
|
|
||
| /init: | ||
| duration: 1h | ||
| order: 50 | ||
| environment: | ||
| TEST_CASE: init | ||
|
|
||
| /build-fcos: | ||
| duration: 1h | ||
| order: 60 | ||
| environment: | ||
| TEST_CASE: build-fcos | ||
|
|
||
| /build-qemu: | ||
| duration: 1h | ||
| order: 70 | ||
| environment: | ||
| TEST_CASE: build-qemu | ||
|
|
||
| /test-qemu: | ||
| duration: 2h | ||
| order: 80 | ||
| environment: | ||
| TEST_CASE: test-qemu | ||
|
|
||
| /test-kola-upgrade: | ||
| duration: 1h | ||
| order: 90 | ||
| environment: | ||
| TEST_CASE: test-kola-upgrade | ||
|
|
||
| /test-kola-self: | ||
| duration: 1h | ||
| order: 100 | ||
| environment: | ||
| TEST_CASE: test-kola-self | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #!/bin/bash | ||
| set -eEuo pipefail | ||
| set -x | ||
|
|
||
| source "utils.sh" | ||
| trap collect_kola_artifacts ERR | ||
|
|
||
| if [ "$TEST_CASE" = "test-qemu" ]; then | ||
| export KOLA_ACTION="run" | ||
| export KOLA_ID="kola" | ||
| export KOLA_EXTRA_ARGS=( | ||
| --rerun | ||
| --allow-rerun-success=tags=needs-internet | ||
| --on-warn-failure-exit-77 | ||
| --tag=!reprovision | ||
| --parallel=5 | ||
| ) | ||
| run_kola | ||
| collect_kola_artifacts | ||
|
|
||
| # reprovision test | ||
| export KOLA_ACTION="run" | ||
| export KOLA_ID="kola-reprovision" | ||
| export KOLA_EXTRA_ARGS=( | ||
| --tag=reprovision | ||
| ) | ||
| run_kola | ||
| collect_kola_artifacts | ||
|
|
||
| elif [ "$TEST_CASE" = "test-kola-upgrade" ]; then | ||
| # upgrade test | ||
| export KOLA_ACTION="run-upgrade" | ||
| export KOLA_ID="run-upgrade" | ||
| export KOLA_EXTRA_ARGS=( | ||
| --upgrades | ||
| ) | ||
| run_kola | ||
| collect_kola_artifacts | ||
|
|
||
| elif [ "$TEST_CASE" = "test-kola-self" ]; then | ||
| REPO_ROOT=$(cd ../.. && pwd) | ||
| # self test | ||
| export KOLA_ACTION="run" | ||
| export KOLA_ID="kola-self" | ||
| export KOLA_EXTRA_ARGS=( | ||
| -E "${REPO_ROOT}/tests/kola-ci-self" | ||
| 'ext.kola-ci-self*' | ||
| ) | ||
| run_kola | ||
| collect_kola_artifacts | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/bin/bash | ||
| set -eEuo pipefail | ||
| set -x | ||
|
|
||
| export COREOS_ASSEMBLER_CONTAINER="$IMAGE_URL" | ||
| export COSA_DIR="$HOME/workspace/build" | ||
|
|
||
| cosa () | ||
| { | ||
| podman run --rm --security-opt=label=disable --privileged \ | ||
| -v "${COSA_DIR}:/srv" --device=/dev/kvm \ | ||
| --device=/dev/fuse --tmpfs=/tmp -v /var/tmp:/var/tmp --name=cosa "${COREOS_ASSEMBLER_CONTAINER}" "$@"; | ||
| } | ||
| collect_kola_artifacts() { | ||
| mkdir -p "$TMT_TEST_DATA" | ||
| cd "${COSA_DIR}" && tar -C "${OUTPUT_DIR}" -c --xz "${KOLA_ID}" > "${KOLA_ID}-${TOKEN}.tar.xz" | ||
| cd "${COSA_DIR}" && mv "${KOLA_ID}-${TOKEN}.tar.xz" "${TMT_TEST_DATA}/${KOLA_ID}-${TOKEN}.tar.xz" | ||
| } | ||
| run_kola(){ | ||
| OUTPUT_DIR=$(cd "${COSA_DIR}" && cosa shell -- mktemp -d tmp/kola-XXXX) | ||
| TOKEN="$(uuidgen | cut -f1 -d -)" | ||
| KOLA_ID="${KOLA_ID:-kola}" | ||
| cd "${COSA_DIR}" && cosa kola "${KOLA_ACTION}" --build=latest --arch="$(arch)" --output-dir="${OUTPUT_DIR}/${KOLA_ID}" "${KOLA_EXTRA_ARGS[@]}" | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering here if 1h here is sufficient. Honestly I have no idea if Konflux is any faster then Jenkins, but just today we witnessed CDN timeouts that caused a lot of failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests have been consistently passing in about 25–35 minutes in previous runs, which is why I set the timeout to 1 hour. I also haven’t seen failures caused by CDN timeouts before. Do you think it makes sense to increase it to 2 hours just to be safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Dusty's recent workaround (merged only today) the upgrade test should be more... resilient. His change detect's the CDN stall and restarts zincati. That said, this process still takes time, bumping said value could be some form of a safety net. I really don't have strong opinions here - just something to consider.