From 7c532d5572c97b500fe4a986c8f96e4ee49b37fd Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Mon, 24 Aug 2020 15:01:49 +0200 Subject: [PATCH] coverage.sh: produce report inside VM to prevent errors from version mismatches --- coverage.sh | 43 +++++++++++++++++++++++++------------------ make_mirror.sh | 2 +- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/coverage.sh b/coverage.sh index 7fc353b..7c21522 100755 --- a/coverage.sh +++ b/coverage.sh @@ -3090,6 +3090,31 @@ END fi done +if [ -e shared/cover_db.img ]; then + # produce report inside the VM to make sure that the versions match or + # otherwise we might get: + # Can't read shared/cover_db/runs/1598213854.252.64287/cover.14 with Sereal: Sereal: Error: Bad Sereal header: Not a valid Sereal document. at offset 1 of input at srl_decoder.c line 600 at /usr/lib/x86_64-linux-gnu/perl5/5.30/Devel/Cover/DB/IO/Sereal.pm line 34, <$fh> chunk 1. + cat << END > shared/test.sh +cover -nogcov -report html_basic cover_db +mkdir -p report +for f in common.js coverage.html cover.css css.js mmdebstrap--branch.html mmdebstrap--condition.html mmdebstrap.html mmdebstrap--subroutine.html standardista-table-sorting.js; do + cp -a cover_db/\$f report +done +cover -delete cover_db +END + if [ "$HAVE_QEMU" = "yes" ]; then + ./run_qemu.sh + elif [ "$mode" = "root" ]; then + ./run_null.sh SUDO + else + ./run_null.sh + fi + + echo + echo open file://$(pwd)/shared/report/coverage.html in a browser + echo +fi + if [ "$((i-1))" -ne "$total" ]; then echo "unexpected number of tests: got $((i-1)) but expected $total" >&2 exit 1 @@ -3108,22 +3133,4 @@ if [ "$((skipped+runtests))" -ne "$total" ]; then exit 1 fi -if [ "$HAVE_QEMU" = "yes" ]; then - guestfish add-ro shared/cover_db.img : run : mount /dev/sda / : tar-out / - \ - | tar -C shared/cover_db --extract -fi - -if [ -e shared/cover_db/runs ]; then - cover -nogcov -report html_basic shared/cover_db - mkdir -p report - for f in common.js coverage.html cover.css css.js mmdebstrap--branch.html mmdebstrap--condition.html mmdebstrap.html mmdebstrap--subroutine.html standardista-table-sorting.js; do - cp -a shared/cover_db/$f report - done - cover -delete shared/cover_db - - echo - echo open file://$(pwd)/report/coverage.html in a browser - echo -fi - rm shared/test.sh shared/tar1.txt shared/tar2.txt shared/pkglist.txt shared/doc-debian.tar.list shared/mmdebstrap shared/taridshift diff --git a/make_mirror.sh b/make_mirror.sh index d28dc80..194cc42 100755 --- a/make_mirror.sh +++ b/make_mirror.sh @@ -424,7 +424,7 @@ if [ "$HAVE_QEMU" = "yes" ]; then tmpdir="$(mktemp -d)" trap "cleanuptmpdir; cleanup_newcachedir" EXIT INT TERM - pkgs=perl-doc,systemd-sysv,perl,arch-test,fakechroot,fakeroot,mount,uidmap,qemu-user-static,binfmt-support,qemu-user,dpkg-dev,mini-httpd,libdevel-cover-perl,debootstrap,procps,apt-cudf,aspcud,squashfs-tools-ng,genext2fs,python3,libcap2-bin,gpg + pkgs=perl-doc,systemd-sysv,perl,arch-test,fakechroot,fakeroot,mount,uidmap,qemu-user-static,binfmt-support,qemu-user,dpkg-dev,mini-httpd,libdevel-cover-perl,libtemplate-perl,debootstrap,procps,apt-cudf,aspcud,squashfs-tools-ng,genext2fs,python3,libcap2-bin,gpg if [ "$HAVE_PROOT" = "yes" ]; then pkgs="$pkgs,proot" fi