forked from DGNum/colmena
integration-tests: Make it easier to override pkgs and colmena
This commit is contained in:
parent
31fc98cfa7
commit
372de58dff
9 changed files with 38 additions and 22 deletions
|
@ -1,5 +1,7 @@
|
||||||
|
{ pkgs ? import ../nixpkgs.nix }:
|
||||||
|
|
||||||
let
|
let
|
||||||
tools = import ../tools.nix {
|
tools = pkgs.callPackage ../tools.nix {
|
||||||
targets = [];
|
targets = [];
|
||||||
prebuiltTarget = "deployer";
|
prebuiltTarget = "deployer";
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
{ pkgs ? import ../nixpkgs.nix }:
|
||||||
|
|
||||||
let
|
let
|
||||||
tools = import ../tools.nix {};
|
tools = pkgs.callPackage ../tools.nix {};
|
||||||
in tools.makeTest {
|
in tools.makeTest {
|
||||||
name = "colmena-apply";
|
name = "colmena-apply";
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,8 @@ with subtest("Check that activation messages were logged correctly"):
|
||||||
assert "must appear during activation" in logs
|
assert "must appear during activation" in logs
|
||||||
|
|
||||||
with subtest("Check that we can still connect to the target nodes"):
|
with subtest("Check that we can still connect to the target nodes"):
|
||||||
deployer.succeed("ssh alpha true")
|
for node in targets:
|
||||||
deployer.succeed("ssh beta true")
|
deployer.succeed(f"ssh {node.name} true")
|
||||||
deployer.succeed("ssh gamma true")
|
|
||||||
|
|
||||||
with subtest("Check that the new configurations are indeed applied"):
|
with subtest("Check that the new configurations are indeed applied"):
|
||||||
for node in targets:
|
for node in targets:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
apply = import ./apply;
|
apply = import ./apply {};
|
||||||
apply-local = import ./apply-local;
|
apply-local = import ./apply-local {};
|
||||||
exec = import ./exec;
|
exec = import ./exec {};
|
||||||
flakes = import ./flakes;
|
flakes = import ./flakes {};
|
||||||
parallel = import ./parallel;
|
parallel = import ./parallel {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
{ pkgs ? import ../nixpkgs.nix }:
|
||||||
|
|
||||||
let
|
let
|
||||||
tools = import ../tools.nix {};
|
tools = pkgs.callPackage ../tools.nix {};
|
||||||
in tools.makeTest {
|
in tools.makeTest {
|
||||||
name = "colmena-exec";
|
name = "colmena-exec";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
{ pkgs ? import ../nixpkgs.nix }:
|
||||||
|
|
||||||
let
|
let
|
||||||
tools = import ../tools.nix {
|
tools = pkgs.callPackage ../tools.nix {
|
||||||
targets = [ "alpha" ];
|
targets = [ "alpha" ];
|
||||||
};
|
};
|
||||||
in tools.makeTest {
|
in tools.makeTest {
|
||||||
|
|
13
integration-tests/nixpkgs.nix
Normal file
13
integration-tests/nixpkgs.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
let
|
||||||
|
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
|
||||||
|
pinned = fetchTarball {
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/archive/${lock.nodes.nixpkgs.locked.rev}.tar.gz";
|
||||||
|
sha256 = lock.nodes.nixpkgs.locked.narHash;
|
||||||
|
};
|
||||||
|
in import pinned {
|
||||||
|
overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
colmena = final.callPackage ../default.nix { };
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
|
{ pkgs ? import ../nixpkgs.nix }:
|
||||||
|
|
||||||
let
|
let
|
||||||
tools = import ../tools.nix {};
|
tools = pkgs.callPackage ../tools.nix {};
|
||||||
in tools.makeTest {
|
in tools.makeTest {
|
||||||
name = "colmena-parallel";
|
name = "colmena-parallel";
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,9 @@
|
||||||
, deployers ? [ "deployer" ] # Nodes configured as deployers (with Colmena and pre-built system closure)
|
, deployers ? [ "deployer" ] # Nodes configured as deployers (with Colmena and pre-built system closure)
|
||||||
, targets ? [ "alpha" "beta" "gamma" ] # Nodes configured as targets (minimal config)
|
, targets ? [ "alpha" "beta" "gamma" ] # Nodes configured as targets (minimal config)
|
||||||
, prebuiltTarget ? "alpha" # Target node to prebuild system closure for, or null
|
, prebuiltTarget ? "alpha" # Target node to prebuild system closure for, or null
|
||||||
|
|
||||||
|
, pkgs ? if insideVm then import <nixpkgs> {} else throw "Must specify pkgs"
|
||||||
|
, colmena ? if !insideVm then pkgs.colmena else throw "Cannot eval inside VM"
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with builtins;
|
with builtins;
|
||||||
|
@ -18,17 +21,8 @@ with builtins;
|
||||||
assert elem "deployer" deployers;
|
assert elem "deployer" deployers;
|
||||||
|
|
||||||
let
|
let
|
||||||
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
|
|
||||||
pinned = if insideVm then <nixpkgs> else fetchTarball {
|
|
||||||
url = "https://github.com/NixOS/nixpkgs/archive/${lock.nodes.nixpkgs.locked.rev}.tar.gz";
|
|
||||||
sha256 = lock.nodes.nixpkgs.locked.narHash;
|
|
||||||
};
|
|
||||||
pkgs = import pinned {};
|
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
|
|
||||||
colmena =
|
|
||||||
if !insideVm then import ../default.nix { inherit pkgs; }
|
|
||||||
else throw "Cannot be used inside the VM";
|
|
||||||
colmenaExec = "${colmena}/bin/colmena";
|
colmenaExec = "${colmena}/bin/colmena";
|
||||||
|
|
||||||
sshKeys = import (pkgs.path + "/nixos/tests/ssh-keys.nix") pkgs;
|
sshKeys = import (pkgs.path + "/nixos/tests/ssh-keys.nix") pkgs;
|
||||||
|
|
Loading…
Reference in a new issue