From d5881b947e06e98ef0737f656d9977e095ab2c60 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Tue, 26 Aug 2025 11:48:23 -0400 Subject: [PATCH 1/4] TMT: additions to make local TMT runs similar to testing-farm Signed-off-by: Lokesh Mandvekar --- plans/main.fmf | 8 ++++++++ systemtest/tmt/main.fmf | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/plans/main.fmf b/plans/main.fmf index 1bc9fef7..fa18986c 100644 --- a/plans/main.fmf +++ b/plans/main.fmf @@ -24,3 +24,11 @@ prepare: fi dnf -y upgrade --allowerasing order: 20 + - name: Disable installing everything from srpm + how: install + exclude: + - ".*" + - name: Install the main package + how: install + package: + - skopeo-tests diff --git a/systemtest/tmt/main.fmf b/systemtest/tmt/main.fmf index de3517e6..e3090563 100644 --- a/systemtest/tmt/main.fmf +++ b/systemtest/tmt/main.fmf @@ -1,6 +1,3 @@ -require: - - skopeo-tests - environment: SKOPEO_BINARY: /usr/bin/skopeo @@ -11,8 +8,12 @@ adjust: summary: System test test: | - rpm -q containers-common skopeo skopeo-tests + rpm -q containers-common skopeo-tests # If these tests are to be run anywhere else, TMT can fetch # them using the URL and git ref, so git commands should work. make -C $(git rev-parse --show-toplevel) test-system-local +require: + - git-core + - make + - skopeo-tests duration: 60m From cd978903c81ca21c3c0b31174cf5f2a52f2790d1 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Wed, 27 Aug 2025 13:45:11 -0400 Subject: [PATCH 2/4] RPM: skopeo-tests only installs dependencies The sole purpose of skopeo-tests subpackage was to make system test files readily available for CI on bodhi updates. Given we can reuse test config from upstream via TMT, there's no reason to continue shipping the test files. This subpackage can be repurposed to only install test dependencies. Signed-off-by: Lokesh Mandvekar --- rpm/skopeo.spec | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/rpm/skopeo.spec b/rpm/skopeo.spec index 9cb94dfb..d7510fdd 100644 --- a/rpm/skopeo.spec +++ b/rpm/skopeo.spec @@ -22,7 +22,6 @@ # Copr builds set a separate epoch for all environments %if %{defined fedora} %define conditional_epoch 1 -%define fakeroot 1 %else %define conditional_epoch 2 %endif @@ -71,17 +70,14 @@ Requires: containers-common >= 4:1-21 %description Command line utility to inspect images and repositories directly on Docker -registries without the need to pull them +registries without the need to pull them. # NOTE: The tests subpackage is only intended for testing and will not be supported # for end-users and/or customers. %package tests -Summary: Tests for %{name} +Summary: Test dependencies for %{name} Requires: %{name} = %{epoch}:%{version}-%{release} -%if %{defined fakeroot} -Requires: fakeroot -%endif Requires: gnupg Requires: jq Requires: golang @@ -90,13 +86,12 @@ Requires: crun Requires: httpd-tools Requires: openssl Requires: squashfs-tools -# bats is not present on RHEL and ELN so it shouldn't be a strong dep +# bats and fakeroot are not present on RHEL and ELN so they shouldn't be strong deps Recommends: bats +Recommends: fakeroot %description tests -%{summary} - -This package contains system tests for %{name} +This package installs system test dependencies for %{name} %prep %autosetup -Sgit %{name}-%{version} @@ -142,10 +137,6 @@ make \ PREFIX=%{_prefix} \ install-binary install-docs install-completions -# system tests -install -d -p %{buildroot}/%{_datadir}/%{name}/test/system -cp -pav systemtest/* %{buildroot}/%{_datadir}/%{name}/test/system/ - #define license tag if not already defined %{!?_licensedir:%global license %doc} @@ -166,9 +157,8 @@ cp -pav systemtest/* %{buildroot}/%{_datadir}/%{name}/test/system/ %dir %{_datadir}/zsh/site-functions %{_datadir}/zsh/site-functions/_%{name} +# Only test dependencies installed, no files. %files tests -%license LICENSE vendor/modules.txt -%{_datadir}/%{name}/test %changelog %autochangelog From 9558c9c01312b4b575ebe0b0fa559ee6cfe360b4 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Wed, 27 Aug 2025 13:48:31 -0400 Subject: [PATCH 3/4] Packit: replace files_to_sync with prepare-files With TMT being able to fetch and run tests using git url and ref, there's no need to sync files on every propose_downstream Packit action. Removing files_to_sync should be safe as we only need to sync `.packit.yaml` which is part of Packit's default behavior already. Other files like gating.yaml only need to exist downstream and shouldn't need any frequent manual changes, so we can remove those from upstream and packit file-sync too. New setup: We use a `prepare-files` action that will operate only on `plans/main.fmf` in downstream dist-git and update the ref with the tag from the latest release. Signed-off-by: Lokesh Mandvekar --- .packit.yaml | 25 ++++--------------------- rpm/gating.yaml | 16 ---------------- 2 files changed, 4 insertions(+), 37 deletions(-) delete mode 100644 rpm/gating.yaml diff --git a/.packit.yaml b/.packit.yaml index e7c125f2..adfed61e 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -9,27 +9,6 @@ downstream_package_name: skopeo upstream_tag_template: v{version} -# These files get synced from upstream to downstream (Fedora / CentOS Stream) on every -# propose-downstream job. This is done so tests maintained upstream can be run -# downstream in Zuul CI and Bodhi. -# Ref: https://packit.dev/docs/configuration#files_to_sync -files_to_sync: - - src: rpm/gating.yaml - dest: gating.yaml - delete: true - - src: plans/ - dest: plans/ - delete: true - mkpath: true - - src: systemtest/tmt/ - dest: test/tmt/ - delete: true - mkpath: true - - src: .fmf/ - dest: .fmf/ - delete: true - - .packit.yaml - packages: skopeo-fedora: pkg_tool: fedpkg @@ -40,6 +19,10 @@ packages: skopeo-eln: specfile_path: rpm/skopeo.spec +actions: + prepare-files: >- + bash -c "sed -i 's/^\(\s*\)ref: .*/\1ref: \"${PACKIT_PROJECT_TAG}\"/' ${PACKIT_DOWNSTREAM_REPO}/plans/main.fmf" + srpm_build_deps: - make diff --git a/rpm/gating.yaml b/rpm/gating.yaml deleted file mode 100644 index 1fb3172f..00000000 --- a/rpm/gating.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- !Policy -product_versions: - - fedora-* -decision_contexts: - - bodhi_update_push_stable - - bodhi_update_push_testing -subject_type: koji_build -rules: - - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} - ---- !Policy -product_versions: - - rhel-* -decision_context: osci_compose_gate -rules: - - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} From 31ca77cea6df2aa4c2c6cf31aa86c8faa7fa673f Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Mon, 1 Sep 2025 11:07:50 -0400 Subject: [PATCH 4/4] Packit: enable ELN Signed-off-by: Lokesh Mandvekar --- .packit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.packit.yaml b/.packit.yaml index adfed61e..1cfb8c30 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -43,7 +43,7 @@ jobs: # Ignore until golang is updated in distro buildroot to go 1.23.3+ - job: copr_build - trigger: ignore + trigger: pull_request packages: [skopeo-eln] notifications: *copr_build_failure_notification targets: