-
Notifications
You must be signed in to change notification settings - Fork 305
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
ci: Rework installed tests to use Fedora Standard Test interface #1462
Changes from all commits
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,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 was deleted.
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 && \ | ||
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. So, does this not work for some reason? (Judging by the comment in 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. It works, I was just trying to proactively prevent any "not testing what was built" type issues like we've had once or twice. Basically I was thinking the very first test should be checking the binary's built version in some way. Which we now have. |
||
$(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 |
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.
Oh, good catch! Filed: projectatomic/papr#90.