Skip to content

Commit cf1ab5e

Browse files
authored
Fix --dump-test-list (#266)
We moved the params parsing partially to the Params which was not use in cli.js Directly use the cli-only arguments in cli.js instead.
1 parent 3900fef commit cf1ab5e

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

cli.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,15 @@ function parseCliFlag(argument) {
109109
throw Error(message);
110110
}
111111
let value = parts.slice(1).join("=");
112-
if (flagName === "no-prefetch") value = "false";
112+
if (flagName.startsWith("no-")) value = "false";
113113
else if (value === "") value = "true";
114114
cliParams.set(CLI_PARAMS[flagName].param, value);
115115
}
116116

117117

118+
const printHelp = cliParams.delete("help");
119+
const dumpTestList = cliParams.delete("dumpTestList");
120+
118121
if (cliArgs.length) {
119122
let tests = cliParams.has("test") ? cliParams.get("tests").split(",") : []
120123
tests = tests.concat(cliArgs);
@@ -126,7 +129,6 @@ if (cliParams.size)
126129

127130
load("./utils/params.js");
128131

129-
130132
async function runJetStream() {
131133
try {
132134
await JetStream.initialize();
@@ -169,10 +171,11 @@ function help(message=undefined) {
169171
}
170172
}
171173

172-
if (cliParams.has("help")) {
174+
175+
if (printHelp) {
173176
help();
174-
} else if (cliParams.has("dumpTestList")) {
175-
JetStream.dumpTestList();
177+
} else if (dumpTestList) {
178+
JetStream.dumpTestList();
176179
} else {
177-
runJetStream();
180+
runJetStream();
178181
}

tests/run-shell.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ const TESTS = [
4444
return runTest("UnitTests", () => sh(shell_binary, UNIT_TEST_PATH));
4545
},
4646
},
47+
{
48+
name: "CLI Help",
49+
tags: ["all", "main", "help"],
50+
run(shell_binary) {
51+
return runCLITest("Cli Help", shell_binary, "--help");
52+
},
53+
},
4754
{
4855
name: "Single Suite",
4956
tags: ["all", "main", "single"],

utils/params.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class Params {
4545
RAMification = false;
4646
forceGC = false;
4747
dumpJSONResults = false;
48-
dumpTestList = false;
4948
// Override iteration and worst-case counts per workload.
5049
// Example:
5150
// testIterationCountMap = { "acorn-wtb": 5 };
@@ -70,7 +69,6 @@ class Params {
7069
this.RAMification = this._parseBooleanParam(sourceParams, "RAMification");
7170
this.dumpJSONResults = this._parseBooleanParam(sourceParams, "dumpJSONResults");
7271
this.groupDetails = this._parseBooleanParam(sourceParams, "groupDetails");
73-
this.dumpTestList = this._parseBooleanParam(sourceParams, "dumpTestList");
7472
this.forceGC = this._parseBooleanParam(sourceParams, "forceGC");
7573

7674
this.customPreIterationCode = this._parseStringParam(sourceParams, "customPreIterationCode");

0 commit comments

Comments
 (0)