Skip to content

Commit d9ee876

Browse files
authored
Merge customTestList and testList (#100)
- Only use globalThis.testList - Use more consistent globalThis access - Simplify benchmark params initialisation in shell-config.js
1 parent 0b92f93 commit d9ee876

File tree

2 files changed

+14
-24
lines changed

2 files changed

+14
-24
lines changed

JetStreamDriver.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ globalThis.testIterationCountMap ??= new Map();
3737
globalThis.testWorstCaseCount ??= undefined;
3838
globalThis.testWorstCaseCountMap ??= new Map();
3939
globalThis.dumpJSONResults ??= false;
40-
globalThis.customTestList ??= [];
40+
globalThis.testList ??= undefined;
4141
globalThis.startDelay ??= undefined;
4242

4343
let shouldReport = false;
@@ -53,8 +53,8 @@ function getIntParam(urlParams, key) {
5353
}
5454

5555
function getTestListParam(urlParams, key) {
56-
if (globalThis.customTestList.length)
57-
throw new Error(`Overriding previous customTestList=${globalThis.customTestList.join()} with ${key} url-parameter.`);
56+
if (globalThis.testList?.length)
57+
throw new Error(`Overriding previous testList=${globalThis.testList.join()} with ${key} url-parameter.`);
5858
return urlParams.getAll(key);
5959
}
6060

@@ -65,9 +65,9 @@ if (typeof(URLSearchParams) !== "undefined") {
6565
if (shouldReport && !globalThis.startDelay)
6666
globalThis.startDelay = 4000;
6767
if (urlParameters.has("tag"))
68-
customTestList = getTestListParam(urlParameters, "tag");
68+
globalThis.testList = getTestListParam(urlParameters, "tag");
6969
if (urlParameters.has("test"))
70-
customTestList = getTestListParam(urlParameters, "test");
70+
globalThis.testList = getTestListParam(urlParameters, "test");
7171
globalThis.testIterationCount = getIntParam(urlParameters, "iterationCount");
7272
globalThis.testWorstCaseCount = getIntParam(urlParameters, "worstCaseCount");
7373
}
@@ -93,8 +93,8 @@ function displayCategoryScores() {
9393
function getIterationCount(plan) {
9494
if (testIterationCountMap.has(plan.name))
9595
return testIterationCountMap.get(plan.name);
96-
if (testIterationCount)
97-
return testIterationCount;
96+
if (globalThis.testIterationCount)
97+
return globalThis.testIterationCount;
9898
if (plan.iterations)
9999
return plan.iterations;
100100
return defaultIterationCount;
@@ -103,8 +103,8 @@ function getIterationCount(plan) {
103103
function getWorstCaseCount(plan) {
104104
if (testWorstCaseCountMap.has(plan.name))
105105
return testWorstCaseCountMap.get(plan.name);
106-
if (testWorstCaseCount)
107-
return testWorstCaseCount;
106+
if (globalThis.testWorstCaseCount)
107+
return globalThis.testWorstCaseCount;
108108
if (plan.worstCaseCount)
109109
return plan.worstCaseCount;
110110
return defaultWorstCaseCount;
@@ -2370,10 +2370,8 @@ const defaultDisabledTags = [];
23702370
if (!isInBrowser)
23712371
defaultDisabledTags.push("WorkerTests");
23722372

2373-
if (typeof testList !== "undefined") {
2374-
processTestList(testList);
2375-
} else if (customTestList.length) {
2376-
processTestList(customTestList);
2373+
if (globalThis.testList?.length) {
2374+
processTestList(globalThis.testList);
23772375
} else {
23782376
globalThis.JetStream.enableBenchmarksByTag("Default", defaultDisabledTags)
23792377
}

shell-config.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,8 @@ if (isSpiderMonkey) {
3737
globalThis.readFile = readRelativeToScript;
3838
globalThis.arguments = scriptArgs;
3939
}
40-
41-
if (typeof arguments !== "undefined" && arguments.length > 0)
42-
testList = arguments.slice();
43-
if (typeof testList === "undefined")
44-
testList = undefined;
45-
46-
if (typeof testIterationCount === "undefined")
47-
testIterationCount = undefined;
40+
if (globalThis.arguments?.length)
41+
globalThis.testList = globalThis.arguments.slice();
4842

4943
if (typeof runMode !== "undefined" && runMode == "RAMification")
50-
RAMification = true;
51-
else
52-
RAMification = false;
44+
globalThis.RAMification = true;

0 commit comments

Comments
 (0)