aboutsummaryrefslogtreecommitdiff
path: root/nixos/tests/all-tests.nix
blob: 17a4332cc3cd1e70a6f8a662803cfcef1a29d01f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
  callPackage,
  nixos-lib,
  pkgs,
}:

let
  dsl = ./dsl.nix;
  diamond.dag = {
    nodes.a = { };
    nodes.b.inputs.a = { }; # b->a
    nodes.c.inputs.a = { }; # c->a
    nodes.d.inputs.b = { }; # d->b
    nodes.d.inputs.c = { }; # d->c
  };
in
builtins.mapAttrs
  (
    name: value:
    nixos-lib.runTest (
      {
        inherit name;
        hostPkgs = pkgs;
        testScript = ''
          start_all()
          substituter.wait_for_unit("nix-serve.service")
          builder.succeed("dag-test")
        '';
      }
      // value
    )
  )
  {
    diamond-unbuilt-0 = {
      imports = [
        {
          dag.needBuilds = 0;
          dag.needDownloads = 0;
        }
        diamond
        dsl
      ];
    };
    diamond-unbuilt-2 = {
      imports = [
        {
          dag.nodes.a.cache = "remote";
          dag.nodes.b.cache = "remote";
          dag.nodes.d.request = true;
          dag.needBuilds = 2;
          dag.needDownloads = 2;
        }
        diamond
        dsl
      ];
    };
    diamond-unbuilt-4 = {
      imports = [
        {
          dag.nodes.d.request = true;
          dag.needBuilds = 4;
          dag.needDownloads = 0;
        }
        diamond
        dsl
      ];
    };
  }