test: improve modularization
This improves debugging and experimenting by making it easy to compose fine-grained scenarios that have specific tests and features enabled. The VM test output now includes the subtest name and duration. Remove the 'raise Exception()' hack for interactive mode. Run 'banlist-and-restart' test before 'backups'. This speeds up the test by avoiding an extra shutdown of all bitcoin-related services.
This commit is contained in:
parent
14d2d97ba6
commit
1e18d3ea3b
8 changed files with 385 additions and 181 deletions
30
test/lib/test-lib.nix
Normal file
30
test/lib/test-lib.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ config, lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
test = {
|
||||
noConnections = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether services should be configured to not connect to external hosts.
|
||||
This can silence some warnings while running the test in an offline environment.
|
||||
'';
|
||||
};
|
||||
data = mkOption {
|
||||
type = types.attrs;
|
||||
default = {};
|
||||
description = ''
|
||||
Attrs that are available in the Python test script under the global
|
||||
dictionary variable 'test_data'. The data is exported via JSON.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
tests = mkOption {
|
||||
type = with types; attrsOf bool;
|
||||
default = {};
|
||||
description = "Python tests that should be run.";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue