Commit b16f158e authored by zowoq's avatar zowoq
Browse files

nixos/hydra: switch to runTest, refactor

parent ab2a3d7d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -611,7 +611,7 @@ in
  hostname = handleTest ./hostname.nix { };
  hound = handleTest ./hound.nix { };
  hub = handleTest ./git/hub.nix { };
  hydra = handleTest ./hydra { };
  hydra = runTest ./hydra;
  i3wm = handleTest ./i3wm.nix { };
  icingaweb2 = runTest ./icingaweb2.nix;
  ifm = handleTest ./ifm.nix { };
+1 −2
Original line number Diff line number Diff line
{ system, ... }:
{
  baseConfig =
    { pkgs, ... }:
@@ -6,7 +5,7 @@
      trivialJob = pkgs.writeTextDir "trivial.nix" ''
        { trivial = builtins.derivation {
            name = "trivial";
            system = "${system}";
            system = "${pkgs.stdenv.hostPlatform.system}";
            builder = "/bin/sh";
            allowSubstitutes = false;
            preferLocalBuild = true;
+39 −60
Original line number Diff line number Diff line
{
  system ? builtins.currentSystem,
  config ? { },
  pkgs ? import ../../.. { inherit system config; },
}:

with import ../../lib/testing-python.nix { inherit system pkgs; };
with pkgs.lib;

{ pkgs, ... }:
let

  inherit (import ./common.nix { inherit system; }) baseConfig;

  hydraPkgs = {
    inherit (pkgs) hydra;
  };

  makeHydraTest =
    with pkgs.lib;
    name: package:
    makeTest {
      name = "hydra-${name}";
  inherit (import ./common.nix) baseConfig;
in
{
  name = "hydra";
  meta = with pkgs.lib.maintainers; {
    maintainers = [ lewo ];
  };
@@ -28,7 +12,6 @@ let
    { pkgs, lib, ... }:
    {
      imports = [ baseConfig ];
          services.hydra = { inherit package; };
    };

  testScript = ''
@@ -58,8 +41,4 @@ let
        'journalctl -eu hydra-notify.service -o cat | grep -q "sending mail notification to hydra@localhost"'
    )
  '';
    };

in

mapAttrs makeHydraTest hydraPkgs
}
+1 −1
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ stdenv.mkDerivation (finalAttrs: {

  passthru = {
    inherit nix perlDeps;
    tests.basic = nixosTests.hydra.hydra;
    tests = { inherit (nixosTests) hydra; };
    updateScript = unstableGitUpdater { };
  };