diff --git a/nix/compile.nix b/nix/compile.nix index 677e26c7..4e3fdd7a 100644 --- a/nix/compile.nix +++ b/nix/compile.nix @@ -116,6 +116,7 @@ let strictDeps = true; cargoExtraArgs = "--locked --features ${featuresStr}"; + cargoTestExtraArgs = "--workspace"; nativeBuildInputs = [ pkgsNative.protobuf @@ -143,12 +144,6 @@ let CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = "clang"; }); - testArgs = commonArgs // { - pname = "garage-tests"; - cargoExtraArgs = "${commonArgs.cargoExtraArgs} --tests --workspace"; - CARGO_PROFILE = "test"; - }; - in rec { toolchain = toolchainFn pkgs; @@ -178,18 +173,17 @@ in rec { # ---- testing garage ---- - garage-test-deps = craneLib.buildDepsOnly testArgs; - # cargoArtifacts = garage would do nothing for this derivation - # because it's not the same profile - # this is a truly independent build + garage-test-bin = craneLib.cargoBuild (commonArgs // { + cargoArtifacts = garage-deps; - garage-test-bin = craneLib.cargoBuild (testArgs // { - cargoArtifacts = garage-test-deps; + pname = "garage-tests"; + CARGO_PROFILE = "test"; + cargoExtraArgs = "${commonArgs.cargoExtraArgs} --tests --workspace"; doCheck = false; }); - garage-test = craneLib.cargoTest (testArgs // { + garage-test = craneLib.cargoTest (commonArgs // { cargoArtifacts = garage-test-bin; nativeBuildInputs = commonArgs.nativeBuildInputs ++ [ pkgs.cacert