ci/test-info.nix: read scenarios from github workflow file
Simplifies maintenance, both files no longer need to be kept in sync.
This commit is contained in:
parent
dedbacf35e
commit
3a13b5f77c
2 changed files with 16 additions and 6 deletions
|
|
@ -1,12 +1,19 @@
|
|||
pkgs: instantiateTests:
|
||||
|
||||
let
|
||||
scenarioNames = let
|
||||
inherit (pkgs) lib;
|
||||
workflowSrc = builtins.readFile ../../.github/workflows/test.yml;
|
||||
matches = builtins.match ".*scenario:(([ \n]+-[ ]+[^ \n]+)+).*" workflowSrc;
|
||||
scenariosStr = builtins.head matches;
|
||||
particles = builtins.split "[ \n]+-[ ]+" scenariosStr;
|
||||
# The first split particle is always an empty str
|
||||
particles' = builtins.tail particles;
|
||||
in
|
||||
builtins.filter lib.isString particles';
|
||||
|
||||
# `instantiateTests` prints the test name before evaluating, which is useful for debugging
|
||||
ciTests = instantiateTests [
|
||||
"default"
|
||||
"netns"
|
||||
"netnsRegtest"
|
||||
];
|
||||
ciTests = instantiateTests scenarioNames;
|
||||
drivers = map (x: x.driver) ciTests;
|
||||
driverDrvs = map (x: ''"${x.drvPath}^*"'') drivers;
|
||||
in ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue