Bootstrap CI tests from internal RHEL dist-git branch

Resolves: rhbz#2174845

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2023-03-28 10:47:33 +02:00
parent 95c3cdc2d7
commit 811319730b
No known key found for this signature in database
GPG Key ID: C5887AD51D9F3C2D
5 changed files with 39 additions and 0 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -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

6
plans/unit-tests.fmf Normal file
View File

@ -0,0 +1,6 @@
summary: Run unit tests from source
discover:
how: fmf
dist-git-source: true
execute:
how: tmt

19
tests/scripts/run_tests.sh Executable file
View File

@ -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 || cat /var/lib/osbuild-composer/jobs/*

5
tests/unit.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Run unit tests
require:
- golang
test: cd ../osbuild-composer-*/ && sudo dnf builddep -y osbuild-composer.spec && GOFLAGS=-mod=vendor go test ./...
duration: 1h