nixos/testing: remove remaining coverage-data logic

This isn't used anymore as per
https://github.com/NixOS/nixpkgs/pull/72354#discussion_r451031449.
This commit is contained in:
Florian Klink 2020-09-05 16:07:14 +02:00
parent 4b7401bb5b
commit 98d6b55fdc
4 changed files with 1 additions and 70 deletions

View File

@ -63,18 +63,12 @@ rec {
mkdir -p $out
LOGFILE=/dev/null tests='exec(os.environ["testScript"])' ${driver}/bin/nixos-test-driver
for i in */xchg/coverage-data; do
mkdir -p $out/coverage-data
mv $i $out/coverage-data/$(dirname $(dirname $i))
done
'';
};
makeTest =
{ testScript
, makeCoverageReport ? false
, enableOCR ? false
, name ? "unnamed"
# Skip linting (mainly intended for faster dev cycles)
@ -153,7 +147,6 @@ rec {
};
test = passMeta (runTests driver);
report = passMeta (releaseTools.gcovReport { coverageRuns = [ test ]; });
nodeNames = builtins.attrNames nodes;
invalidNodeNames = lib.filter
@ -169,7 +162,7 @@ rec {
Please stick to alphanumeric chars and underscores as separation.
''
else
(if makeCoverageReport then report else test) // {
test // {
inherit nodes driver test;
};

View File

@ -74,15 +74,8 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; };
# OOM killer randomly get rid of processes, since this leads
# to failures that are hard to diagnose.
echo 2 > /proc/sys/vm/panic_on_oom
# Coverage data is written into /tmp/coverage-data.
mkdir -p /tmp/xchg/coverage-data
'';
# If the kernel has been built with coverage instrumentation, make
# it available under /proc/gcov.
boot.kernelModules = [ "gcov-proc" ];
# Panic if an error occurs in stage 1 (rather than waiting for
# user intervention).
boot.kernelParams =
@ -111,8 +104,6 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; };
networking.defaultGateway = mkOverride 150 "";
networking.nameservers = mkOverride 150 [ ];
systemd.globalEnvironment.GCOV_PREFIX = "/tmp/xchg/coverage-data";
system.requiredKernelConfig = with config.lib.kernelConfig; [
(isYes "SERIAL_8250_CONSOLE")
(isYes "SERIAL_8250")

View File

@ -41,10 +41,6 @@ rec {
doCoverityAnalysis = true;
} // args);
gcovReport = args: import ./gcov-report.nix (
{ inherit runCommand lcov rsync;
} // args);
rpmBuild = args: import ./rpm-build.nix (
{ inherit vmTools;
} // args);

View File

@ -1,49 +0,0 @@
{ runCommand, lcov, rsync, coverageRuns, lcovFilter ? [ "/nix/store/*" ], baseDirHack ? false }:
runCommand "coverage"
{ buildInputs = [ lcov rsync ];
inherit lcovFilter baseDirHack;
}
''
mkdir -p $TMPDIR/gcov $out/nix-support $out/coverage
info=$out/coverage/full.info
for p in ${toString coverageRuns}; do
if [ -f $p/nix-support/hydra-build-products ]; then
cat $p/nix-support/hydra-build-products >> $out/nix-support/hydra-build-products
fi
[ ! -e $p/nix-support/failed ] || touch $out/nix-support/failed
opts=
for d in $p/coverage-data/*; do
for i in $(cd $d/nix/store && ls); do
if ! [ -e /nix/store/$i/.build ]; then continue; fi
if [ -e $TMPDIR/gcov/nix/store/$i ]; then continue; fi
echo "copying $i..."
rsync -a /nix/store/$i/.build/* $TMPDIR/gcov/
if [ -n "$baseDirHack" ]; then
opts="-b $TMPDIR/gcov/$(cd /nix/store/$i/.build && ls)"
fi
done
for i in $(cd $d/nix/store && ls); do
rsync -a $d/nix/store/$i/.build/* $TMPDIR/gcov/ --include '*/' --include '*.gcda' --exclude '*'
done
done
chmod -R u+w $TMPDIR/gcov
echo "producing info..."
geninfo --ignore-errors source,gcov $TMPDIR/gcov --output-file $TMPDIR/app.info $opts
cat $TMPDIR/app.info >> $info
done
echo "making report..."
set -o noglob
lcov --remove $info ''$lcovFilter > $info.tmp
set +o noglob
mv $info.tmp $info
genhtml --show-details $info -o $out/coverage
echo "report coverage $out/coverage" >> $out/nix-support/hydra-build-products
''