-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend, backend, rpmbuild: skip excluded chroots
Fix #2137
- Loading branch information
Showing
10 changed files
with
121 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
beaker-tests/Sanity/copr-cli-basic-operations/runtest-exclusivearch.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#! /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-armhfp" | ||
chroots+=" --chroot fedora-$FEDORA_VERSION-ppc64le" | ||
chroots+=" --chroot fedora-$FEDORA_VERSION-s390x" | ||
|
||
rlRun "copr-cli create ${NAME_PREFIX}ExclusiveArch $chroots" | ||
rlRun "copr-cli build-distgit ${NAME_PREFIX}ExclusiveArch --name biosdevname --commit $BRANCH" | ||
|
||
OUTPUT=`mktemp` | ||
rlRun "copr monitor ${NAME_PREFIX}ExclusiveArch > $OUTPUT" | ||
rlAssertEquals "Skipped chroots" `cat $OUTPUT |grep "skipped" |wc -l` 4 | ||
rlAssertEquals "Succeeded chroots" `cat $OUTPUT |grep "succeeded" |wc -l` 1 | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
rlRun "copr-cli delete ${NAME_PREFIX}ExclusiveArch" | ||
rlPhaseEnd | ||
rlJournalPrintText | ||
rlJournalEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_srpm, get_rpm_header | ||
|
||
|
||
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 | ||
""" | ||
srpm = locate_srpm(self.resultdir) | ||
hdr = get_rpm_header(srpm) | ||
keys = ["name", "exclusivearch", "excludearch"] | ||
return {key: hdr[key] for key in keys} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters