forked from fediversity/fediversity
add unit test: TF validate
This commit is contained in:
parent
2510b68a68
commit
f184fd3944
3 changed files with 34 additions and 0 deletions
|
|
@ -26,3 +26,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: cd panel && nix-build -A tests
|
- run: cd panel && nix-build -A tests
|
||||||
|
|
||||||
|
check-launch:
|
||||||
|
runs-on: native
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: cd launch && nix-build -A tests
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tests = pkgs.callPackage ./tests.nix { };
|
||||||
|
|
||||||
# re-export inputs so they can be overridden granularly
|
# re-export inputs so they can be overridden granularly
|
||||||
# (they can't be accessed from the outside any other way)
|
# (they can't be accessed from the outside any other way)
|
||||||
inherit
|
inherit
|
||||||
|
|
|
||||||
26
launch/tests.nix
Normal file
26
launch/tests.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{ lib, pkgs }:
|
||||||
|
let
|
||||||
|
defaults = {
|
||||||
|
virtualisation = {
|
||||||
|
memorySize = 2048;
|
||||||
|
cores = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
tf = pkgs.callPackage ./tf.nix { };
|
||||||
|
tfEnv = pkgs.callPackage ./tf-env.nix { };
|
||||||
|
in
|
||||||
|
lib.mapAttrs (name: test: pkgs.testers.runNixOSTest (test // { inherit name; })) {
|
||||||
|
tf-validate = {
|
||||||
|
inherit defaults;
|
||||||
|
nodes.server = {
|
||||||
|
environment.systemPackages = [
|
||||||
|
tf
|
||||||
|
tfEnv
|
||||||
|
];
|
||||||
|
};
|
||||||
|
testScript = ''
|
||||||
|
server.wait_for_unit("multi-user.target")
|
||||||
|
server.succeed("${lib.getExe tf} -chdir='${tfEnv}/launch' validate")
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue