Skip to content

Commit 0dc0b1c

Browse files
authored
Make the progress bar track indivisual suites, not indivisual steps. (#465)
This is needed to allow for remote workloads.
1 parent e2e3c49 commit 0dc0b1c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

resources/main.mjs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@ class MainBenchmarkClient {
9393
this._isRunning = true;
9494

9595
const enabledSuites = Suites.filter((suite) => !suite.disabled);
96-
const totalSubtestsCount = enabledSuites.reduce((testsCount, suite) => {
97-
return testsCount + suite.tests.length;
98-
}, 0);
99-
this.stepCount = params.iterationCount * totalSubtestsCount;
96+
const totalSuitesCount = enabledSuites.length;
97+
this.stepCount = params.iterationCount * totalSuitesCount;
10098
this._progressCompleted.max = this.stepCount;
10199
this.suitesCount = enabledSuites.length;
102100
const runner = new BenchmarkRunner(Suites, this);
@@ -121,7 +119,7 @@ class MainBenchmarkClient {
121119
await this._awaitNextStep(suite, test);
122120
}
123121

124-
didRunTest() {
122+
didFinishSuite() {
125123
this._finishedTestCount++;
126124
this._progressCompleted.value = this._finishedTestCount;
127125
}

resources/suite-runner.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export class SuiteRunner {
6060

6161
performance.measure(`suite-${suiteName}`, suiteStartLabel, suiteEndLabel);
6262
this._validateSuiteTotal();
63+
if (this.#client?.didFinishSuite)
64+
await this.#client.didFinishSuite(this.#suite);
6365
}
6466

6567
_validateSuiteTotal() {

0 commit comments

Comments
 (0)