-
Notifications
You must be signed in to change notification settings - Fork 62
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 excluded architectures #2769
Changes from all commits
d2d9853
e196fd7
6cf9499
dbf9ced
b2530cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#! /bin/bash | ||
|
||
# Include Beaker environment | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
# Load config settings | ||
HERE=$(dirname "$(realpath "$0")") | ||
source "$HERE/config" | ||
source "$HERE/helpers" | ||
|
||
|
||
rlJournalStart | ||
rlPhaseStartSetup | ||
setup_checks | ||
rlAssertRpm "jq" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest | ||
chroots="" | ||
chroots+=" --chroot fedora-$FEDORA_VERSION-x86_64" | ||
chroots+=" --chroot fedora-$FEDORA_VERSION-aarch64" | ||
chroots+=" --chroot fedora-$FEDORA_VERSION-ppc64le" | ||
chroots+=" --chroot fedora-$FEDORA_VERSION-s390x" | ||
|
||
OUTPUT=`mktemp` | ||
|
||
# Test ExclusiveArch | ||
rlRun "copr-cli create ${NAME_PREFIX}ExclusiveArch $chroots" | ||
rlRun "copr-cli build-distgit ${NAME_PREFIX}ExclusiveArch --name biosdevname --commit $BRANCH" | ||
rlRun "copr monitor ${NAME_PREFIX}ExclusiveArch > $OUTPUT" | ||
rlAssertEquals "Skipped chroots" `cat $OUTPUT |grep "skipped" |wc -l` 3 | ||
rlAssertEquals "Succeeded chroots" `cat $OUTPUT |grep "succeeded" |wc -l` 1 | ||
|
||
# This is a more complicated package with `BuildArch: noarch` and | ||
# ExclusiveArch for subpackages. Test that we don't fail while parsing it | ||
rlRun "copr-cli build-distgit ${NAME_PREFIX}ExclusiveArch --name procyon" | ||
|
||
# Test ExcludeArch | ||
rlRun "copr-cli create ${NAME_PREFIX}ExcludeArch $chroots" | ||
rlRun "copr-cli build-distgit ${NAME_PREFIX}ExcludeArch --name python-giacpy" | ||
rlRun "copr monitor ${NAME_PREFIX}ExcludeArch > $OUTPUT" | ||
rlAssertEquals "Skipped chroots" `cat $OUTPUT |grep "skipped" |wc -l` 3 | ||
rlAssertEquals "Succeeded chroots" `cat $OUTPUT |grep "succeeded" |wc -l` 1 | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
rlRun "copr-cli delete ${NAME_PREFIX}ExclusiveArch" | ||
rlRun "copr-cli delete ${NAME_PREFIX}ExcludeArch" | ||
rlPhaseEnd | ||
rlJournalPrintText | ||
rlJournalEnd |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
""" | ||
Create `results.json` file for SRPM builds | ||
""" | ||
|
||
import os | ||
import simplejson | ||
from copr_rpmbuild.automation.base import AutomationTool | ||
from copr_rpmbuild.helpers import locate_spec, Spec | ||
|
||
|
||
class SRPMResults(AutomationTool): | ||
""" | ||
Create `results.json` for SRPM builds | ||
""" | ||
|
||
@property | ||
def enabled(self): | ||
""" | ||
Do this for every RPM build | ||
""" | ||
return not self.chroot | ||
|
||
def run(self): | ||
""" | ||
Create `results.json` | ||
""" | ||
data = self.get_package_info() | ||
path = os.path.join(self.resultdir, "results.json") | ||
with open(path, "w", encoding="utf-8") as dst: | ||
simplejson.dump(data, dst, indent=4) | ||
|
||
def get_package_info(self): | ||
""" | ||
Return ``dict`` with interesting package metadata | ||
""" | ||
spec_path = locate_spec(self.resultdir) | ||
spec = Spec(spec_path) | ||
keys = ["name", "exclusivearch", "excludearch"] | ||
return {key: getattr(spec, key) for key in keys} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The exclusive arch is a bit different, I think it can be specified per subpackage. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have a tip for any package that does either of those per subpackage, please? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. binutils has ExcludeArch for sub-packages, but it's hidden behind the --with crossbuilds flag. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lammps package also has this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. procyon package has ExclusiveArch for its sub-packages, so that should give you test cases for both ExcludeArch and ExclusiveArch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this testing both excludearch and exclusivearch? It would be nice to have both tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was only for ExclusivAarch. I added another one for ExcludeArch