Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip-ci] TMT: revdep podman build test #1892

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
45 changes: 24 additions & 21 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ packages:
downstream_package_name: containers-common
pkg_tool: centpkg
specfile_path: rpm/containers-common.spec
containers-common-rhel:
downstream_package_name: containers-common
specfile_path: rpm/containers-common.spec
containers-common-eln:
downstream_package_name: containers-common
specfile_path: rpm/containers-common.spec
Expand All @@ -27,17 +24,17 @@ jobs:
- job: copr_build
trigger: pull_request
packages: [containers-common-fedora]
notifications: &ephemeral_build_failure_notification
failure_comment:
message: "Ephemeral COPR build failed. @containers/packit-build please check."
# notifications: &ephemeral_build_failure_notification
# failure_comment:
# message: "Ephemeral COPR build failed. @containers/packit-build please check."
enable_net: true
targets:
- fedora-all
targets: &fedora_copr_targets
- fedora-rawhide

- job: copr_build
trigger: pull_request
trigger: ignore
packages: [containers-common-eln]
notifications: *ephemeral_build_failure_notification
#notifications: *ephemeral_build_failure_notification
enable_net: true
targets:
fedora-eln:
Expand All @@ -48,22 +45,14 @@ jobs:
- https://kojipkgs.fedoraproject.org/repos/eln-build/latest/x86_64/

- job: copr_build
trigger: pull_request
trigger: ignore
packages: [containers-common-centos]
notifications: *ephemeral_build_failure_notification
#notifications: *ephemeral_build_failure_notification
enable_net: true
targets:
targets: &centos_copr_targets
- centos-stream-9
- centos-stream-10

- job: copr_build
trigger: pull_request
packages: [containers-common-rhel]
notifications: *ephemeral_build_failure_notification
enable_net: true
targets:
- epel-9

# Run on commit to main branch
- job: copr_build
trigger: commit
Expand All @@ -76,6 +65,20 @@ jobs:
project: podman-next
enable_net: true

- job: tests
trigger: pull_request
packages: [containers-common-fedora]
targets: *fedora_copr_targets
enable_net: true
tf_extra_params:
environments:
- artifacts:
- type: repository-file
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo
tmt:
context:
revdeps: "yes"

- job: propose_downstream
trigger: release
packages: [containers-common-fedora]
Expand Down
24 changes: 24 additions & 0 deletions contrib/tmtplans/buildah_build_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

set -eox pipefail
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set -eox pipefail
set -exo pipefail

The order here is important.


rpm -q golang

if [ -f /etc/fedora-release ]; then
export TMPDIR=/var/tmp
fi
Comment on lines +7 to +9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the conditional? In all test environments I've seen, /var/tmp is much bigger than /tmp. It seems safest just to universally set TMPDIR=/var/tmp.


git clone https://github.com/containers/podman
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is named buildah_build_test but there's no buildah anything anywhere?

Now I understand the script names. Suggestion: rename both to "build_XXX" instead of XXX_build? "buildah_build_test," to me, suggests that you are testing buildah's build command.


cd podman
dnf -y builddep rpm/podman.spec

go mod edit -replace github.com/containers/common=../
make vendor
cat go.mod

git add vendor/
git config --global user.email "[email protected]"
git config --global user.name "Your Name"

make rpm
14 changes: 14 additions & 0 deletions contrib/tmtplans/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
enabled: false

prepare:
- how: install
package:
- containers-common
- containers-common-extra
- podman-tests

/podman_build_test:
summary: Build Podman
execute:
how: tmt
script: bash ./contrib/tmtplans/podman_build_test.sh
26 changes: 26 additions & 0 deletions contrib/tmtplans/podman_build_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

set -exo pipefail

rpm -q golang

#if [ -f /etc/fedora-release ]; then
# export TMPDIR=/var/tmp
#fi

# Navigate to parent dir of default working dir
cd ..

# Clone podman
git clone https://github.com/containers/podman

cd podman
dnf -y builddep rpm/podman.spec

# Vendor c/common from PR
# TMT_TREE points to the default working dir
go mod edit -replace github.com/containers/common=$TMT_TREE
make vendor
cat go.mod

make
36 changes: 36 additions & 0 deletions plans/podman.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
prepare:
- name: packages
how: install
package: [podman-tests]

enabled: false
adjust:
- when: revdeps == yes
enabled: true

adjust+:
- when: initiator == packit
because: "We need to test with updated packages from rhcontainerbot/podman-next copr"
prepare+:
- name: dnf repo priority
how: shell
script: sed -i -n '/^priority=/!p;$apriority=5' /etc/yum.repos.d/*rhcontainerbot*.repo
- when: distro == centos-stream or distro == rhel
because: "bats package is present in epel"
prepare+:
- name: EPEL
how: feature
epel: enabled

discover:
how: fmf
url: https://github.com/lsm5/podman
ref: "tmt-fedora-centos"

execute:
how: tmt

/system:
summary: Run podman system tests
discover+:
test: /test/tmt/system/*