ci: unite testsuites and run vmcheck on centos

We can be a bit less wasteful here by merging the check and vmcheck
suites into a single suite. The check suite today takes a negligible
amount of time to run, so we're not gaining much by parallelizing them.
It's more of a sanity check at this point before we start vmcheck.

Also start running vmcheck on CentOS 7. We adapt the ci scripts to
accomodate both Fedora and CentOS target machines.

This commit also switches to Fedora 26 as the primary test base.

Closes: #871
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon 2017-07-17 10:40:25 -07:00 committed by Atomic Bot
parent 114d53a02d
commit cf19d83502
8 changed files with 83 additions and 132 deletions

134
.papr.yml
View File

@ -3,127 +3,70 @@ branches:
- auto
- try
context: f25-build-check
required: true
container:
image: registry.fedoraproject.org/fedora:25
packages:
- git
tests:
- ci/ci-commitmessage-submodules.sh
- ci/codestyle.sh
- ci/build-check.sh
timeout: 30m
artifacts:
- test-suite.log
---
inherit: true
context: f26-build-check
required: false
container:
image: registry.fedoraproject.org/fedora:26
tests:
# updates-source mirrors are being flaky
- sed -i '/metalink=.*updates-released-source.*/ d' /etc/yum.repos.d/fedora-updates.repo
- sed -i '/SRPMS/ s/^#baseurl/baseurl/' /etc/yum.repos.d/fedora-updates.repo
- ci/build-check.sh
---
inherit: true
context: c7-build
required: true
container:
image: registry.centos.org/centos/centos:7
extra-repos:
- name: atomic-centos-continuous
baseurl: https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/build
gpgcheck: 0
# XXX: integrate better with ci/ scripts
tests:
- yum-builddep -y rpm-ostree
- yum install -y polkit-devel
- yum install -y make
- source ci/libbuild.sh && build
timeout: 15m
---
inherit: true
context: f25-vmcheck
context: f26-primary
required: true
cluster:
hosts:
- name: vmcheck1
distro: fedora/25/atomic
distro: fedora/26/atomic
- name: vmcheck2
distro: fedora/25/atomic
distro: fedora/26/atomic
- name: vmcheck3
distro: fedora/25/atomic
distro: fedora/26/atomic
container:
image: registry.fedoraproject.org/fedora:25
image: registry.fedoraproject.org/fedora:26
packages:
- git
- rsync
env:
HOSTS: vmcheck1 vmcheck2 vmcheck3
packages:
- rsync
tests:
- ./ci/build.sh
- ci/ci-commitmessage-submodules.sh
- ci/codestyle.sh
# updates-source mirrors are being flaky
- sed -i '/metalink=.*updates-released-source.*/ d' /etc/yum.repos.d/fedora-updates.repo
- sed -i '/SRPMS/ s/^#baseurl/baseurl/' /etc/yum.repos.d/fedora-updates.repo
- ci/build-check.sh
- make vmcheck
artifacts:
- vmcheck
timeout: 60m
# We really need to work on getting this down:
# https://github.com/projectatomic/rpm-ostree/issues/662
timeout: 80m
artifacts:
- test-suite.log
- vmcheck
---
inherit: true
context: f26-vmcheck
context: c7-primary
required: false
required: true
cluster:
hosts:
- name: vmcheck
distro: fedora/26/atomic
- name: vmcheck1
distro: centos/7/atomic/alpha
- name: vmcheck2
distro: centos/7/atomic/alpha
- name: vmcheck3
distro: centos/7/atomic/alpha
container:
image: registry.fedoraproject.org/fedora:26
image: registry.centos.org/centos/centos:7
env:
HOSTS: vmcheck
extra-repos:
- name: atomic-centos-continuous
baseurl: https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/build
gpgcheck: 0
tests:
# updates-source mirrors are being flaky
- sed -i '/metalink=.*updates-released-source.*/ d' /etc/yum.repos.d/fedora-updates.repo
- sed -i '/SRPMS/ s/^#baseurl/baseurl/' /etc/yum.repos.d/fedora-updates.repo
- ./ci/build.sh
- yum install -y epel-release
- ci/build-check.sh
- make vmcheck
---
@ -133,10 +76,9 @@ branches:
- auto
- try
# NB: when bumping 25 here, also bump fedora.repo, compose script, and
# fedora-base.json
# NB: when bumping 26 here, also bump fedora.repo, and compose script
context: f25-compose
context: f26-compose
build: false
@ -148,7 +90,7 @@ required: true
# which we don't have right now; so just provision a VM and do a
# docker --privileged run.
host:
distro: fedora/25/atomic
distro: fedora/26/atomic
# copy yum.repos.d to get any injected repos from the host, which
# will point to a closer mirror
@ -157,7 +99,7 @@ tests:
-e RPMOSTREE_COMPOSE_TEST_USE_HOST_REPO=1
-v /etc/yum.repos.d:/etc/yum.repos.d.host:ro
-v $(pwd):/srv/code -w /srv/code
registry.fedoraproject.org/fedora:25 /bin/sh -c
registry.fedoraproject.org/fedora:26 /bin/sh -c
"cp -fv /etc/yum.repos.d{.host/*.repo,} &&
./ci/build.sh && make install && ./tests/compose"

