Skip to content

Commit

Permalink
openssh: put tests into passthru
Browse files Browse the repository at this point in the history
openssh tests are very slow (they take ~30 mins because they are not
parallelized). This makes rebuilding (esp. after changes e.g. to
systemd) painful. Putting the tests into a separate derivation solves
this without losing any testing capability.

Debian does the same: https://packages.debian.org/sid/openssh-tests
  • Loading branch information
nikstur committed Jan 17, 2024
1 parent 017bc47 commit 26e49b6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkgs/tools/networking/openssh/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
, linkOpenssl ? true
}:

stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
inherit pname version src;

patches = [
Expand Down Expand Up @@ -100,7 +100,7 @@ stdenv.mkDerivation {

hardeningEnable = [ "pie" ];

doCheck = true;
doCheck = false;
enableParallelChecking = false;
nativeCheckInputs = [ openssl ] ++ lib.optional (!stdenv.isDarwin) hostname;
preCheck = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
Expand Down Expand Up @@ -167,6 +167,9 @@ stdenv.mkDerivation {
];

passthru.tests = {
openssh = finalAttrs.finalPackage.overrideAttrs (_: {
doCheck = true;
});
borgbackup-integration = nixosTests.borgbackup;
};

Expand All @@ -179,4 +182,4 @@ stdenv.mkDerivation {
maintainers = (extraMeta.maintainers or []) ++ (with maintainers; [ eelco aneeshusa ]);
mainProgram = "ssh";
} // extraMeta;
}
})

0 comments on commit 26e49b6

Please sign in to comment.