From 0f23d2b21e2306038b8360123efeba80e3c15e89 Mon Sep 17 00:00:00 2001 From: Nicola Sella Date: Thu, 26 Oct 2023 17:34:11 +0200 Subject: [PATCH] Onboard tmt --- .fmf/version | 1 + .packit.yml | 10 +++++++++ Dockerfile | 6 ++++++ plans/integration/behave-dnf5.fmf | 7 +++++++ plans/integration/behave-dnf5daemon.fmf | 7 +++++++ plans/main.fmf | 28 +++++++++++++++++++++++++ 6 files changed, 59 insertions(+) create mode 100644 .fmf/version create mode 100644 .packit.yml create mode 100644 plans/integration/behave-dnf5.fmf create mode 100644 plans/integration/behave-dnf5daemon.fmf create mode 100644 plans/main.fmf diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.packit.yml b/.packit.yml new file mode 100644 index 000000000..eb0a28487 --- /dev/null +++ b/.packit.yml @@ -0,0 +1,10 @@ +# See the documentation for more information: +# https://packit.dev/docs/configuration/ + +jobs: + - job: tests + trigger: pull_request + targets: + - fedora-all + manual_trigger: true + skip_build: true diff --git a/Dockerfile b/Dockerfile index f387f96d4..afd3a955e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,12 @@ RUN set -x && \ dnf -y upgrade; \ dnf -y distro-sync --repo copr:copr.fedorainfracloud.org:rpmsoftwaremanagement:dnf5-unstable; +RUN set -x && \ + if [ -n "$COPR" ] && [ -n "$COPR_RPMS" ]; then \ + dnf -y copr enable $COPR; \ + dnf -y install $COPR_RPMS; \ + fi + # copy test suite COPY ./dnf-behave-tests/ /opt/ci/dnf-behave-tests diff --git a/plans/integration/behave-dnf5.fmf b/plans/integration/behave-dnf5.fmf new file mode 100644 index 000000000..9ab507d93 --- /dev/null +++ b/plans/integration/behave-dnf5.fmf @@ -0,0 +1,7 @@ +summary: Run Behave Test Suite - DNF5 +execute: + how: tmt + script: | + $TMT_PLANS_DATA/ci-dnf-stack/container-test run \ + --tags dnf5 \ + --command dnf5 diff --git a/plans/integration/behave-dnf5daemon.fmf b/plans/integration/behave-dnf5daemon.fmf new file mode 100644 index 000000000..6e9ff492a --- /dev/null +++ b/plans/integration/behave-dnf5daemon.fmf @@ -0,0 +1,7 @@ +summary: Run Behave Test Suite - DNF5DAEMON +execute: + how: tmt + script: | + $TMT_PLANS_DATA/ci-dnf-stack/container-test run \ + --tags dnf5daemon \ + --command dnf5daemon-client diff --git a/plans/main.fmf b/plans/main.fmf new file mode 100644 index 000000000..28fd588ff --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,28 @@ +summary: Prepare CI DNF Stack + +prepare: + - name: Install packages to build fedora container + how: install + package: [git, podman] + + - name: Download latest ci-dnf-stack from PR + how: shell + script: + - git clone https://github.com/rpm-software-management/ci-dnf-stack $TMT_PLANS_DATA/ci-dnf-stack + + - name: Checkout PR branch if packit call is from ci-dnf-stack + how: shell + script: | + if [ "$PACKIT_UPSTREAM_NAME" -eq "ci-dnf-stack" ]; then \ + git -C $TMT_PLANS_DATA/ci-dnf-stack remote add pull-request $PACKIT_SOURCE_URL \ + git -C $TMT_PLANS_DATA/ci-dnf-stack fetch pull-request \ + git -C $TMT_PLANS_DATA/ci-dnf-stack checkout --track \ pull-request/$PACKIT_SOURCE_BRANCH + fi + + - name: Build testing container + how: shell + script: | + $TMT_PLANS_DATA/ci-dnf-stack/container-test build \ + --base $( echo "$@distro" | tr '-' ':') \ + --container-arg="--env=COPR=$PACKIT_COPR_PROJECT" \ + --container-arg="--env=COPR_RPMS=$PACKIT_COPR_RPMS"