View File

@ -7,14 +7,19 @@ dn=$(dirname $0)
. ${dn}/libbuild.sh
# Use the latest ostree by default
echo -e '[fahc]\nbaseurl=https://ci.centos.org/artifacts/sig-atomic/fahc/rdgo/build/\ngpgcheck=0\n' > /etc/yum.repos.d/fahc.repo
# Until we fix https://github.com/rpm-software-management/libdnf/pull/149
sed -i -e 's,metadata_expire=6h,exclude=ostree ostree-devel ostree-libs ostree-grub2\nmetadata_expire=6h,' /etc/yum.repos.d/fedora-updates.repo
# See also tests/vmcheck/overlay.sh
id=$(. /etc/os-release && echo $ID)
version_id=$(. /etc/os-release && echo $VERSION_ID)
if [ "$id" == fedora ] && [ "$version_id" == 26 ]; then
echo -e '[fahc]\nbaseurl=https://ci.centos.org/artifacts/sig-atomic/fahc/rdgo/build/\ngpgcheck=0\n' > /etc/yum.repos.d/fahc.repo
# Until we fix https://github.com/rpm-software-management/libdnf/pull/149
sed -i -e 's,metadata_expire=6h,exclude=ostree ostree-devel ostree-libs ostree-grub2\nmetadata_expire=6h,' /etc/yum.repos.d/fedora-updates.repo
elif [ "$id" == centos ]; then
echo -e '[cahc]\nbaseurl=https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/build\ngpgcheck=0\n' > /etc/yum.repos.d/cahc.repo
fi
install_builddeps rpm-ostree
dnf install -y ostree{,-devel,-grub2} createrepo_c /usr/bin/jq PyYAML clang \
yum install -y ostree{,-devel,-grub2} createrepo_c /usr/bin/jq PyYAML clang \
libubsan libasan libtsan elfutils fuse sudo gnome-desktop-testing
# create an unprivileged user for testing

View File

