test: reject empty qualification nodes

This commit is contained in:
Affaan Mustafa
2026-07-24 00:30:33 -04:00
parent 0761e2fabf
commit 43a6a565eb
2 changed files with 17 additions and 2 deletions
+5 -2
View File
@@ -86,7 +86,7 @@ function requiredOptionValue(args, option) {
throw new Error(`${option} is required exactly once for live node qualification.`);
}
const value = args[indexes[0] + 1];
if (!value || value.startsWith("--")) {
if (!value?.trim() || value.startsWith("--")) {
throw new Error(`${option} requires a non-empty value for live node qualification.`);
}
return value;
@@ -104,7 +104,10 @@ function validateNodeQualificationArgs(args, environment) {
);
}
requiredOptionValue(args, "--cluster");
requiredOptionValue(args, "--nodes");
const nodes = requiredOptionValue(args, "--nodes");
if (!nodes.split(",").every((node) => node.trim().length > 0)) {
throw new Error("--nodes must explicitly list one or more non-empty nodes.");
}
const configDirectory = requiredOptionValue(args, "--config-dir");
if (!path.isAbsolute(configDirectory)) {
throw new Error("--config-dir must be an existing absolute directory.");
+12
View File
@@ -243,6 +243,18 @@ function main() {
env: { ITO_ENABLE_SIXTYTWO_LIVE: "1" },
error: /--nodes/,
},
{
label: "empty node list",
args: [
"ito", "evals",
"--cluster", "clu_prod_example",
"--live-sixtytwo",
"--nodes", ",",
"--config-dir", "__CONFIG__",
],
env: { ITO_ENABLE_SIXTYTWO_LIVE: "1" },
error: /--nodes/,
},
{
label: "missing cluster",
args: [