-
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
137 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
55 changes: 55 additions & 0 deletions
55
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,55 @@ | ||
#! /bin/bash | ||
# | ||
# Copyright (c) 2021 Red Hat, Inc. | ||
# | ||
# This program is free software: you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation, either version 2 of | ||
# the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be | ||
# useful, but WITHOUT ANY WARRANTY; without even the implied | ||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | ||
# PURPOSE. See the GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see http://www.gnu.org/licenses/. | ||
|
||
|
||
# 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