Merge pull request #97231 from flokli/coverage-data-remove
nixos/testing: remove remaining coverage-data logic
This commit is contained in:
commit
f439dc7101
4 changed files with 1 additions and 70 deletions
|
@ -63,18 +63,12 @@ rec {
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
|
|
||||||
LOGFILE=/dev/null tests='exec(os.environ["testScript"])' ${driver}/bin/nixos-test-driver
|
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 =
|
makeTest =
|
||||||
{ testScript
|
{ testScript
|
||||||
, makeCoverageReport ? false
|
|
||||||
, enableOCR ? false
|
, enableOCR ? false
|
||||||
, name ? "unnamed"
|
, name ? "unnamed"
|
||||||
# Skip linting (mainly intended for faster dev cycles)
|
# Skip linting (mainly intended for faster dev cycles)
|
||||||
|
@ -153,7 +147,6 @@ rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
test = passMeta (runTests driver);
|
test = passMeta (runTests driver);
|
||||||
report = passMeta (releaseTools.gcovReport { coverageRuns = [ test ]; });
|
|
||||||
|
|
||||||
nodeNames = builtins.attrNames nodes;
|
nodeNames = builtins.attrNames nodes;
|
||||||
invalidNodeNames = lib.filter
|
invalidNodeNames = lib.filter
|
||||||
|
@ -169,7 +162,7 @@ rec {
|
||||||
Please stick to alphanumeric chars and underscores as separation.
|
Please stick to alphanumeric chars and underscores as separation.
|
||||||
''
|
''
|
||||||
else
|
else
|
||||||
(if makeCoverageReport then report else test) // {
|
test // {
|
||||||
inherit nodes driver test;
|
inherit nodes driver test;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -74,15 +74,8 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; };
|
||||||
# OOM killer randomly get rid of processes, since this leads
|
# OOM killer randomly get rid of processes, since this leads
|
||||||
# to failures that are hard to diagnose.
|
# to failures that are hard to diagnose.
|
||||||
echo 2 > /proc/sys/vm/panic_on_oom
|
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
|
# Panic if an error occurs in stage 1 (rather than waiting for
|
||||||
# user intervention).
|
# user intervention).
|
||||||
boot.kernelParams =
|
boot.kernelParams =
|
||||||
|
@ -111,8 +104,6 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; };
|
||||||
networking.defaultGateway = mkOverride 150 "";
|
networking.defaultGateway = mkOverride 150 "";
|
||||||
networking.nameservers = mkOverride 150 [ ];
|
networking.nameservers = mkOverride 150 [ ];
|
||||||
|
|
||||||
systemd.globalEnvironment.GCOV_PREFIX = "/tmp/xchg/coverage-data";
|
|
||||||
|
|
||||||
system.requiredKernelConfig = with config.lib.kernelConfig; [
|
system.requiredKernelConfig = with config.lib.kernelConfig; [
|
||||||
(isYes "SERIAL_8250_CONSOLE")
|
(isYes "SERIAL_8250_CONSOLE")
|
||||||
(isYes "SERIAL_8250")
|
(isYes "SERIAL_8250")
|
||||||
|
|
|
@ -41,10 +41,6 @@ rec {
|
||||||
doCoverityAnalysis = true;
|
doCoverityAnalysis = true;
|
||||||
} // args);
|
} // args);
|
||||||
|
|
||||||
gcovReport = args: import ./gcov-report.nix (
|
|
||||||
{ inherit runCommand lcov rsync;
|
|
||||||
} // args);
|
|
||||||
|
|
||||||
rpmBuild = args: import ./rpm-build.nix (
|
rpmBuild = args: import ./rpm-build.nix (
|
||||||
{ inherit vmTools;
|
{ inherit vmTools;
|
||||||
} // args);
|
} // args);
|
||||||
|
|
|
@ -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
|
|
||||||
''
|
|
Loading…
Reference in a new issue