ci/prow: Install in target cosa, also install and run our tests

This is a major downside of reworking and generating new CI
flows, it's super easy to lose testing what you intend to.

Also, we clearly need to figure out a flow where this is shared
across repos, since I don't want to copy-paste this into e.g. ostree too.
That's https://github.com/coreos/fedora-coreos-tracker/issues/263
This commit is contained in:
Colin Walters 2021-02-25 17:33:14 +00:00 committed by OpenShift Merge Robot
parent b02987a22e
commit 1dc7503838
4 changed files with 21 additions and 8 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
.cosa
target

View File

@ -1,12 +1,19 @@
FROM registry.svc.ci.openshift.org/coreos/cosa-buildroot:latest as builder
FROM registry.ci.openshift.org/coreos/cosa-buildroot:latest as builder
WORKDIR /src
COPY . .
RUN ./ci/build.sh && make install DESTDIR=/cosa/component-install
RUN make -C tests/kolainst install DESTDIR=/cosa/component-tests
# Uncomment this to fake a build to test the code below
# RUN mkdir -p /cosa/component-install/usr/bin && echo foo > /cosa/component-install/usr/bin/foo
FROM registry.svc.ci.openshift.org/coreos/coreos-assembler:latest
FROM registry.ci.openshift.org/coreos/coreos-assembler:latest
WORKDIR /srv
# Install our built binaries as overrides for the target build
COPY --from=builder /cosa/component-install /srv/overrides/rootfs/
USER root
# Copy binaries from the build
COPY --from=builder /cosa /cosa
# Merge them to the real root since we're used at compose time
RUN rsync -rlv /cosa/component-install/ /
# Merge installed tests
RUN rsync -rlv /cosa/component-tests/ /
COPY --from=builder /src/ci/prow/fcos-e2e.sh /usr/bin/fcos-e2e
USER builder

View File

@ -3,9 +3,13 @@ set -xeuo pipefail
# Prow jobs don't support adding emptydir today
export COSA_SKIP_OVERLAY=1
gitdir=$(pwd)
# And suppress depcheck since we didn't install via RPM
export COSA_SUPPRESS_DEPCHECK=1
ls -al /usr/bin/rpm-ostree
rpm-ostree --version
cd $(mktemp -d)
cosa init --force https://github.com/coreos/fedora-coreos-config/
cosa init https://github.com/coreos/fedora-coreos-config/
rsync -rlv /cosa/component-install/ overrides/rootfs/
cosa fetch
cosa build
cosa kola run 'ext.*'
cosa kola run 'ext.rpm-ostree.*'

View File

@ -3,7 +3,7 @@
# to the kola tests as data/, so we don't need to rpmbuild.
set -euo pipefail
dn=$(cd "$(dirname "$0")" && pwd)
topsrcdir=$(git rev-parse --show-toplevel)
topsrcdir=$(cd $dn/../.. && pwd)
commondir=$(cd "$dn/../common" && pwd)
export topsrcdir commondir
. "${commondir}/libtest.sh"