Repository navigation
Stop using @itwin/presentation-testing - #1670
Merged
Merged
Conversation
…-performance-tests`
…win/tree-widget-react`
Contributor
There was a problem hiding this comment.
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-testinginitialization and iModel-building helpers withtest-utilitiesequivalents acrosstree-widget,learning-snippets, andperformance-tests. - Introduce
initializeCore/terminateCoreplus Snapshot-based iModel helpers inpackages/itwin/test-utilities. - Drop
@itwin/presentation-testingfrom package manifests/locks and addtest-utilitiesworkspace 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.
aruniverse
approved these changes
May 4, 2026
Contributor
There was a problem hiding this comment.
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.
JonasDov
reviewed
May 5, 2026
JonasDov
reviewed
May 5, 2026
JonasDov
approved these changes
May 5, 2026
Co-authored-by: JonasDov <100586436+JonasDov@users.noreply.github.com>
6 tasks done
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A step towards deprecating
@itwin/presentation-testingpackage, part of iTwin/presentation#1320.