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 Dec 29, 2023
1 parent 017bc47 commit 3736e47
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkgs/tools/networking/openssh/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, libfido2
, hostname
, nixosTests
, openssh # This is needed to override itself in passthru.tests
, withFIDO ? stdenv.hostPlatform.isUnix && !stdenv.hostPlatform.isMusl
, withPAM ? stdenv.hostPlatform.isLinux
, linkOpenssl ? true
Expand Down Expand Up @@ -100,7 +101,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 +168,9 @@ stdenv.mkDerivation {
];

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

Expand Down

0 comments on commit 3736e47

Please sign in to comment.