Skip to content

Commit

Permalink
Packit/TMT: organize test plans based on rpm dependency
Browse files Browse the repository at this point in the history
Unit and validate tests don't need to depend on the built rpm and it's
sufficient to run them on only 1 target.

So, it's more convenient to re-org the test plans based on rpm
dependency.

Signed-off-by: Lokesh Mandvekar <[email protected]>
  • Loading branch information
lsm5 committed Jan 28, 2025
1 parent fed0226 commit 11ade41
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
19 changes: 17 additions & 2 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,18 @@ jobs:
project: podman-next
enable_net: true

# Unit tests on Fedora
# validate and unit tests
# rpm independent and sufficient to run on only one env
- job: tests
trigger: pull_request
packages: [aardvark-dns-fedora] # Include this else it will create multiple jobs
skip_build: true
targets:
- fedora-latest-stable
tmt_plan: "/plans/no-rpm"
identifier: "no-rpm"

# Integration tests on Fedora
- job: tests
trigger: pull_request
packages: [aardvark-dns-fedora]
Expand All @@ -103,8 +114,10 @@ jobs:
- artifacts:
- type: repository-file
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo
tmt_plan: "/plans/rpm"
identifier: "rpm"

# Unit tests on CentOS Stream
# Integration tests on CentOS Stream
- job: tests
trigger: pull_request
packages: [aardvark-dns-centos]
Expand All @@ -115,6 +128,8 @@ jobs:
- artifacts:
- type: repository-file
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo
tmt_plan: "/plans/rpm"
identifier: "rpm"

# Sync to Fedora
- job: propose_downstream
Expand Down
15 changes: 6 additions & 9 deletions plans/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@ prepare:
dnf -y upgrade --allowerasing
order: 20

/upstream:
summary: Run tests on upstream PRs
/no-rpm:
summary: Run tests independent of rpm
discover+:
filter: tag:upstream
filter: tag:no-rpm
adjust+:
- enabled: false
when: initiator is not defined or initiator != packit

/downstream:
summary: Run tests on bodhi / errata and dist-git PRs
/rpm:
summary: Run tests on the rpm
discover+:
filter: tag:downstream
adjust+:
- enabled: false
when: initiator == packit
filter: tag:rpm
8 changes: 4 additions & 4 deletions test/tmt/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ adjust:
when: arch == aarch64

/validate:
tag: upstream
tag: [ no-rpm, validate ]
summary: Validate test
test: make -C ../.. validate

/unit:
tag: upstream
summary: Unit test
tag: [ no-rpm, unit ]
summary: Unit tests
test: make -C ../.. unit

/integration:
tag: [ upstream, downstream]
tag: [ rpm, integration ]
summary: Integration tests
test: bash test_integration.sh
environment:
Expand Down

0 comments on commit 11ade41

Please sign in to comment.