-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: make coprdirs have their repo available in the buildroot
This is useful in general but especially for pull requests that build multiple packages which depend on each other (e.g. `python-copr` and `copr-cli`). Up until now, it had to be workarounded by building the dependency into the main copr repository.
- Loading branch information
Showing
7 changed files
with
86 additions
and
10 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
beaker-tests/Sanity/copr-cli-basic-operations/runtest-coprdir.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,67 @@ | ||
#! /bin/bash | ||
# | ||
# Copyright (c) 2024 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" | ||
|
||
|
||
quick_package_script () | ||
{ | ||
cp "$HERE/files/quick-package.sh" script | ||
echo "$1" >> script | ||
} | ||
|
||
|
||
rlJournalStart | ||
rlPhaseStartSetup | ||
setup_checks | ||
rlAssertRpm "jq" | ||
setupProjectName "coprdir" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest | ||
# Test that CoprDirs have their own repositories in the buildroot | ||
tmp=`mktemp -d` | ||
rlRun "copr-cli create --chroot $CHROOT $PROJECT" | ||
|
||
# For an ease of implementation, the dependency and the package that | ||
# requires it are both `hello`. In a real life the first package would | ||
# be something like `python-copr` or `python-copr-common`, and the | ||
# second package would be something like `copr-cli` or `copr-backend`. | ||
|
||
# This is the dependency (e.g. python-copr) | ||
rlRun "curl https://src.fedoraproject.org/rpms/hello/raw/rawhide/f/hello.spec > $tmp/hello-1.spec" | ||
rlRun "sed -i '1s/^/Epoch: 6\n/' $tmp/hello-1.spec" | ||
rlRun "copr-cli build $PROJECT:custom:foo $tmp/hello-1.spec" | ||
|
||
# And this is the package that builds on top of it (e.g. copr-cli) | ||
rlRun "curl https://src.fedoraproject.org/rpms/hello/raw/rawhide/f/hello.spec > $tmp/hello-2.spec" | ||
rlRun "sed -i '1s/^/BuildRequires: hello >= 6:\n/' $tmp/hello-2.spec" | ||
rlRun "copr-cli build $PROJECT:custom:foo $tmp/hello-2.spec" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
cleanProject | ||
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
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