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
|
||||
tools = import ../tools.nix {
|
||||
tools = pkgs.callPackage ../tools.nix {
|
||||
targets = [];
|
||||
prebuiltTarget = "deployer";
|
||||
};
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{ pkgs ? import ../nixpkgs.nix }:
|
||||
|
||||
let
|
||||
tools = import ../tools.nix {};
|
||||
tools = pkgs.callPackage ../tools.nix {};
|
||||
in tools.makeTest {
|
||||
name = "colmena-apply";
|
||||
|
||||
|
|
|
@ -22,9 +22,8 @@ with subtest("Check that activation messages were logged correctly"):
|
|||
assert "must appear during activation" in logs
|
||||
|
||||
with subtest("Check that we can still connect to the target nodes"):
|
||||
deployer.succeed("ssh alpha true")
|
||||
deployer.succeed("ssh beta true")
|
||||
deployer.succeed("ssh gamma true")
|
||||
for node in targets:
|
||||
deployer.succeed(f"ssh {node.name} true")
|
||||
|
||||
with subtest("Check that the new configurations are indeed applied"):
|
||||
for node in targets:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
apply = import ./apply;
|
||||
apply-local = import ./apply-local;
|
||||
exec = import ./exec;
|
||||
flakes = import ./flakes;
|
||||
parallel = import ./parallel;
|
||||
apply = import ./apply {};
|
||||
apply-local = import ./apply-local {};
|
||||
exec = import ./exec {};
|
||||
flakes = import ./flakes {};
|
||||
parallel = import ./parallel {};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{ pkgs ? import ../nixpkgs.nix }:
|
||||
|
||||
let
|
||||
tools = import ../tools.nix {};
|
||||
tools = pkgs.callPackage ../tools.nix {};
|
||||
in tools.makeTest {
|
||||
name = "colmena-exec";
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{ pkgs ? import ../nixpkgs.nix }:
|
||||
|
||||
let
|
||||
tools = import ../tools.nix {
|
||||
tools = pkgs.callPackage ../tools.nix {
|
||||
targets = [ "alpha" ];
|
||||
};
|
||||
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
|
||||
tools = import ../tools.nix {};
|
||||
tools = pkgs.callPackage ../tools.nix {};
|
||||
in tools.makeTest {
|
||||
name = "colmena-parallel";
|
||||
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
, deployers ? [ "deployer" ] # Nodes configured as deployers (with Colmena and pre-built system closure)
|
||||
, targets ? [ "alpha" "beta" "gamma" ] # Nodes configured as targets (minimal config)
|
||||
, 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;
|
||||
|
@ -18,17 +21,8 @@ with builtins;
|
|||
assert elem "deployer" deployers;
|
||||
|
||||
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;
|
||||
|
||||
colmena =
|
||||
if !insideVm then import ../default.nix { inherit pkgs; }
|
||||
else throw "Cannot be used inside the VM";
|
||||
colmenaExec = "${colmena}/bin/colmena";
|
||||
|
||||
sshKeys = import (pkgs.path + "/nixos/tests/ssh-keys.nix") pkgs;
|
||||
|
|
Loading…
Reference in a new issue