From 6e184cd8e6b5be766ac6a511bb0e12b83d0e06b4 Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Sun, 29 Jan 2023 08:48:02 -0500 Subject: [PATCH 01/19] Update template path --- common/config/azure-pipelines/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/azure-pipelines/ci.yaml b/common/config/azure-pipelines/ci.yaml index cdd32198bb7b..5f46a27d84d0 100644 --- a/common/config/azure-pipelines/ci.yaml +++ b/common/config/azure-pipelines/ci.yaml @@ -58,7 +58,7 @@ jobs: steps: - checkout: self - - template: ../templates/core-build.yaml + - template: ./templates/core-build.yaml parameters: name: Node_18 nodeVersion: 18.12.x From 8a3e8f9959f472601670e18c1221e6414bd7a920 Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Sun, 29 Jan 2023 08:49:25 -0500 Subject: [PATCH 02/19] fix use of template --- common/config/azure-pipelines/ci.yaml | 3 --- common/config/azure-pipelines/templates/core-build.yaml | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/common/config/azure-pipelines/ci.yaml b/common/config/azure-pipelines/ci.yaml index 5f46a27d84d0..bccbd334900f 100644 --- a/common/config/azure-pipelines/ci.yaml +++ b/common/config/azure-pipelines/ci.yaml @@ -60,7 +60,4 @@ jobs: - checkout: self - template: ./templates/core-build.yaml parameters: - name: Node_18 nodeVersion: 18.12.x - pool: - vmImage: $(OS) diff --git a/common/config/azure-pipelines/templates/core-build.yaml b/common/config/azure-pipelines/templates/core-build.yaml index 6b3d8ea4dcbd..3cf021a5cfb4 100644 --- a/common/config/azure-pipelines/templates/core-build.yaml +++ b/common/config/azure-pipelines/templates/core-build.yaml @@ -1,6 +1,8 @@ # This defines the core steps for building and validating iTwin.js Core parameters: + - name: nodeVersion + - name: workingDir type: string default: $(System.DefaultWorkingDirectory) @@ -10,8 +12,6 @@ parameters: - name: buildIos type: boolean default: false - - name: nodeVersion - default: "" - name: currentBranch default: $(Build.SourceBranch) - name: targetBranch From 5ed69b490bc15d8687a0c29ca116bc70fcb26a43 Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Sun, 29 Jan 2023 09:02:44 -0500 Subject: [PATCH 03/19] clean up variables --- common/config/azure-pipelines/ci.yaml | 16 +----- .../config/azure-pipelines/jobs/fast-ci.yaml | 7 +-- .../azure-pipelines/templates/core-build.yaml | 3 +- .../templates/integration-test-steps.yaml | 20 ++++---- .../templates/publish-test-results.yaml | 50 +++++++++---------- 5 files changed, 40 insertions(+), 56 deletions(-) diff --git a/common/config/azure-pipelines/ci.yaml b/common/config/azure-pipelines/ci.yaml index bccbd334900f..f3431b44d58e 100644 --- a/common/config/azure-pipelines/ci.yaml +++ b/common/config/azure-pipelines/ci.yaml @@ -25,28 +25,14 @@ schedules: jobs: - job: - variables: - - name: linuxPool - value: "iModeljs Linux" - - name: mac_pool - value: iModelTechCI - - name: win_pool - value: iModelTechCI - strategy: matrix: "Windows_Node_18": OS: windows-latest - platform: Windows_NT - name: $(win_pool) "Linux_Node_18": OS: ubuntu-latest - platform: Linux - name: $(linux_pool) "MacOS_Node_18": OS: macOS-latest - platform: Darwin - name: $(mac_pool) pool: vmImage: $(OS) @@ -60,4 +46,4 @@ jobs: - checkout: self - template: ./templates/core-build.yaml parameters: - nodeVersion: 18.12.x + nodeVersion: 18.x diff --git a/common/config/azure-pipelines/jobs/fast-ci.yaml b/common/config/azure-pipelines/jobs/fast-ci.yaml index 89ea7d3674af..de0d1383bd43 100644 --- a/common/config/azure-pipelines/jobs/fast-ci.yaml +++ b/common/config/azure-pipelines/jobs/fast-ci.yaml @@ -32,15 +32,12 @@ jobs: strategy: matrix: "Windows_Node_18": - OS: windows-latest platform: Windows_NT name: $(win_pool) "Linux_Node_18": - OS: ubuntu-latest platform: Linux name: $(linux_pool) "MacOS_Node_18": - OS: macOS-latest platform: Darwin name: $(mac_pool) @@ -59,11 +56,11 @@ jobs: clean: true - template: ../templates/core-build.yaml parameters: - nodeVersion: 18.12.x + nodeVersion: 18.x buildIos: ${{ eq(variables['Agent.OS'], 'Darwin') }} # Will run if even there is a failure somewhere else in the pipeline. - template: ../templates/publish-test-results.yaml parameters: - NodeVersion: 18.12.x + nodeVersion: 18.x # The publish script identifies any new packages not previously published and tags the build - template: ../templates/publish.yaml diff --git a/common/config/azure-pipelines/templates/core-build.yaml b/common/config/azure-pipelines/templates/core-build.yaml index 3cf021a5cfb4..242b717d4ffa 100644 --- a/common/config/azure-pipelines/templates/core-build.yaml +++ b/common/config/azure-pipelines/templates/core-build.yaml @@ -1,7 +1,8 @@ # This defines the core steps for building and validating iTwin.js Core parameters: - - name: nodeVersion + - name: nodeVersion # name of the parameter; required + type: string # data type of the parameter; required - name: workingDir type: string diff --git a/common/config/azure-pipelines/templates/integration-test-steps.yaml b/common/config/azure-pipelines/templates/integration-test-steps.yaml index ccafd232a4b9..1dc06ac4669e 100644 --- a/common/config/azure-pipelines/templates/integration-test-steps.yaml +++ b/common/config/azure-pipelines/templates/integration-test-steps.yaml @@ -1,5 +1,5 @@ parameters: - - name: Node_Version # name of the parameter; required + - name: nodeVersion # name of the parameter; required type: string # data type of the parameter; required steps: @@ -10,9 +10,9 @@ steps: - template: setup-integration-users.yaml - task: NodeTool@0 - displayName: "Use Node ${{ parameters.Node_Version }}" + displayName: "Use Node ${{ parameters.nodeVersion }}" inputs: - versionSpec: "${{ parameters.Node_Version }}" + versionSpec: "${{ parameters.nodeVersion }}" checkLatest: true - script: "git config --local user.email imodeljs-admin@users.noreply.github.com" @@ -93,7 +93,7 @@ steps: displayName: "Publish Backend Test Results" inputs: testResultsFiles: "full-stack-tests/backend/lib/test/junit_results.xml" - testRunTitle: "Core - Backend Tests - ${{ parameters.Node_Version }}" + testRunTitle: "Core - Backend Tests - ${{ parameters.nodeVersion }}" continueOnError: true condition: succeededOrFailed() @@ -101,40 +101,40 @@ steps: displayName: "Publish Core Integration Test Results" inputs: testResultsFiles: "full-stack-tests/core/lib/test/junit_results.xml" - testRunTitle: "Core - Integration Tests - ${{ parameters.Node_Version }}" + testRunTitle: "Core - Integration Tests - ${{ parameters.nodeVersion }}" condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish ECSchema Rpc Interface Integration Test Results" inputs: testResultsFiles: "full-stack-tests/ecschema-rpc-interface/ecschema-rpcinterface-tests-result/ecschema-rpcinterface-tests-result.xml" - testRunTitle: "ECSchema Rpc Interface - Integration Tests - ${{ parameters.Node_Version }}" + testRunTitle: "ECSchema Rpc Interface - Integration Tests - ${{ parameters.nodeVersion }}" condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish RPC Full Stack Test Results" inputs: testResultsFiles: "full-stack-tests/rpc/lib/test/junit_results.xml" - testRunTitle: "RPC Full Stack - ${{ parameters.Node_Version }}" + testRunTitle: "RPC Full Stack - ${{ parameters.nodeVersion }}" condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Rpc Interface Integration Test Results" inputs: testResultsFiles: "full-stack-tests/rpc-interface/full_stack_test_results/full_stack_test_result.xml" - testRunTitle: "Rpc Interface - Integration Tests - ${{ parameters.Node_Version }}" + testRunTitle: "Rpc Interface - Integration Tests - ${{ parameters.nodeVersion }}" condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Presentation Integration Test Results" inputs: testResultsFiles: full-stack-tests/presentation/lib/test/junit_results.xml - testRunTitle: "Presentation - Integration Tests - ${{ parameters.Node_Version }}" + testRunTitle: "Presentation - Integration Tests - ${{ parameters.nodeVersion }}" condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Electron Test Results" inputs: testResultsFiles: core/electron/lib/test/*_junit_results.xml - testRunTitle: "Core - Electron Tests - ${{ parameters.Node_Version }}" + testRunTitle: "Core - Electron Tests - ${{ parameters.nodeVersion }}" condition: succeededOrFailed() diff --git a/common/config/azure-pipelines/templates/publish-test-results.yaml b/common/config/azure-pipelines/templates/publish-test-results.yaml index 2311b9b20e1d..5ffcd0de83d3 100644 --- a/common/config/azure-pipelines/templates/publish-test-results.yaml +++ b/common/config/azure-pipelines/templates/publish-test-results.yaml @@ -1,5 +1,5 @@ parameters: - - name: NodeVersion # name of the parameter; required + - name: nodeVersion # name of the parameter; required type: string # data type of the parameter; required - name: workingDir type: string @@ -13,63 +13,63 @@ steps: displayName: "Publish Backend Test Results" inputs: testResultsFiles: "core/backend/lib/test/junit_results.xml" - testRunTitle: "Core - Backend Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Core - Backend Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Bentley Test Results" inputs: testResultsFiles: "core/bentley/lib/test/junit_results.xml" - testRunTitle: "Core - Bentley Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Core - Bentley Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Common Backend Test Results" inputs: testResultsFiles: "core/common/lib/test/junit_results.xml" - testRunTitle: "Core - Common Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Core - Common Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish ECSchema Locaters Test Results" inputs: testResultsFiles: "core/ecschema-locaters/lib/test/junit_results.xml" - testRunTitle: "Core - ECSchema Locaters Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Core - ECSchema Locaters Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish ECSchema Metadata Test Results" inputs: testResultsFiles: "core/ecschema-metadata/lib/test/junit_results.xml" - testRunTitle: "Core - ECSchema Metadata Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Core - ECSchema Metadata Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Frontend Test Results" inputs: testResultsFiles: "core/frontend/lib/test/junit_results.xml" - testRunTitle: "Core - Frontend Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Core - Frontend Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Geometry Test Results" inputs: testResultsFiles: "core/geometry/lib/test/junit_results.xml" - testRunTitle: "Core - Geometry Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Core - Geometry Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish i18n Test Results" inputs: testResultsFiles: "core/i18n/lib/test/junit_results.xml" - testRunTitle: "Core - i18n Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Core - i18n Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Quantity Test Results" inputs: testResultsFiles: "core/quantity/lib/test/junit_results.xml" - testRunTitle: "Core - Quantity Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Core - Quantity Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() #------- @@ -79,35 +79,35 @@ steps: displayName: "Publish Presentation Backend Test Results" inputs: testResultsFiles: "presentation/backend/lib/test/junit_results.xml" - testRunTitle: "Presentation - Backend Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Presentation - Backend Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Presentation Common Test Results" inputs: testResultsFiles: "presentation/common/lib/test/junit_results.xml" - testRunTitle: "Presentation - Common Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Presentation - Common Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Presentation Components Test Results" inputs: testResultsFiles: "presentation/components/lib/test/junit_results.xml" - testRunTitle: "Presentation - Components Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Presentation - Components Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Presentation Frontend Test Results" inputs: testResultsFiles: "presentation/frontend/lib/test/junit_results.xml" - testRunTitle: "Presentation - Frontend Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Presentation - Frontend Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Presentation Testing Test Results" inputs: testResultsFiles: "presentation/testing/lib/test/junit_results.xml" - testRunTitle: "Presentation - Testing Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Presentation - Testing Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() @@ -118,35 +118,35 @@ steps: displayName: "Publish UI Abstract Test Results" inputs: testResultsFiles: "ui/abstract/lib/test/junit_results.xml" - testRunTitle: "UI - Abstract Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "UI - Abstract Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish UI Components Test Results" inputs: testResultsFiles: "ui/components/lib/test/junit_results.xml" - testRunTitle: "UI - Components Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "UI - Components Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish UI Core Test Results" inputs: testResultsFiles: "ui/core/lib/test/junit_results.xml" - testRunTitle: "UI - Core Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "UI - Core Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish UI Framework Test Results" inputs: testResultsFiles: "ui/framework/lib/test/junit_results.xml" - testRunTitle: "UI - Framework Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "UI - Framework Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish UI Ninezone Test Results" inputs: testResultsFiles: "ui/ninezone/lib/test/junit_results.xml" - testRunTitle: "UI - Ninezone Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "UI - Ninezone Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() @@ -157,21 +157,21 @@ steps: displayName: "Publish Core Full Stack Test Results" inputs: testResultsFiles: "full-stack-tests/core/lib/test/junit_results.xml" - testRunTitle: "Core Full Stack - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Core Full Stack - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Presentation Full Stack Test Results" inputs: testResultsFiles: "full-stack-tests/presentation/lib/test/junit_results.xml" - testRunTitle: "Presentation Full Stack - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Presentation Full Stack - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish RPC Full Stack Test Results" inputs: testResultsFiles: "full-stack-tests/rpc/lib/test/junit_results.xml" - testRunTitle: "RPC Full Stack - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "RPC Full Stack - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() @@ -182,14 +182,14 @@ steps: displayName: "Publish Example App" inputs: testResultsFiles: "example-code/app/lib/test/junit_results.xml" - testRunTitle: "Example Apps - App Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Example Apps - App Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() - task: PublishTestResults@2 displayName: "Publish Example Snippets" inputs: testResultsFiles: "example-code/snippets/lib/test/junit_results.xml" - testRunTitle: "Example Apps - Snippets Tests - $(Agent.OS) - ${{ parameters.NodeVersion }}" + testRunTitle: "Example Apps - Snippets Tests - $(Agent.OS) - ${{ parameters.nodeVersion }}" searchFolder: ${{ parameters.workingDir }} condition: succeededOrFailed() #------- From b4e796996b39227cc367441b550a683ed2a463b1 Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Sun, 29 Jan 2023 09:09:40 -0500 Subject: [PATCH 04/19] Regression test updates --- README.md | 4 ++-- .../azure-pipelines/jobs/regression-testing.yaml | 16 ++++++++-------- .../azure-pipelines/jobs/version-bump.yaml | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index aa0614ccf5c5..163f52cb5763 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Each package has its own **node_modules** directory that contains symbolic links ## Prerequisites - [Git](https://git-scm.com/) -- [Node](https://nodejs.org/en/):an installation of the latest security patch of Node 18. The Node installation also includes the **npm** package manager. +- [Node](https://nodejs.org/en/): an installation of the latest security patch of Node 18. The Node installation also includes the **npm** package manager. - [Rush](https://github.com/Microsoft/web-build-tools/wiki/Rush): to install `npm install -g @microsoft/rush` - [TypeScript](https://www.typescriptlang.org/): this is listed as a devDependency, so if you're building it from source, you will get it with `rush install`. - [Visual Studio Code](https://code.visualstudio.com/): an optional dependency, but the repository structure is optimized for its use @@ -49,7 +49,7 @@ For incremental builds, the `rush build` command can be used to only build packa 3. Ensure linting passes when run locally: `rush lint` 4. Locally commit changes: `git commit` (or use the Visual Studio Code user interface) 5. Repeat steps 1-4 until ready to push changes -6. Check for API signature changes: `rush extract-api`. This will update the signature files, located in `common/api`. __Note:__ before doing this, first do the following: +6. Check for API signature changes: `rush extract-api`. This will update the signature files, located in `common/api`. **Note:** before doing this, first do the following: - Be sure that your branch is up to date with the target branch (i.e. `git merge origin/master`) - Cleanup your build output: `rush clean` - Rebuild the project: `rush build` diff --git a/common/config/azure-pipelines/jobs/regression-testing.yaml b/common/config/azure-pipelines/jobs/regression-testing.yaml index 2a8cb039196e..570895ebc886 100644 --- a/common/config/azure-pipelines/jobs/regression-testing.yaml +++ b/common/config/azure-pipelines/jobs/regression-testing.yaml @@ -1,8 +1,8 @@ # iTwin.js Core Regression Testing Build # -# Tests all supported versions of iTwin.js on 3 main supported platforms; Windows 10, Ubuntu 20.04, and MacOS . +# Tests all supported versions of iTwin.js on 3 main supported platforms; Windows 10, Ubuntu 20.04, and MacOS. # -# Starts with the minimum version (currently 12.20.0) and then follows the tip of each subsequent minor version. +# Starts with the minimum version (currently 12.20.0) and then follows the tip of each subsequent major LTS (even-numbered) version. # # The current LTS is tested in all normal CI/PR builds so no need to test it here. @@ -28,21 +28,21 @@ jobs: strategy: matrix: - "Windows_Node_18": + "Windows_Node_18_12_0": OS: windows-latest platform: Windows_NT name: $(win_pool) - node_version: 18.x - "Linux_Node_18": + node_version: 18.12.0 + "Linux_Node_18_12_0": OS: ubuntu-latest platform: Linux name: $(linux_pool) - node_version: 18.x - "MacOS_Node_18": + node_version: 18.12.0 + "MacOS_Node_18_12_0": OS: macOS-latest platform: Darwin name: $(mac_pool) - node_version: 18.x + node_version: 18.12.0 "Windows_Node_16": OS: windows-latest diff --git a/common/config/azure-pipelines/jobs/version-bump.yaml b/common/config/azure-pipelines/jobs/version-bump.yaml index 91a7cda690df..cd5f24136dfc 100644 --- a/common/config/azure-pipelines/jobs/version-bump.yaml +++ b/common/config/azure-pipelines/jobs/version-bump.yaml @@ -46,9 +46,9 @@ jobs: - checkout: self - task: NodeTool@0 - displayName: Use Node 12.x + displayName: Use Node 18.x inputs: - versionSpec: 12.x + versionSpec: 18.x checkLatest: true - bash: | From ad747164e83e60ddae13e0d50fe963c4ed1a337e Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Sun, 29 Jan 2023 10:11:52 -0500 Subject: [PATCH 05/19] Fix node version of integration tests --- .../azure-pipelines/integration-pr-validation.yaml | 2 +- .../azure-pipelines/integration-validation.yaml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/config/azure-pipelines/integration-pr-validation.yaml b/common/config/azure-pipelines/integration-pr-validation.yaml index c6bf774a4b5f..fc7f0c025307 100644 --- a/common/config/azure-pipelines/integration-pr-validation.yaml +++ b/common/config/azure-pipelines/integration-pr-validation.yaml @@ -37,4 +37,4 @@ jobs: steps: - template: templates/integration-test-steps.yaml parameters: - Node_Version: 18.x + nodeVersion: 18.x diff --git a/common/config/azure-pipelines/integration-validation.yaml b/common/config/azure-pipelines/integration-validation.yaml index 844aa557f521..4cb2e12d0032 100644 --- a/common/config/azure-pipelines/integration-validation.yaml +++ b/common/config/azure-pipelines/integration-validation.yaml @@ -22,9 +22,9 @@ jobs: strategy: maxParallel: 3 matrix: - Linux_node_12_7: + Linux_node_12_22: imageName: ubuntu-latest - nodeVersion: 12.17.0 + nodeVersion: 12.22.0 Linux_node_12_x: imageName: ubuntu-latest nodeVersion: 12.x @@ -34,9 +34,9 @@ jobs: linux_node_16_x: imageName: ubuntu-latest nodeVersion: 16.x - Windows_node_12_7: + Windows_node_12_22: imageName: windows-latest - nodeVersion: 12.17.0 + nodeVersion: 12.22.0 Windows_node_12_x: imageName: windows-latest nodeVersion: 12.x @@ -46,9 +46,9 @@ jobs: Windows_node_16_x: imageName: windows-latest nodeVersion: 16.x - MacOS_node_12_7: + MacOS_node_12_22: imageName: macos-latest - nodeVersion: 12.17.0 + nodeVersion: 12.22.0 MacOS_node_12_x: imageName: macos-latest nodeVersion: 12.x @@ -63,4 +63,4 @@ jobs: steps: - template: templates/integration-test-steps.yaml parameters: - Node_Version: $(nodeVersion) + nodeVersion: $(nodeVersion) From 26a19403f9a3f0aa1b01d2997f61a384a2275054 Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Sun, 29 Jan 2023 10:24:23 -0500 Subject: [PATCH 06/19] Fix regression testing machine pool --- common/config/azure-pipelines/jobs/regression-testing.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/config/azure-pipelines/jobs/regression-testing.yaml b/common/config/azure-pipelines/jobs/regression-testing.yaml index 570895ebc886..ddccf417bac5 100644 --- a/common/config/azure-pipelines/jobs/regression-testing.yaml +++ b/common/config/azure-pipelines/jobs/regression-testing.yaml @@ -19,7 +19,7 @@ schedules: jobs: - job: variables: - - name: linuxPool + - name: linux_pool value: "iModeljs Linux" - name: mac_pool value: iModelTechCI @@ -110,6 +110,7 @@ jobs: maxParallel: 3 pool: + name: $(name) demands: - Agent.OS -equals $(platform) From f0cd2f90f409e2faeaea64e9f865fdd65cd15175 Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Sun, 29 Jan 2023 11:17:44 -0500 Subject: [PATCH 07/19] Fix uses of fs.rmSync for Node 12 compatibility --- .../integration-client-regression-pr-validation.yaml | 4 ++-- core/backend/src/workspace/Workspace.ts | 4 ++-- full-stack-tests/backend/src/integration/Checkpoints.test.ts | 4 ++-- full-stack-tests/presentation/src/IntegrationTests.ts | 3 ++- full-stack-tests/presentation/src/Utils.ts | 3 ++- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/common/config/azure-pipelines/integration-client-regression-pr-validation.yaml b/common/config/azure-pipelines/integration-client-regression-pr-validation.yaml index 9f1258eb3546..eb92c9d4a924 100644 --- a/common/config/azure-pipelines/integration-client-regression-pr-validation.yaml +++ b/common/config/azure-pipelines/integration-client-regression-pr-validation.yaml @@ -12,11 +12,11 @@ variables: - group: iModel.js Integration Test Users jobs: - - job: Node_14_x + - job: Node_18_x condition: succeeded() pool: vmImage: ubuntu-latest steps: - template: templates/integration-test-steps.yaml parameters: - Node_Version: 14.x + nodeVersion: 18.x diff --git a/core/backend/src/workspace/Workspace.ts b/core/backend/src/workspace/Workspace.ts index c0a96ad27b0d..202e5a6c975f 100644 --- a/core/backend/src/workspace/Workspace.ts +++ b/core/backend/src/workspace/Workspace.ts @@ -761,11 +761,11 @@ export class EditableWorkspaceDb extends ITwinWorkspaceDb { // currently the only way to create a workspaceDb in a cloud container is to create a temporary workspaceDb and upload it. const tempDbFile = join(KnownLocations.tmpdir, `empty.${ITwinWorkspaceDb.fileExt}`); if (fs.existsSync(tempDbFile)) - fs.rmSync(tempDbFile); + IModelJsFs.removeSync(tempDbFile); EditableWorkspaceDb.createEmpty(tempDbFile); this.dbFileName = ITwinWorkspaceContainer.makeDbFileName(this.dbName, version); await CloudSqlite.uploadDb(this.container.cloudContainer, { localFileName: tempDbFile, dbName: this.dbFileName }); - fs.rmSync(tempDbFile); + IModelJsFs.removeSync(tempDbFile); } this.open(); } diff --git a/full-stack-tests/backend/src/integration/Checkpoints.test.ts b/full-stack-tests/backend/src/integration/Checkpoints.test.ts index 11ca9db8a8ce..cea40582558d 100644 --- a/full-stack-tests/backend/src/integration/Checkpoints.test.ts +++ b/full-stack-tests/backend/src/integration/Checkpoints.test.ts @@ -57,7 +57,7 @@ describe("Checkpoints", () => { before(async () => { originalEnv = { ...process.env }; process.env.CHECKPOINT_CACHE_DIR = cloudcacheDir; - fs.rmSync(cloudcacheDir, { recursive: true, force: true }); + IModelJsFs.removeSync(cloudcacheDir, { recursive: true, force: true }); // Props for daemon accountProps = { @@ -139,7 +139,7 @@ describe("Checkpoints", () => { changeset: testChangeSet, })).eventually.rejectedWith(/Cannot create CloudCache: invalid cache directory or directory does not exist/); } finally { - fs.rmSync(portfile); + IModelJsFs.removeSync(portfile); } }); diff --git a/full-stack-tests/presentation/src/IntegrationTests.ts b/full-stack-tests/presentation/src/IntegrationTests.ts index 4ffeaf2779cc..fec1880f5117 100644 --- a/full-stack-tests/presentation/src/IntegrationTests.ts +++ b/full-stack-tests/presentation/src/IntegrationTests.ts @@ -10,6 +10,7 @@ import Backend from "i18next-http-backend"; import * as path from "path"; import sinon from "sinon"; import sinonChai from "sinon-chai"; +import { IModelJsFs } from "@itwin/core-backend"; import { Logger, LogLevel } from "@itwin/core-bentley"; import { EmptyLocalization, Localization } from "@itwin/core-common"; import { IModelApp, IModelAppOptions, NoRenderApp } from "@itwin/core-frontend"; @@ -89,7 +90,7 @@ const initializeCommon = async (props: { backendTimeout?: number, useClientServi // prepare an empty, process-unique output directory const outputRoot = getOutputRoot(); - fs.existsSync(outputRoot) && fs.rmSync(outputRoot, { recursive: true, force: true }); + fs.existsSync(outputRoot) && IModelJsFs.removeSync(outputRoot); fs.mkdirSync(outputRoot, { recursive: true }); const tempCachesDir = path.join(outputRoot, "caches"); diff --git a/full-stack-tests/presentation/src/Utils.ts b/full-stack-tests/presentation/src/Utils.ts index d5885cb0f799..a3b4e4084d0a 100644 --- a/full-stack-tests/presentation/src/Utils.ts +++ b/full-stack-tests/presentation/src/Utils.ts @@ -6,6 +6,7 @@ import * as fs from "fs"; import * as path from "path"; import { Field } from "@itwin/presentation-common"; +import { IModelJsFs } from "@itwin/core-backend"; /** * Simplified type for `sinon.SinonSpy`. @@ -72,6 +73,6 @@ export function getOutputRoot() { /** Given a file name, returns a path that is safe to use for read-write scenarios when running the tests */ export function prepareOutputFilePath(fileName: string): string { const filePath = path.join(getOutputRoot(), fileName); - fs.rmSync(filePath, { force: true }); + IModelJsFs.removeSync(filePath, { force: true }); return filePath; } From 94f34fcc6b5b7eed1b5fca10641557dcded33149 Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Sun, 29 Jan 2023 11:19:26 -0500 Subject: [PATCH 08/19] Do not limit the max parallel runs --- common/config/azure-pipelines/integration-validation.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/common/config/azure-pipelines/integration-validation.yaml b/common/config/azure-pipelines/integration-validation.yaml index 4cb2e12d0032..8354beeb5838 100644 --- a/common/config/azure-pipelines/integration-validation.yaml +++ b/common/config/azure-pipelines/integration-validation.yaml @@ -20,7 +20,6 @@ variables: jobs: - job: Integration_Tests_Full strategy: - maxParallel: 3 matrix: Linux_node_12_22: imageName: ubuntu-latest From b2443a0beccd30dc44e9aa1719d800464d56a63b Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Sun, 29 Jan 2023 16:38:30 +0000 Subject: [PATCH 09/19] rush change --- .../core-backend/fix-public-ci_2023-01-29-16-38.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@itwin/core-backend/fix-public-ci_2023-01-29-16-38.json diff --git a/common/changes/@itwin/core-backend/fix-public-ci_2023-01-29-16-38.json b/common/changes/@itwin/core-backend/fix-public-ci_2023-01-29-16-38.json new file mode 100644 index 000000000000..99b35bb89b62 --- /dev/null +++ b/common/changes/@itwin/core-backend/fix-public-ci_2023-01-29-16-38.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/core-backend", + "comment": "", + "type": "none" + } + ], + "packageName": "@itwin/core-backend" +} \ No newline at end of file From 40d5c17764c7e209abd7e4670b5889dbe086f1ed Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Sun, 29 Jan 2023 11:45:42 -0500 Subject: [PATCH 10/19] Fix regression integration test on Mac and Windows --- .../templates/integration-test-steps.yaml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/common/config/azure-pipelines/templates/integration-test-steps.yaml b/common/config/azure-pipelines/templates/integration-test-steps.yaml index 1dc06ac4669e..b5d264344e00 100644 --- a/common/config/azure-pipelines/templates/integration-test-steps.yaml +++ b/common/config/azure-pipelines/templates/integration-test-steps.yaml @@ -66,7 +66,13 @@ steps: - script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' npm run test workingDirectory: "full-stack-tests/rpc" displayName: "Run RPC Full Stack Tests" - condition: succeededOrFailed() + condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Linux')) + + # MacOS and Windows agents work without any virtual display + - script: npm run test + workingDirectory: "full-stack-tests/rpc" + displayName: "Run RPC Full Stack Tests" + condition: and(succeededOrFailed(), ne(variables['Agent.OS'], 'Linux')) - script: npm run test:integration workingDirectory: "full-stack-tests/rpc-interface" @@ -82,12 +88,25 @@ steps: - script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' npm run test:integration:frontend:ci workingDirectory: "core/electron" displayName: "Run Electron Frontend Tests" - condition: succeededOrFailed() + condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Linux')) + + # MacOS and Windows agents work without any virtual display + - script: npm run test:integration:frontend:ci + workingDirectory: "core/electron" + displayName: "Run Electron Frontend Tests" + condition: and(succeededOrFailed(), ne(variables['Agent.OS'], 'Linux')) + # By default linux agents do not have a real display so use the virtual framebuffer - script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' npm run test:integration:backend workingDirectory: "core/electron" displayName: "Run Electron Backend Tests" - condition: succeededOrFailed() + condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Linux')) + + # MacOS and Windows agents work without any virtual display + - script: npm run test:integration:backend + workingDirectory: "core/electron" + displayName: "Run Electron Backend Tests" + condition: and(succeededOrFailed(), ne(variables['Agent.OS'], 'Linux')) - task: PublishTestResults@2 displayName: "Publish Backend Test Results" From e0bee5513adc37b93811cbe97565fa73936d152c Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Mon, 30 Jan 2023 10:13:49 -0500 Subject: [PATCH 11/19] fix issues with the params passed to removeSync --- full-stack-tests/backend/src/integration/Checkpoints.test.ts | 2 +- full-stack-tests/presentation/src/Utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/full-stack-tests/backend/src/integration/Checkpoints.test.ts b/full-stack-tests/backend/src/integration/Checkpoints.test.ts index cea40582558d..1d7683a0ff04 100644 --- a/full-stack-tests/backend/src/integration/Checkpoints.test.ts +++ b/full-stack-tests/backend/src/integration/Checkpoints.test.ts @@ -57,7 +57,7 @@ describe("Checkpoints", () => { before(async () => { originalEnv = { ...process.env }; process.env.CHECKPOINT_CACHE_DIR = cloudcacheDir; - IModelJsFs.removeSync(cloudcacheDir, { recursive: true, force: true }); + IModelJsFs.removeSync(cloudcacheDir); // Props for daemon accountProps = { diff --git a/full-stack-tests/presentation/src/Utils.ts b/full-stack-tests/presentation/src/Utils.ts index a3b4e4084d0a..7b50042426d5 100644 --- a/full-stack-tests/presentation/src/Utils.ts +++ b/full-stack-tests/presentation/src/Utils.ts @@ -73,6 +73,6 @@ export function getOutputRoot() { /** Given a file name, returns a path that is safe to use for read-write scenarios when running the tests */ export function prepareOutputFilePath(fileName: string): string { const filePath = path.join(getOutputRoot(), fileName); - IModelJsFs.removeSync(filePath, { force: true }); + IModelJsFs.removeSync(filePath); return filePath; } From 1f116d3a9370cdf08e76ccbce0dd899e6e215c78 Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Mon, 30 Jan 2023 10:28:25 -0500 Subject: [PATCH 12/19] fix lint rules --- full-stack-tests/presentation/src/Utils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/full-stack-tests/presentation/src/Utils.ts b/full-stack-tests/presentation/src/Utils.ts index 7b50042426d5..e37ff062500a 100644 --- a/full-stack-tests/presentation/src/Utils.ts +++ b/full-stack-tests/presentation/src/Utils.ts @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as fs from "fs"; import * as path from "path"; import { Field } from "@itwin/presentation-common"; import { IModelJsFs } from "@itwin/core-backend"; From cada1ed6b3f8bae43c88eee07a3612197f8f392c Mon Sep 17 00:00:00 2001 From: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com> Date: Mon, 30 Jan 2023 11:18:25 -0500 Subject: [PATCH 13/19] Only run regression on 12.x as 12.22 is the latest minor version --- .../integration-validation.yaml | 19 +++++-------------- .../jobs/regression-testing.yaml | 16 ---------------- 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/common/config/azure-pipelines/integration-validation.yaml b/common/config/azure-pipelines/integration-validation.yaml index 8354beeb5838..3cdde73cf5ee 100644 --- a/common/config/azure-pipelines/integration-validation.yaml +++ b/common/config/azure-pipelines/integration-validation.yaml @@ -7,11 +7,11 @@ trigger: none pr: none schedules: -- cron: "0 0 * * Sun" - displayName: Weekly Sunday build - branches: - include: - - master + - cron: "0 0 * * Sun" + displayName: Weekly Sunday build + branches: + include: + - master variables: - group: iTwin.js non-secret config variables @@ -21,9 +21,6 @@ jobs: - job: Integration_Tests_Full strategy: matrix: - Linux_node_12_22: - imageName: ubuntu-latest - nodeVersion: 12.22.0 Linux_node_12_x: imageName: ubuntu-latest nodeVersion: 12.x @@ -33,9 +30,6 @@ jobs: linux_node_16_x: imageName: ubuntu-latest nodeVersion: 16.x - Windows_node_12_22: - imageName: windows-latest - nodeVersion: 12.22.0 Windows_node_12_x: imageName: windows-latest nodeVersion: 12.x @@ -45,9 +39,6 @@ jobs: Windows_node_16_x: imageName: windows-latest nodeVersion: 16.x - MacOS_node_12_22: - imageName: macos-latest - nodeVersion: 12.22.0 MacOS_node_12_x: imageName: macos-latest nodeVersion: 12.x diff --git a/common/config/azure-pipelines/jobs/regression-testing.yaml b/common/config/azure-pipelines/jobs/regression-testing.yaml index ddccf417bac5..57c1fabca4b0 100644 --- a/common/config/azure-pipelines/jobs/regression-testing.yaml +++ b/common/config/azure-pipelines/jobs/regression-testing.yaml @@ -91,22 +91,6 @@ jobs: platform: Darwin name: $(mac_pool) node_version: 12.x - - "Windows_Node_12_22": - OS: windows-latest - platform: Windows_NT - name: $(win_pool) - node_version: 12.22.0 - "Linux_Node_12_22": - OS: ubuntu-latest - platform: Linux - name: $(linux_pool) - node_version: 12.22.0 - "MacOS_Node_12_22": - OS: macOS-latest - platform: Darwin - name: $(mac_pool) - node_version: 12.22.0 maxParallel: 3 pool: From b1e5d6cae30ba468b119be993fcb2c16c1791fdd Mon Sep 17 00:00:00 2001 From: Arun George Date: Mon, 30 Jan 2023 14:30:31 -0500 Subject: [PATCH 14/19] set timeout to an hr, run appui tests in node12, ?? not added til node14 --- .../config/azure-pipelines/jobs/regression-testing.yaml | 2 +- ui/scripts/setup-tests-noreact.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/config/azure-pipelines/jobs/regression-testing.yaml b/common/config/azure-pipelines/jobs/regression-testing.yaml index 57c1fabca4b0..81652601c6c4 100644 --- a/common/config/azure-pipelines/jobs/regression-testing.yaml +++ b/common/config/azure-pipelines/jobs/regression-testing.yaml @@ -98,7 +98,7 @@ jobs: demands: - Agent.OS -equals $(platform) - timeoutInMinutes: 120 + timeoutInMinutes: 60 workspace: clean: all diff --git a/ui/scripts/setup-tests-noreact.js b/ui/scripts/setup-tests-noreact.js index 3d106fd3f775..08fb35b1441a 100644 --- a/ui/scripts/setup-tests-noreact.js +++ b/ui/scripts/setup-tests-noreact.js @@ -22,10 +22,10 @@ global.WheelEvent = global.MouseEvent; // See https://github.com/jsdom/jsdom/pull/2926 global.DOMRect = class DOMRect { constructor(x, y, width, height) { - this.x = x ?? 0; - this.y = y ?? 0; - this.width = width ?? 0; - this.height = height ?? 0; + this.x = x || 0; + this.y = y || 0; + this.width = width || 0; + this.height = height || 0; this.top = this.y; this.left = this.x; this.right = this.x + this.width; From 3ffb1adbf7b0f90d79e97063d3f4b7123a3cc9b2 Mon Sep 17 00:00:00 2001 From: Arun George Date: Mon, 30 Jan 2023 14:36:51 -0500 Subject: [PATCH 15/19] hacky fix for https://github.com/nodejs/node/issues/45171\#issuecomment-1290833591 until patched in node 18 --- .../src/test/timeline/TimelineComponent.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/imodel-components-react/src/test/timeline/TimelineComponent.test.tsx b/ui/imodel-components-react/src/test/timeline/TimelineComponent.test.tsx index 9e866c282791..422cad8e5be2 100644 --- a/ui/imodel-components-react/src/test/timeline/TimelineComponent.test.tsx +++ b/ui/imodel-components-react/src/test/timeline/TimelineComponent.test.tsx @@ -886,7 +886,7 @@ describe("", () => { const startTimeLabel = renderedComponent.getByTestId("test-start-time"); expect(startTimeLabel).not.to.be.null; - expect(startTimeLabel.innerHTML).to.equal("07:00:00 PM"); + expect(startTimeLabel.innerHTML.replace("\u202f", " ")).to.equal("07:00:00 PM"); }); it("should mark today's date on the timeline", () => { From 5b6f4370f991c5a74036131f46e0439537873d21 Mon Sep 17 00:00:00 2001 From: Arun George Date: Mon, 30 Jan 2023 14:39:52 -0500 Subject: [PATCH 16/19] rush change --- .../fix-public-ci_2023-01-30-19-39.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@itwin/imodel-components-react/fix-public-ci_2023-01-30-19-39.json diff --git a/common/changes/@itwin/imodel-components-react/fix-public-ci_2023-01-30-19-39.json b/common/changes/@itwin/imodel-components-react/fix-public-ci_2023-01-30-19-39.json new file mode 100644 index 000000000000..98181801665f --- /dev/null +++ b/common/changes/@itwin/imodel-components-react/fix-public-ci_2023-01-30-19-39.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/imodel-components-react", + "comment": "", + "type": "none" + } + ], + "packageName": "@itwin/imodel-components-react" +} \ No newline at end of file From 282cea0edff5acf7897ba22bd2f5b6e0ba9ee28e Mon Sep 17 00:00:00 2001 From: Arun George Date: Mon, 30 Jan 2023 16:15:50 -0500 Subject: [PATCH 17/19] fix more tests --- ui/components-react/src/test/common/DateUtils.test.ts | 4 ++-- ui/components-react/src/test/editors/DateTimeEditor.test.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/components-react/src/test/common/DateUtils.test.ts b/ui/components-react/src/test/common/DateUtils.test.ts index e9dabdf4d737..60bccb7548d4 100644 --- a/ui/components-react/src/test/common/DateUtils.test.ts +++ b/ui/components-react/src/test/common/DateUtils.test.ts @@ -25,9 +25,9 @@ describe("DateUtils", () => { }); it("toTimeString", () => { expect(toTimeString(new Date("June 30, 2016, 00:00:00 GMT -0000"), 0, - { locales: "en-US", options: { hour: "2-digit", minute: "numeric", second: "numeric", hour12: true } })).to.equal("12:00:00 AM"); + { locales: "en-US", options: { hour: "2-digit", minute: "numeric", second: "numeric", hour12: true } }).replace("\u202f", " ")).to.equal("12:00:00 AM"); expect(toTimeString(new Date("June 30, 2016, 00:00:00 GMT -0000"), undefined, - { locales: "en-US", options: { hour: "2-digit", minute: "numeric", second: "numeric", hour12: true } }) + { locales: "en-US", options: { hour: "2-digit", minute: "numeric", second: "numeric", hour12: true } }).replace("\u202f", " ") ).to.match(/\d{2}:\d{2}:\d{2} (AM|PM)/).not.to.be.null; }); diff --git a/ui/components-react/src/test/editors/DateTimeEditor.test.tsx b/ui/components-react/src/test/editors/DateTimeEditor.test.tsx index 6e93b13f07f9..bc202ae2e4cf 100644 --- a/ui/components-react/src/test/editors/DateTimeEditor.test.tsx +++ b/ui/components-react/src/test/editors/DateTimeEditor.test.tsx @@ -125,7 +125,7 @@ describe("", () => { const spyOnCommit = sinon.spy(); const record = createDateProperty("Test", date, 0); // 0 creates a long DateTime record const renderedComponent = render(); - expect(await waitFor(() => renderedComponent.getByText(date.toLocaleString()))).to.exist; + expect(await waitFor(() => renderedComponent.getByText(date.toLocaleString().replace("\u202f", " ")))).to.exist; const originalValue = (record.value as PrimitiveValue).value as Date; expect(originalValue.getTime()).to.be.equal(date.getTime()); expect(renderedComponent).not.to.be.undefined; @@ -254,7 +254,7 @@ describe("", () => { it("should receive focus", async () => { const record = createDateProperty("Test", date, 0); // 0 creates a long DateTime record const renderedComponent = render(); - expect(await waitFor(() => renderedComponent.getByText(date.toLocaleString()))).to.exist; + expect(await waitFor(() => renderedComponent.getByText(date.toLocaleString().replace("\u202f", " ")))).to.exist; const popupButton = await renderedComponent.findByTestId("components-popup-button"); expect(popupButton).not.to.be.null; popupButton.focus(); From ea313b26f7d2a67b9ab42de93ce4987304308b55 Mon Sep 17 00:00:00 2001 From: Arun George Date: Mon, 30 Jan 2023 16:16:29 -0500 Subject: [PATCH 18/19] rush change --- .../fix-public-ci_2023-01-30-21-16.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@itwin/components-react/fix-public-ci_2023-01-30-21-16.json diff --git a/common/changes/@itwin/components-react/fix-public-ci_2023-01-30-21-16.json b/common/changes/@itwin/components-react/fix-public-ci_2023-01-30-21-16.json new file mode 100644 index 000000000000..d2d24b087cf6 --- /dev/null +++ b/common/changes/@itwin/components-react/fix-public-ci_2023-01-30-21-16.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/components-react", + "comment": "", + "type": "none" + } + ], + "packageName": "@itwin/components-react" +} \ No newline at end of file From 75490a1bf95b4b64b5babbb1a4d0d0b45ed91b2b Mon Sep 17 00:00:00 2001 From: Arun George Date: Mon, 30 Jan 2023 16:38:59 -0500 Subject: [PATCH 19/19] use || because ?? not supported til node14. again --- ui/scripts/setup-tests.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/scripts/setup-tests.js b/ui/scripts/setup-tests.js index 1853505441e8..be6a3d1660d9 100644 --- a/ui/scripts/setup-tests.js +++ b/ui/scripts/setup-tests.js @@ -30,10 +30,10 @@ global.WheelEvent = global.MouseEvent; // See https://github.com/jsdom/jsdom/pull/2926 global.DOMRect = class DOMRect { constructor(x, y, width, height) { - this.x = x ?? 0; - this.y = y ?? 0; - this.width = width ?? 0; - this.height = height ?? 0; + this.x = x || 0; + this.y = y || 0; + this.width = width || 0; + this.height = height || 0; this.top = this.y; this.left = this.x; this.right = this.x + this.width;