-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Rework installed tests to use Fedora Standard Test interface
Reusing the way `standard-test-roles` has support for booting a qcow2 actually gets us to the "VM-in-container" flow. Plus Ansible over shell script is sometimes nicer. https://fedoraproject.org/wiki/CI/Tests#Testing_an_Atomic_Host It's better than what we were doing before for installed tests, and moreover using Ansible more broadly for testing is going to align us better with Fedora's CI. As part of this I split off a "libpaprci" which I intend to maintain as a "copylib" for a little bit between ostree/rpm-ostree, and then we'll figure out how to expand from there (maybe some of the patterns get "baked in" to PAPR for example). Note the `FAH27-insttests` context moves to the top since it's now of primary importance, and I expect that we start expanding it. Closes: #1462 Approved by: jlebon
- Loading branch information
1 parent
3b7044f
commit 6e9d00d
Showing
20 changed files
with
358 additions
and
169 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/bash | ||
# Generate a src.rpm, then binary rpms in the current directory | ||
|
||
set -xeuo pipefail | ||
|
||
dn=$(dirname $0) | ||
paprcidir=${dn}/libpaprci | ||
. ${paprcidir}/libbuild.sh | ||
|
||
# Auto-provision bootstrap resources if run as root (normally in CI) | ||
if test "$(id -u)" == 0; then | ||
pkg_install_buildroot | ||
pkg_install make /usr/bin/rpmbuild git | ||
fi | ||
|
||
# PAPR really should do this | ||
if ! test -f libglnx/README.md || ! test -f bsdiff/README.md; then | ||
git submodule update --init | ||
fi | ||
|
||
# Default libcurl on by default in fedora unless libsoup is enabled | ||
if test "${OS_ID}" = 'fedora'; then | ||
case "${CONFIGOPTS:-}" in | ||
*--with-soup*|*--without-curl*) ;; | ||
*) CONFIGOPTS="${CONFIGOPTS:-} --with-curl" | ||
esac | ||
fi | ||
case "${CONFIGOPTS:-}" in | ||
*--with-curl*|*--with-soup*) | ||
if test -x /usr/bin/gnome-desktop-testing-runner; then | ||
CONFIGOPTS="${CONFIGOPTS} --enable-installed-tests=exclusive" | ||
fi | ||
;; | ||
esac | ||
|
||
# TODO: Use some form of rpm's --build-in-place to skip archive-then-unpack? | ||
make -f ${paprcidir}/Makefile.dist-packaging srpm PACKAGE=libostree DISTGIT_NAME=ostree | ||
if test "$(id -u)" == 0; then | ||
pkg_builddep *.src.rpm | ||
else | ||
echo "NOTE: Running as non-root, assuming build dependencies are installed" | ||
fi | ||
if ! ${paprcidir}/rpmbuild-cwd --rebuild *.src.rpm; then | ||
find . -type f -name config.log -exec cat {} \; | ||
exit 1 | ||
fi |
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 was deleted.
Oops, something went wrong.
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 @@ | ||
# -*- mode: Makefile -*- | ||
|
||
mypath = $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) | ||
topsrcdir = $(shell git rev-parse --show-toplevel) | ||
GITREV = $(shell git describe --always --tags) | ||
GITREV_FOR_PKG = $(shell echo "$(GITREV)" | sed -e 's,-,\.,g' -e 's,^v,,') | ||
|
||
PACKAGE ?= $(shell basename $(topsrcdir)) | ||
DISTGIT_NAME ?= $(PACKAGE) | ||
DISTGIT ?= https://src.fedoraproject.org/rpms/$(DISTGIT_NAME) | ||
SPEC ?= $(topsrcdir)/$(DISTGIT_NAME).spec | ||
|
||
PKG_VER = $(PACKAGE)-$(GITREV_FOR_PKG) | ||
PKG_CLIENT_VER = $(PACKAGE)-client-$(GITREV_FOR_PKG) | ||
|
||
dist-snapshot: | ||
if ! test -f $(PKG_VER).tar.xz; then \ | ||
$(mypath)/make-git-snapshot.sh "$(topsrcdir)" "$(PKG_VER)" "$(GITREV)" && \ | ||
rm -f $(PKG_VER).tar.xz && \ | ||
xz $(PKG_VER).tar; \ | ||
fi | ||
|
||
srpm: dist-snapshot | ||
if test -f "$(SPEC)"; then \ | ||
sed -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(SPEC) > $(DISTGIT_NAME).spec && \ | ||
$(mypath)/rpmbuild-cwd -bs $(DISTGIT_NAME).spec ; \ | ||
else \ | ||
test -d $(DISTGIT_NAME) || git clone --depth=1 $(DISTGIT) && \ | ||
mv $(PKG_VER).tar.xz $(DISTGIT_NAME) && \ | ||
origdir=$$(pwd); \ | ||
cd $(DISTGIT_NAME) && \ | ||
git stash && git pull -r && \ | ||
sed -i -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(DISTGIT_NAME).spec && \ | ||
rm -f *.src.rpm && \ | ||
$(mypath)/rpmbuild-cwd -bs $(DISTGIT_NAME).spec && mv *.src.rpm $${origdir}; \ | ||
fi | ||
|
||
rpm: srpm | ||
./rpmbuild-cwd --rebuild $(PKG_VER)*.src.rpm |
Oops, something went wrong.