Skip to content

Commit

Permalink
Make the progress bar track indivisual suites, not indivisual steps.
Browse files Browse the repository at this point in the history
This is needed to allow for remote workloads.
  • Loading branch information
rniwa committed Dec 17, 2024
1 parent e2e3c49 commit 49e10ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 3 additions & 5 deletions resources/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ class MainBenchmarkClient {
this._isRunning = true;

const enabledSuites = Suites.filter((suite) => !suite.disabled);
const totalSubtestsCount = enabledSuites.reduce((testsCount, suite) => {
return testsCount + suite.tests.length;
}, 0);
this.stepCount = params.iterationCount * totalSubtestsCount;
const totalSuitesCount = enabledSuites.length;
this.stepCount = params.iterationCount * totalSuitesCount;
this._progressCompleted.max = this.stepCount;
this.suitesCount = enabledSuites.length;
const runner = new BenchmarkRunner(Suites, this);
Expand All @@ -121,7 +119,7 @@ class MainBenchmarkClient {
await this._awaitNextStep(suite, test);
}

didRunTest() {
didFinishSuite() {
this._finishedTestCount++;
this._progressCompleted.value = this._finishedTestCount;
}
Expand Down
2 changes: 2 additions & 0 deletions resources/suite-runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export class SuiteRunner {

performance.measure(`suite-${suiteName}`, suiteStartLabel, suiteEndLabel);
this._validateSuiteTotal();
if (this.#client?.didFinishSuite)
await this.#client.didFinishSuite(this.#suite);
}

_validateSuiteTotal() {
Expand Down

0 comments on commit 49e10ed

Please sign in to comment.