Skip to content

Commit a87c7ab

Browse files
committed
disable WorkerTests in shells
1 parent c375613 commit a87c7ab

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

JetStreamDriver.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,14 @@ class Benchmark {
643643
}
644644
get isSuccess() { return this._state = BenchmarkState.DONE; }
645645

646+
hasTag(...tags) {
647+
for (tag of tags) {
648+
if (this.tags.has(tag))
649+
return true;
650+
}
651+
return false;
652+
}
653+
646654
get runnerCode() {
647655
return `
648656
let __benchmark = new Benchmark(${this.iterations});
@@ -2334,7 +2342,7 @@ function enableBenchmarksByName(name)
23342342
JetStream.addBenchmark(benchmark);
23352343
}
23362344

2337-
function enableBenchmarksByTag(tag)
2345+
function enableBenchmarksByTag(tag, excludeTags)
23382346
{
23392347
const benchmarks = benchmarksByTag.get(tag);
23402348

@@ -2343,10 +2351,14 @@ function enableBenchmarksByTag(tag)
23432351
throw new Error(`Couldn't find tag named: ${tag}.\n Choices are ${validTags}`);
23442352
}
23452353

2346-
for (const benchmark of benchmarks)
2354+
for (const benchmark of benchmarks) {
2355+
if (excludeTags && benchmark.hasTag(...excludeTags))
2356+
continue
23472357
JetStream.addBenchmark(benchmark);
2358+
}
23482359
}
23492360

2361+
23502362
function processTestList(testList)
23512363
{
23522364
let benchmarkNames = [];
@@ -2364,10 +2376,14 @@ function processTestList(testList)
23642376
}
23652377
}
23662378

2379+
const defaultDisabledTags = [];
2380+
if (!!isInBrowser)
2381+
defaultDisabledTags = ["WorkerTests"];
2382+
23672383
if (typeof testList !== "undefined") {
23682384
processTestList(testList);
23692385
} else if (customTestList.length) {
23702386
processTestList(customTestList);
23712387
} else {
2372-
enableBenchmarksByTag("default")
2388+
enableBenchmarksByTag("default", defaultDisabledTags)
23732389
}

0 commit comments

Comments
 (0)