Skip to content

Migrate weekly performance tests to Vitest - #358

Merged
DanRod1999 merged 5 commits into
mainfrom
danrod1999-weekly-performance-vitest
Jul 29, 2026
Merged

Migrate weekly performance tests to Vitest#358
DanRod1999 merged 5 commits into
mainfrom
danrod1999-weekly-performance-vitest

Conversation

@DanRod1999

@DanRod1999 DanRod1999 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • migrate the weekly performance regression suite from Mocha to serialized Vitest execution
  • remove performance-tests ownership of Mocha, @types/mocha, Chai 4, and ts-node
  • preserve the weekly report and authentication contracts

New test helpers

These helpers are not required by Vitest. They make behavior that was embedded in the previous Mocha suite explicit and independently testable:

  • Cleanup.ts guarantees that every registered teardown task is attempted, including database closure, report export, IModelHost shutdown, and authorization sign-out. If the operation and cleanup both fail, it preserves both errors instead of allowing teardown to hide the primary failure.
  • RegressionTestRegistration.ts constructs the supported test-case/transformer-module combinations synchronously before Vitest registers tests. It skips modules that do not implement the operation required by a test case, preserving the old conditional Mocha registration behavior without asynchronous collection callbacks.
  • Cleanup.test.ts and RegressionTestRegistration.test.ts provide focused, non-credentialed coverage for those behaviors.

This PR targets main and is intended as the new bottom layer beneath the existing quick-performance PRs #353, #354, #356, and #357. It does not modify those branches or their stack metadata.

Validation

  • pnpm --dir packages/transformer build
  • pnpm --dir packages/performance-tests build
  • pnpm --dir packages/performance-tests lint
  • CI=true pnpm --dir packages/performance-tests exec vitest run test/unit/Cleanup.test.ts test/unit/RegressionTestRegistration.test.ts (4 tests passed)
  • verified the performance-tests manifest and lockfile importer no longer declare Mocha, @types/mocha, Chai 4, or ts-node

The credentialed Hub-backed weekly runtime suite was intentionally not run locally. Hosted weekly Azure validation remains deferred, consistent with the source migration handoff.

generated with GPT-5.6 Sol

Replace Mocha delayed registration with serialized Vitest collection and explicit worker lifecycle cleanup while preserving the weekly report and authentication contracts.

Validated transformer build, performance test type-check, lint, and focused cleanup/registration tests. The credentialed suite has not been executed locally; live Bentley Hub runtime behavior remains to be validated by the weekly ADO pipeline.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@DanRod1999
DanRod1999 requested review from a team as code owners July 29, 2026 02:14
@hl662

hl662 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Can you have one perf pipeline run against this branch? To verify things work and that we don't have to do any updates in our internal repo's yaml

@hl662 hl662 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fluff out either the README.md for the performance tests, or have a separate ARCHITECTURE.md for the performance tests package (i think the latter). Seems like we'll have to explain a high level overview of how our perf tests are structured and setup at the end of our stacked PRs

Comment thread packages/performance-tests/test/TransformerRegression.test.ts Outdated
Comment thread packages/performance-tests/vitest.config.ts Outdated
Comment thread packages/performance-tests/vitest.config.ts Outdated
Comment thread packages/performance-tests/test/TransformerRegression.test.ts Outdated
DanRod1999 and others added 4 commits July 29, 2026 15:39
Keep credential loading in the Hub-backed regression suite so local helper unit tests run without CI or a .env file.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use IModelHost validity for partial-startup cleanup and keep unlimited timeouts local to the credentialed weekly regression file.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Rely on Vitest's per-test reporting instead of emitting an unstructured completion message.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Explain the weekly regression lifecycle, helper unit tests, registration matrix, cleanup, reporting contract, and extension boundaries.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@hl662 hl662 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, let's get this in and move on to next parts

@DanRod1999
DanRod1999 merged commit e1bd206 into main Jul 29, 2026
14 checks passed
@DanRod1999
DanRod1999 deleted the danrod1999-weekly-performance-vitest branch July 29, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants