From 54e7e6da864dc03a5bbb9a1fe7f0a429a2cc8d9c Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 28 Apr 2017 09:32:35 -0400 Subject: [PATCH 1/5] ci: Add a context for testing flatpak This was part of the philosophy behind https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests - libraries like libostree don't need to replicate everything in unit tests, we can use the tests from our dependencies directly too. We'll also get API break coverage testing too. --- .redhat-ci.yml | 20 ++++++++++++++++++++ ci/flatpak.sh | 22 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 ci/flatpak.sh diff --git a/.redhat-ci.yml b/.redhat-ci.yml index e560404076..7e82b059f7 100644 --- a/.redhat-ci.yml +++ b/.redhat-ci.yml @@ -135,3 +135,23 @@ tests: artifacts: - test-suite.log + +--- + +inherit: false +branches: + - master + - auto + - try + +context: f25-flatpak +required: false + +# This test case wants an "unprivileged container with bubblewrap", +# which we don't have right now; so just provision a VM and do a +# docker --privileged run. +host: + distro: fedora/25/atomic + +tests: + - docker run --rm --privileged -v $(pwd):/srv/code registry.fedoraproject.org/fedora:25 /bin/sh -c "cd /srv/code && ./ci/flatpak.sh" diff --git a/ci/flatpak.sh b/ci/flatpak.sh new file mode 100755 index 0000000000..a4e0ef977d --- /dev/null +++ b/ci/flatpak.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Build and run flatpak's unit tests using the just-built ostree for this PR. + +set -xeuo pipefail + +build() { + env NOCONFIGURE=1./autogen.sh + ./configure --prefix=/usr --libdir=/usr/lib64 "$@" + make -j 8 +} + +# build+install ostree +build +sudo make install +tmpd=$(mktemp -d) +cd ${tmpd} +# Frozen to a tag for now on general principle +git clone --recursive --depth=1 -b 0.9.3 https://github.com/flatpak/flatpak +cd flatpak +dnf builddep -y flatpak +build +make -j 8 check From 9c3316e385f50d59b7b429378a660dd991b17944 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 28 Apr 2017 13:03:50 -0400 Subject: [PATCH 2/5] fixup! ci: Add a context for testing flatpak --- ci/flatpak.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/flatpak.sh b/ci/flatpak.sh index a4e0ef977d..e1a16af5d4 100755 --- a/ci/flatpak.sh +++ b/ci/flatpak.sh @@ -4,7 +4,7 @@ set -xeuo pipefail build() { - env NOCONFIGURE=1./autogen.sh + env NOCONFIGURE=1 ./autogen.sh ./configure --prefix=/usr --libdir=/usr/lib64 "$@" make -j 8 } From 1ddb6565845ffacd11c3349d4cf80bb7047c6f94 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 28 Apr 2017 13:07:13 -0400 Subject: [PATCH 3/5] fixup! ci: Add a context for testing flatpak --- ci/flatpak.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci/flatpak.sh b/ci/flatpak.sh index e1a16af5d4..69b3926b10 100755 --- a/ci/flatpak.sh +++ b/ci/flatpak.sh @@ -9,7 +9,13 @@ build() { make -j 8 } +# Core prep +dnf -y install dnf-plugins-core +dnf install -y @buildsys-build +dnf install -y 'dnf-command(builddep)' + # build+install ostree +dnf builddep -y ostree build sudo make install tmpd=$(mktemp -d) From 21009ef94d958b8d34efdfd798dd9b91160b8bed Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 28 Apr 2017 13:15:11 -0400 Subject: [PATCH 4/5] fixup! ci: Add a context for testing flatpak --- ci/flatpak.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/flatpak.sh b/ci/flatpak.sh index 69b3926b10..e38de2f028 100755 --- a/ci/flatpak.sh +++ b/ci/flatpak.sh @@ -17,7 +17,7 @@ dnf install -y 'dnf-command(builddep)' # build+install ostree dnf builddep -y ostree build -sudo make install +make install tmpd=$(mktemp -d) cd ${tmpd} # Frozen to a tag for now on general principle From 9ee612b4733b5e635a02c8710c07f148b17d5676 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 28 Apr 2017 14:36:21 -0400 Subject: [PATCH 5/5] fixup! ci: Add a context for testing flatpak --- .redhat-ci.yml | 3 +++ ci/flatpak.sh | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/.redhat-ci.yml b/.redhat-ci.yml index 7e82b059f7..8b58f80cdf 100644 --- a/.redhat-ci.yml +++ b/.redhat-ci.yml @@ -155,3 +155,6 @@ host: tests: - docker run --rm --privileged -v $(pwd):/srv/code registry.fedoraproject.org/fedora:25 /bin/sh -c "cd /srv/code && ./ci/flatpak.sh" + +artifacts: + - test-suite.log diff --git a/ci/flatpak.sh b/ci/flatpak.sh index e38de2f028..f7edba3efa 100755 --- a/ci/flatpak.sh +++ b/ci/flatpak.sh @@ -9,6 +9,8 @@ build() { make -j 8 } +codedir=$(pwd) + # Core prep dnf -y install dnf-plugins-core dnf install -y @buildsys-build @@ -24,5 +26,13 @@ cd ${tmpd} git clone --recursive --depth=1 -b 0.9.3 https://github.com/flatpak/flatpak cd flatpak dnf builddep -y flatpak +# And runtime deps +dnf install -y flatpak && rpm -e flatpak +dnf install which attr fuse parallel # for the test suite build +# We want to capture automake results from flatpak +cleanup() { + mv test-suite.log ${codedir} || true +} +trap cleanup EXIT make -j 8 check