forked from DGNum/colmena
integration-tests: Start migration to modular test framework
Still need to migrate most logic in tools.nix to modules.
This commit is contained in:
parent
92f0f155d4
commit
8b87f0de02
8 changed files with 280 additions and 190 deletions
|
@ -5,31 +5,33 @@ let
|
|||
deployers = [ "deployer" "alpha" "beta" ];
|
||||
targets = [];
|
||||
};
|
||||
in tools.makeTest {
|
||||
in tools.runTest {
|
||||
name = "colmena-build-on-target";
|
||||
|
||||
bundle = ./.;
|
||||
colmena.test = {
|
||||
bundle = ./.;
|
||||
|
||||
testScript = ''
|
||||
# The actual build will be initiated on alpha
|
||||
deployer.succeed("cd /tmp/bundle && ${tools.colmenaExec} apply --on alpha")
|
||||
testScript = ''
|
||||
# The actual build will be initiated on alpha
|
||||
deployer.succeed("cd /tmp/bundle && ${tools.colmenaExec} apply --on alpha")
|
||||
|
||||
with subtest("Check that the new configurations are indeed applied"):
|
||||
alpha.succeed("grep SUCCESS /etc/deployment")
|
||||
with subtest("Check that the new configurations are indeed applied"):
|
||||
alpha.succeed("grep SUCCESS /etc/deployment")
|
||||
|
||||
alpha_profile = alpha.succeed("readlink /run/current-system")
|
||||
alpha_profile = alpha.succeed("readlink /run/current-system")
|
||||
|
||||
with subtest("Check that the built profile is not on the deployer"):
|
||||
deployer.fail(f"nix-store -qR {alpha_profile}")
|
||||
with subtest("Check that the built profile is not on the deployer"):
|
||||
deployer.fail(f"nix-store -qR {alpha_profile}")
|
||||
|
||||
with subtest("Check that we can override per-node settings and build locally"):
|
||||
deployer.succeed("cd /tmp/bundle && ${tools.colmenaExec} build --on alpha --no-build-on-target")
|
||||
deployer.succeed(f"nix-store -qR {alpha_profile}")
|
||||
with subtest("Check that we can override per-node settings and build locally"):
|
||||
deployer.succeed("cd /tmp/bundle && ${tools.colmenaExec} build --on alpha --no-build-on-target")
|
||||
deployer.succeed(f"nix-store -qR {alpha_profile}")
|
||||
|
||||
with subtest("Check that we can override per-node settings and build remotely"):
|
||||
deployer.succeed("cd /tmp/bundle && ${tools.colmenaExec} apply --on beta --build-on-target")
|
||||
beta.succeed("grep SUCCESS /etc/deployment")
|
||||
profile = beta.succeed("readlink /run/current-system")
|
||||
deployer.fail(f"nix-store -qR {profile}")
|
||||
'';
|
||||
with subtest("Check that we can override per-node settings and build remotely"):
|
||||
deployer.succeed("cd /tmp/bundle && ${tools.colmenaExec} apply --on beta --build-on-target")
|
||||
beta.succeed("grep SUCCESS /etc/deployment")
|
||||
profile = beta.succeed("readlink /run/current-system")
|
||||
deployer.fail(f"nix-store -qR {profile}")
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue