diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/README.md | 2 | ||||
-rw-r--r-- | tests/by-name/gi/git-server/ssh_keys.nix (renamed from tests/nixos/vhack/git-server/ssh_keys.nix) | 0 | ||||
-rw-r--r-- | tests/by-name/gi/git-server/test.nix (renamed from tests/nixos/vhack/git-server/test.nix) | 17 | ||||
-rw-r--r-- | tests/default.nix | 13 |
4 files changed, 23 insertions, 9 deletions
diff --git a/tests/README.md b/tests/README.md index 2613f4a..0ff5738 100644 --- a/tests/README.md +++ b/tests/README.md @@ -3,4 +3,4 @@ This directory tree mirrors the modules defined in the [modules](`../modules/`) directory. Each module should have at least one test in the mirrored directory, effectively replacing the module's -`default.nix` file. +`module.nix` file. diff --git a/tests/nixos/vhack/git-server/ssh_keys.nix b/tests/by-name/gi/git-server/ssh_keys.nix index 07f0b88..07f0b88 100644 --- a/tests/nixos/vhack/git-server/ssh_keys.nix +++ b/tests/by-name/gi/git-server/ssh_keys.nix diff --git a/tests/nixos/vhack/git-server/test.nix b/tests/by-name/gi/git-server/test.nix index 6d5edda..0cf3ee8 100644 --- a/tests/nixos/vhack/git-server/test.nix +++ b/tests/by-name/gi/git-server/test.nix @@ -4,6 +4,7 @@ nixpkgs-unstable, pkgs, extraModules, + nixLib, ... }: let sshKeys = @@ -47,7 +48,7 @@ in name = "git-server"; node = { - specialArgs = {inherit pkgsUnstable nixpkgs-unstable;}; + specialArgs = {inherit pkgsUnstable nixpkgs-unstable nixLib;}; # Use the nixpkgs as constructed by the `nixpkgs.*` options pkgs = null; @@ -58,7 +59,7 @@ in imports = extraModules ++ [ - ../../../../modules/nixos + ../../../../modules ]; system.activationScripts = { @@ -234,11 +235,11 @@ in # He can't see the readme (FIXME: find out why this does not work. <2024-08-13> ) # with subtest("Bob can see alice's README"): # client.succeed("sudo -u bob ${pkgs.writeShellScript "bob-alice-readme" '' - # set -xe - # - # curl --insecure --silent --fail --show-error 'https://server/alice/alice-project/about' > readme.html - # cat readme.html - # diff --side-by-side ${expectedHtmlReadme} readme.html - # ''}") + # set -xe + # + # curl --insecure --silent --fail --show-error 'https://server/alice/alice-project/about' > readme.html + # cat readme.html + # diff --side-by-side ${expectedHtmlReadme} readme.html + # ''}") ''; } diff --git a/tests/default.nix b/tests/default.nix new file mode 100644 index 0000000..d9b354a --- /dev/null +++ b/tests/default.nix @@ -0,0 +1,13 @@ +{ + specialArgs, + nixLib, + pkgs, +}: let + tests = nixLib.mkByName { + baseDirectory = ./by-name; + fileName = "test.nix"; + finalizeFunction = name: value: + import value (nixLib.warnMerge specialArgs {inherit pkgs;} "the test args set"); + }; +in + tests |