From c1440d360d3b67d97c5b84aa81d0783fbf5f7936 Mon Sep 17 00:00:00 2001 From: Yuval Kogman Date: Fri, 22 May 2026 01:41:47 +0000 Subject: [PATCH] nix: separate flake checks for prop and unit test coverage --- nix/checks.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/nix/checks.nix b/nix/checks.nix index fd340f9..f68741c 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -46,18 +46,17 @@ ) profiles ) toolchains; - checks = testChecks // { - build = toolchains.nightly.buildPackage (checkArgs // { cargoArtifacts = cargoArtifactsRelease; }); - - coverage = toolchains.nightly.mkCargoDerivation ( + mkCoverage = + suffix: features: + toolchains.nightly.mkCargoDerivation ( checkArgs // { cargoArtifacts = cargoArtifactsDev; - pnameSuffix = "-coverage"; + pnameSuffix = "-coverage${suffix}"; nativeBuildInputs = [ pkgs.cargo-llvm-cov ]; buildPhaseCargoCommand = '' mkdir -p $out - cargo llvm-cov --all-features --lcov --output-path $out/coverage.lcov || { + cargo llvm-cov --no-default-features --features ${features} --lcov --output-path $out/coverage.lcov || { # no coverage data when there are no tests yet if [ ! -s $out/coverage.lcov ]; then echo "no coverage data (no tests), skipping assertion" @@ -71,6 +70,13 @@ } ); + checks = testChecks // { + build = toolchains.nightly.buildPackage (commonArgs // { cargoArtifacts = cargoArtifactsRelease; }); + + coverage = mkCoverage "" "unit-tests,prop-tests"; + coverage-no-unit-tests = mkCoverage "-no-unit-tests" "prop-tests"; + coverage-no-prop-tests = mkCoverage "-no-prop-tests" "unit-tests"; + clippy = toolchains.nightly.cargoClippy ( checkArgs // {