@ -17,13 +17,20 @@ build_default() {
install_builddeps() {
pkg=$1
dnf -y install dnf-plugins-core
dnf install -y @buildsys-build
dnf install -y 'dnf-command(builddep)'
if [ -x /usr/bin/dnf ]; then
dnf -y install dnf-plugins-core
dnf install -y @buildsys-build
dnf install -y 'dnf-command(builddep)'
dnf builddep -y $pkg
else
yum install -y make rpm-build
yum-builddep -y rpm-ostree
fi
# builddeps+runtime deps
dnf builddep -y $pkg
dnf install -y polkit-devel
dnf install -y $pkg
yum install -y $pkg
yum install -y polkit-devel
rpm -e $pkg
}

View File

@ -51,10 +51,9 @@ echo "Preparing compose tests..." | tee -a ${LOG}
# take the host repo if it matches our target tree
if [ -n "${RPMOSTREE_COMPOSE_TEST_USE_HOST_REPO:-}" ]; then
# NB: when bumping 25 here, also bump fedora.repo, .papr.yml, and
# fedora-base.json
# NB: when bumping 26 here, also bump fedora.repo, .papr.yml
(source /etc/os-release;
if [ "$ID" == "fedora" ] && [ "$VERSION_ID" == "25" ]; then
if [ "$ID" == "fedora" ] && [ "$VERSION_ID" == "26" ]; then
echo "Taking stable Fedora repo file from test env."
cp -fv /etc/yum.repos.d/fedora.repo ${dn}/composedata
fi) &>> ${LOG}

View File

@ -30,7 +30,7 @@ prepare_compose_test() {
export treefile=composedata/fedora-${name}.json
pyeditjson "jd['ref'] += \"/${name}\"" < composedata/fedora-base.json > ${treefile}
# FIXME extract from json
export treeref=fedora/25/x86_64/${name}
export treeref=fedora/stable/x86_64/${name}
}
runcompose() {

View File

@ -9,25 +9,25 @@ dn=$(cd $(dirname $0) && pwd)
# --add-metadata-string should cause no mutation
prepare_compose_test "mutate-os-release-none"
pysetjsonmember "mutate-os-release" '"25"'
pysetjsonmember "mutate-os-release" '"26"'
runcompose
echo "ok compose (none)"
ostree --repo=${repobuild} cat ${treeref} \
/usr/lib/os.release.d/os-release-fedora > os-release.prop
assert_file_has_content os-release.prop VERSION_ID=25
assert_file_has_content os-release.prop VERSION_ID=26
assert_not_file_has_content os-release.prop OSTREE_VERSION=
assert_file_has_content os-release.prop 'VERSION="25 (Twenty Five)"'
assert_file_has_content os-release.prop 'VERSION="26 (Twenty Six)"'
echo "ok mutate-os-release-none"
# make sure --add-metadata-string has precedence and works with
# mutate-os-release
prepare_compose_test "mutate-os-release-cli"
pysetjsonmember "automatic_version_prefix" '"25.555"'
pysetjsonmember "mutate-os-release" '"25"'
runcompose --add-metadata-string=version=25.444
pysetjsonmember "automatic_version_prefix" '"26.555"'
pysetjsonmember "mutate-os-release" '"26"'
runcompose --add-metadata-string=version=26.444
echo "ok compose (cli)"
ostree --repo=${repobuild} cat ${treeref} \
@ -35,16 +35,16 @@ ostree --repo=${repobuild} cat ${treeref} \
# VERSION_ID *shouldn't* change
# (https://github.com/projectatomic/rpm-ostree/pull/433)
assert_file_has_content os-release.prop VERSION_ID=25
assert_file_has_content os-release.prop OSTREE_VERSION=25.444
assert_file_has_content os-release.prop 'VERSION="25\.444 (Twenty Five)"'
assert_file_has_content os-release.prop VERSION_ID=26
assert_file_has_content os-release.prop OSTREE_VERSION=26.444
assert_file_has_content os-release.prop 'VERSION="26\.444 (Twenty Six)"'
echo "ok mutate-os-release-cli"
# make sure automatic_version_prefix works
prepare_compose_test "mutate-os-release-auto"
pysetjsonmember "automatic_version_prefix" '"25.555"'
pysetjsonmember "mutate-os-release" '"25"'
pysetjsonmember "automatic_version_prefix" '"26.555"'
pysetjsonmember "mutate-os-release" '"26"'
runcompose
echo "ok compose (auto)"
@ -53,7 +53,7 @@ ostree --repo=${repobuild} cat ${treeref} \
# VERSION_ID *shouldn't* change
# (https://github.com/projectatomic/rpm-ostree/pull/433)
assert_file_has_content os-release.prop VERSION_ID=25
assert_file_has_content os-release.prop OSTREE_VERSION=25.555
assert_file_has_content os-release.prop 'VERSION="25\.555 (Twenty Five)"'
assert_file_has_content os-release.prop VERSION_ID=26
assert_file_has_content os-release.prop OSTREE_VERSION=26.555
assert_file_has_content os-release.prop 'VERSION="26\.555 (Twenty Six)"'
echo "ok mutate-os-release (auto)"

View File

@ -1,7 +1,5 @@
{
"COMMENT": "when bumping 25 here, also bump fedora.repo, compose script, and .papr.yml",
"ref": "fedora/25/${basearch}",
"ref": "fedora/stable/${basearch}",
"repos": ["fedora"],

View File

@ -1,9 +1,9 @@
[fedora]
#when bumping 25 here, also bump fedora-base.json, compose script, and .papr.yml
name=Fedora 25 (devel) - $basearch
#when bumping 26 here, also bump compose script, and .papr.yml
name=Fedora 26 (devel) - $basearch
failovermethod=priority
baseurl=https://dl.fedoraproject.org/pub/fedora/linux/releases/25/Everything/$basearch/os/
baseurl=https://dl.fedoraproject.org/pub/fedora/linux/releases/26/Everything/$basearch/os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-$basearch
skip_if_unavailable=False