diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..4ca9235 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-10 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/plans/integration-tests.fmf b/plans/integration-tests.fmf new file mode 100644 index 0000000..47416b5 --- /dev/null +++ b/plans/integration-tests.fmf @@ -0,0 +1,8 @@ +summary: Run integration tests +prepare: + how: install + package: + - osbuild-composer-tests +execute: + script: ./tests/scripts/run_tests.sh ./tests/ + duration: 24h diff --git a/plans/unit-tests.fmf b/plans/unit-tests.fmf new file mode 100644 index 0000000..7fc52d4 --- /dev/null +++ b/plans/unit-tests.fmf @@ -0,0 +1,6 @@ +summary: Run unit tests from source +discover: + how: fmf + dist-git-source: true +execute: + how: tmt diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh new file mode 100755 index 0000000..15a164f --- /dev/null +++ b/tests/scripts/run_tests.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -euxo pipefail + +TOPDIR=$1 + +# Print some information about the machine +df -h +free -h +rpm -qa +find /etc/yum.repos.d -type f -print -exec cat {} \; + +# Run only basic smoke tests. +# Our test-suite is currently very thorough and it builds a lot of images. +# On some runs, TFT was able to build one image for 25 minutes. Our test +# suite builds more than 25 images which means that the full test-suite +# can run for more than 10 hours. That's just too slow and since we are also +# able to run downstream tests on our much faster upstream infrastructure. +# I think that it's enough to do just smoke tests here. +/usr/libexec/tests/osbuild-composer/base_tests.sh diff --git a/tests/unit.fmf b/tests/unit.fmf new file mode 100644 index 0000000..16dfdee --- /dev/null +++ b/tests/unit.fmf @@ -0,0 +1,5 @@ +summary: Run unit tests +require: + - golang +test: cd ../osbuild-composer-*/ && sudo dnf builddep -y osbuild-composer.spec && GOFLAGS="-mod=vendor -tags=exclude_graphdriver_btrfs" go test ./... +duration: 1h