Skip to content

Stop using @itwin/presentation-testing - #1670

Merged
grigasp merged 19 commits into
masterfrom
stop-using-presentation-testing
May 5, 2026
Merged

grigasp merged 19 commits into
masterfrom
stop-using-presentation-testing

Conversation

@grigasp

@grigasp grigasp commented May 4, 2026

Copy link
Copy Markdown
Member

A step towards deprecating @itwin/presentation-testing package, part of iTwin/presentation#1320.

Copilot AI review requested due to automatic review settings May 4, 2026 08:58
@grigasp
grigasp requested review from a team as code owners May 4, 2026 08:58

Copilot AI 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.

Pull request overview

This PR removes usage of @itwin/presentation-testing by migrating affected test suites and helpers to a new workspace test-utilities package, as part of deprecating @itwin/presentation-testing (ref: presentation/#1320).

Changes:

  • Replace @itwin/presentation-testing initialization and iModel-building helpers with test-utilities equivalents across tree-widget, learning-snippets, and performance-tests.
  • Introduce initializeCore/terminateCore plus Snapshot-based iModel helpers in packages/itwin/test-utilities.
  • Drop @itwin/presentation-testing from package manifests/locks and add test-utilities workspace dependency where needed.

Reviewed changes

Copilot reviewed 39 out of 46 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/itwin/tree-widget/src/test/trees/models-tree/Utils.ts Renames provider factory prop to imodelConnection and wires through to iModel access creation.
packages/itwin/tree-widget/src/test/trees/models-tree/UseModelsTree.test.tsx Switches test setup and iModel creation/inserts to test-utilities and initializeCore.
packages/itwin/tree-widget/src/test/trees/models-tree/ModelsTreeHierarchyLevelFiltering.test.ts Migrates initialization and iModel setup helpers from presentation-testing to test-utilities.
packages/itwin/tree-widget/src/test/trees/imodel-content-tree/IModelContentTreeDefinition.test.ts Updates tests to use initializeCore and test-utilities iModel helpers.
packages/itwin/tree-widget/src/test/trees/external-sources-tree/ExternalSourcesTreeDefinition.test.tsx Reworks root external source insertion to use IModelDb APIs and Code, and migrates initialization to test-utilities.
packages/itwin/tree-widget/src/test/trees/categories-tree/CategoriesTreeFiltering.test.ts Migrates hierarchy-filtering tests to test-utilities initialization and insert helpers.
packages/itwin/tree-widget/src/test/trees/categories-tree/CategoriesTreeDefinition.test.ts Migrates categories tree tests to test-utilities initialization and insert helpers.
packages/itwin/tree-widget/src/test/trees/CategoriesVisibilityUtils.test.ts Uses test-utilities initialization and insert helpers for visibility tests.
packages/itwin/tree-widget/src/test/IModelUtils.ts Replaces local Mocha iModel builder logic with test-utilities buildIModel + importSchema and returns imodelConnection.
packages/itwin/tree-widget/pnpm-lock.yaml Removes @itwin/presentation-testing and adds test-utilities workspace dependency snapshot.
packages/itwin/tree-widget/package.json Drops @itwin/presentation-testing and adds test-utilities devDependency.
packages/itwin/test-utilities/src/test-utilities/PathUtils.ts Adds output-path + filename sanitization utilities for test-generated iModels.
packages/itwin/test-utilities/src/test-utilities/Initialize.ts Adds shared backend/frontend Presentation + RPC initialization (initializeCore/terminateCore).
packages/itwin/test-utilities/src/test-utilities/IModelUtils.ts Adds SnapshotDb-based buildIModel, schema import, and element/model insert helpers for tests.
packages/itwin/test-utilities/src/test-utilities.ts Exposes Initialize exports at the package entrypoint.
packages/itwin/test-utilities/package.json Defines runtime deps/peerDeps for the new shared test-utilities package.
apps/performance-tests/src/setup.ts Migrates vitest setup to initializeCore/terminateCore from test-utilities.
apps/performance-tests/package.json Updates devDependencies to support test-utilities-based setup.
apps/learning-snippets/src/utils/InitializationUtils.ts Migrates vitest init/teardown to initializeCore/terminateCore and passes testOutputDir.
apps/learning-snippets/src/utils/IModelUtils.ts Switches schema import + named iModel creation to test-utilities.
apps/learning-snippets/src/test/tree-widget/Usage.test.tsx Uses test-utilities insert helpers and updated buildIModel return shape (imodelConnection).
apps/learning-snippets/src/test/tree-widget/Telemetry.test.tsx Uses test-utilities insert helpers and updated buildIModel return shape (imodelConnection).
apps/learning-snippets/src/test/tree-widget/SubTreePaths.test.tsx Uses test-utilities insert helpers and updated buildIModel return shape (imodelConnection).
apps/learning-snippets/src/test/tree-widget/ModelsTree.test.tsx Uses test-utilities insert helpers and updated buildIModel return shape (imodelConnection).
apps/learning-snippets/src/test/tree-widget/IModelContentTree.test.tsx Uses test-utilities insert helpers and updated buildIModel return shape (imodelConnection).
apps/learning-snippets/src/test/tree-widget/GetSchemaContext.test.tsx Uses test-utilities insert helpers and updated buildIModel return shape (imodelConnection).
apps/learning-snippets/src/test/tree-widget/FilteredPaths.test.tsx Uses test-utilities insert helpers and updated buildIModel return shape (imodelConnection).
apps/learning-snippets/src/test/tree-widget/CustomVisibilityTree.test.tsx Uses test-utilities insert helpers and updated buildIModel return shape (imodelConnection).
apps/learning-snippets/src/test/tree-widget/CustomTree.test.tsx Uses test-utilities insert helpers and updated buildIModel return shape (imodelConnection).
apps/learning-snippets/src/test/tree-widget/CategoriesTree.test.tsx Uses test-utilities insert helpers and updated buildIModel return shape (imodelConnection).
apps/learning-snippets/src/test/quantity-formatting/QuantityFormatPanel.test.tsx Updates assertions to wait for async rendering via waitFor.
apps/learning-snippets/src/test/quantity-formatting/FormatSetSelector.test.tsx Updates assertions to wait for async rendering via waitFor.
apps/learning-snippets/src/test/quantity-formatting/FormatSetPanel.test.tsx Updates assertions to wait for async rendering via waitFor.
apps/learning-snippets/src/test/quantity-formatting/FormatSelector.test.tsx Updates assertions to wait for async rendering via waitFor.
apps/learning-snippets/src/test/property-grid/Telemetry.test.tsx Migrates insert helpers to test-utilities and updates iModel connection variable usage.
apps/learning-snippets/src/test/property-grid/SettingMenuItem.test.tsx Migrates insert helpers to test-utilities and updates iModel connection variable usage.
apps/learning-snippets/src/test/property-grid/ContextMenuItem.test.tsx Migrates insert helpers to test-utilities and updates iModel connection variable usage.
apps/learning-snippets/pnpm-lock.yaml Removes @itwin/presentation-testing and adds test-utilities workspace dependency snapshot.
apps/learning-snippets/package.json Drops @itwin/presentation-testing, adds test-utilities, and removes no-longer-needed direct deps.
Files not reviewed (4)
  • apps/learning-snippets/pnpm-lock.yaml: Language not supported
  • apps/performance-tests/pnpm-lock.yaml: Language not supported
  • packages/itwin/test-utilities/pnpm-lock.yaml: Language not supported
  • packages/itwin/tree-widget/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions Bot 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.

Tree-Widget benchmark

Benchmark suite Current: f289944 Previous: b54a5de Deviation Status
models tree creates initial filtered view for 50k target items 999 ms 1028 ms -2.82% 〰️
models tree creates initial filtered view for 50k target items (P95 of main thread blocks) 113 ms 125 ms -9.60% 〰️
models tree validates categories visibility for imodel with 50k categories 12563 ms 12140 ms 3.48% 〰️
models tree validates categories visibility for imodel with 50k categories (P95 of main thread blocks) 87 ms 96 ms -9.38% 〰️
models tree changing model visibility changes visibility for 50k elements 4133 ms 3972 ms 4.05% 〰️
models tree changing model visibility changes visibility for 50k elements (P95 of main thread blocks) 65 ms 72 ms -9.72% 〰️
models tree changing category visibility changes visibility for 50k elements 4019 ms 3814 ms 5.37% 〰️
models tree changing category visibility changes visibility for 50k elements (P95 of main thread blocks) 41 ms 56 ms -26.79% 〰️
models tree changing per-model-category override changes visibility for 50k elements 3973 ms 3988 ms -0.38% 〰️
models tree changing per-model-category override changes visibility for 50k elements (P95 of main thread blocks) 27 ms 99 ms -72.73% ✅
models tree changing element visibility changes only parent nodes visibility with 50k elements 5846 ms 5057 ms 15.60% 🚨
models tree changing element visibility changes only parent nodes visibility with 50k elements (P95 of main thread blocks) 119 ms 99 ms 20.20% 〰️
categories tree creates initial filtered view for 50k items 1412 ms 1426 ms -0.98% 〰️
categories tree creates initial filtered view for 50k items (P95 of main thread blocks) 286 ms 277 ms 3.25% 〰️
categories tree changing definition container visibility changes visibility for 50k subCategories 2969 ms 2884 ms 2.95% 〰️
categories tree changing definition container visibility changes visibility for 50k subCategories (P95 of main thread blocks) 44 ms 37 ms 18.92% 〰️
categories tree changing definition container visibility changes visibility for 50k categories 5898 ms 5751 ms 2.56% 〰️
categories tree changing definition container visibility changes visibility for 50k categories (P95 of main thread blocks) 115 ms 126 ms -8.73% 〰️

This comment was automatically generated by workflow using github-action-benchmark.

Comment thread apps/performance-tests/package.json Resolved
grigasp and others added 2 commits May 5, 2026 09:49
@grigasp
grigasp merged commit a0b632e into master May 5, 2026
14 checks passed
@grigasp
grigasp deleted the stop-using-presentation-testing branch May 5, 2026 09:39
@grigasp grigasp linked an issue May 5, 2026 that may be closed by this pull request
6 tasks done
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.

presentation-testing: Deprecation plan

4 participants