Skip to content

Commit

Permalink
beaker: predictable sub-package ExclusiveArch test
Browse files Browse the repository at this point in the history
The package was crafted to properly match the use-case we want to test,
two chroots skipped, two processed.  The sub-package ExclusiveArch is
even more filtered (x86_64 only), but it doesn't affect the overall
build on aarch64.  Long term, we should stop shipping the subpackage
into aarch64, though (as is done in Fedora Pungi).
  • Loading branch information
praiskup authored and FrostyX committed Aug 21, 2023
1 parent 2298f77 commit 7712cb4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
8 changes: 8 additions & 0 deletions beaker-tests/Sanity/copr-cli-basic-operations/helpers
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ quote_args()
done
}

copr_build_and_parse_id()
{
quote_args "copr-cli" "$@" --nowait
rlRun -s "$quote_args_result"
rlRun parse_build_id
rlRun "copr watch-build $BUILD_ID"
}

cleanAction()
{
quote_args "$@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ HERE=$(dirname "$(realpath "$0")")
source "$HERE/config"
source "$HERE/helpers"

exclusive_arch_package=https://pagure.io/copr/copr-test-sources/raw/master/f/exclusivearch-test-1-1.src.rpm

rlJournalStart
rlPhaseStartSetup
Expand All @@ -33,8 +34,21 @@ rlJournalStart

# This is a more complicated package with `BuildArch: noarch` and
# ExclusiveArch for subpackages. Test that we don't fail while parsing it
# TODO: we fail the build actually, https://github.com/fedora-copr/copr/issues/2870
#rlRun "copr-cli build-distgit ${NAME_PREFIX}ExclusiveArch --name procyon"
copr_build_and_parse_id build "${NAME_PREFIX}ExclusiveArch" "$exclusive_arch_package"
json=$(curl "$FRONTEND_URL/api_3/build/built-packages/$BUILD_ID" | jq)
echo "$json"

for arch in ppc64le s390x; do
chroot=fedora-$FEDORA_VERSION-$arch
output=$(echo "$json" | jq ".\"$chroot\".packages")
rlAssertEquals "$arch skipped" "$output" "[]"
done

for arch in aarch64 x86_64; do
chroot=fedora-$FEDORA_VERSION-$arch
output=$(echo "$json" | jq ".\"$chroot\".packages[0].version == \"1\"")
rlAssertEquals "$arch provides valid Version:" "$output" true
done

# Test ExcludeArch
rlRun "copr-cli create ${NAME_PREFIX}ExcludeArch $chroots"
Expand Down

0 comments on commit 7712cb4

Please sign in to comment.