diff --git a/checks/default.nix b/checks/default.nix index c50ca7f..7ab6475 100644 --- a/checks/default.nix +++ b/checks/default.nix @@ -104,6 +104,8 @@ myPkgs // { mkDummySrcTests = callPackage ./mkDummySrcTests { }; + nextest = callPackage ./nextest.nix { }; + simple = myLib.buildPackage { src = ./simple; }; @@ -189,27 +191,5 @@ myPkgs // { src = ./workspace-git; pname = "workspace-git"; }; - - nextestSimple = myLib.cargoNextest { - src = ./simple; - pname = "nextest-simple"; - cargoArtifacts = null; - }; - - nextestPartitionsCount = myLib.cargoNextest { - src = ./simple; - pname = "nextest-partitions-count"; - partitions = 4; - partitionType = "count"; - cargoArtifacts = null; - }; - - nextestPartitionsHash = myLib.cargoNextest { - src = ./simple; - pname = "nextest-partitions-hash"; - partitions = 4; - partitionType = "hash"; - cargoArtifacts = null; - }; }) ) diff --git a/checks/nextest.nix b/checks/nextest.nix new file mode 100644 index 0000000..f28627a --- /dev/null +++ b/checks/nextest.nix @@ -0,0 +1,43 @@ +{ cargo-nextest +, cargoNextest +, lib +, linkFarmFromDrvs +, runCommand +}: + +let + # cargo-nextest version in the stable-22.05 branch is too old + nextestSupportsArchives = lib.versionAtLeast + cargo-nextest.version + "0.9.15"; + + nextestSimple = cargoNextest { + src = ./simple; + pname = "nextest-simple"; + cargoArtifacts = null; + }; + + nextestPartitionsCount = cargoNextest { + src = ./simple; + pname = "nextest-partitions-count"; + partitions = 4; + partitionType = "count"; + cargoArtifacts = null; + }; + + nextestPartitionsHash = cargoNextest { + src = ./simple; + pname = "nextest-partitions-hash"; + partitions = 4; + partitionType = "hash"; + cargoArtifacts = null; + }; +in +runCommand "nextestTests" { + buildInputs = [ nextestSimple ] ++ (lib.optionals nextestSupportsArchives [ + nextestPartitionsCount + nextestPartitionsHash + ]); +} '' + mkdir -p $out +''