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:
Erik Arvstedt 2025-10-20 21:57:21 +02:00
parent dedbacf35e
commit 3a13b5f77c
No known key found for this signature in database
GPG key ID: 33312B944DD97846
2 changed files with 16 additions and 6 deletions

View file

@ -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 ''