Skip to content

Commit 952209f

Browse files
Upgrade to Node.js 20 and Improve CI Test Output (#529)
* Upgrade to Node.js 20 and remove deprecated mock server build step - Update all pipelines to use Node 20.x instead of Node 16.x - Remove obsolete packages/tfs-mock-server build step from common-steps.yml - Update package.json engines to require Node >=20.0.0 - Fixes EBADENGINE warnings for shelljs, path-scurry, and system-architecture dependencies - All 181 tests passing locally * Add mocha-multi-reporters for better CI test output - Install mocha-multi-reporters package - Configure test:ci to output both spec (console) and xunit (XML) formats - Pipeline will now show detailed test progress in logs while still generating test-results.xml for Azure DevOps - All 181 tests passing * packge version update for node 20 * updating node in matrix test as well --------- Co-authored-by: Tarun Ramsinghani <tarunramsinghani@users.noreply.github.com>
1 parent 585e4db commit 952209f

File tree

7 files changed

+58
-49
lines changed

7 files changed

+58
-49
lines changed

.azure-pipelines/common-steps.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ steps:
66
clean: true
77

88
- task: UseNode@1
9-
displayName: Use Node 16
9+
displayName: Use Node 20
1010
inputs:
11-
version: "16.x"
11+
version: "20.x"
1212

1313
- task: NpmAuthenticate@0
1414
inputs:
@@ -17,12 +17,6 @@ steps:
1717
- script: npm i -g npm@8.19.4 --force
1818
displayName: Use npm version 8.19.4
1919

20-
- bash: |
21-
cd packages/tfs-mock-server
22-
npm ci
23-
npm run build
24-
displayName: Install and Build Mock Server
25-
2620
- bash: |
2721
npm ci
2822
npm run build
@@ -34,7 +28,6 @@ steps:
3428
export TFX_TRACE="$TFX_TRACE"
3529
npm run test:ci
3630
displayName: Run Tests
37-
continueOnError: true
3831
3932
- task: PublishTestResults@2
4033
displayName: Publish Test Results

.azure-pipelines/multi-os-matrix.yml

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ stages:
1717
displayName: Run tests on all Node/OS combinations
1818
strategy:
1919
matrix:
20-
windows_node16:
20+
windows_node24:
2121
imageName: 'windows-2022'
22-
nodeVersion: '16.x'
22+
nodeVersion: '24.x'
2323
windows_node20:
2424
imageName: 'windows-2022'
2525
nodeVersion: '20.x'
26-
ubuntu_node16:
26+
ubuntu_node24:
2727
imageName: 'ubuntu-24.04'
28-
nodeVersion: '16.x'
28+
nodeVersion: '24.x'
2929
ubuntu_node20:
3030
imageName: 'ubuntu-24.04'
3131
nodeVersion: '20.x'
32-
macos_node16:
32+
macos_node24:
3333
imageName: 'macos-14'
34-
nodeVersion: '16.x'
34+
nodeVersion: '24.x'
3535
macos_node20:
3636
imageName: 'macos-14'
3737
nodeVersion: '20.x'
@@ -47,28 +47,8 @@ stages:
4747
- task: NpmAuthenticate@0
4848
inputs:
4949
workingFile: .npmrc
50-
- script: |
51-
if [[ "$(nodeVersion)" =~ ^(10|12|14|16|18) ]]; then
52-
npm i -g npm@8.19.4 --force
53-
npm --version
54-
else
55-
npm i -g npm@10 --force
56-
npm --version
57-
fi
58-
displayName: Use compatible npm version for Node (Linux/macOS)
59-
condition: ne( variables['Agent.OS'], 'Windows_NT' )
60-
- script: |
61-
if "%nodeVersion%" == "16.x" (
62-
npm i -g npm@8.19.4 --force
63-
npm --version
64-
) else if "%nodeVersion%" == "20.x" (
65-
npm i -g npm@10 --force
66-
npm --version
67-
) else (
68-
npm --version
69-
)
70-
displayName: Use compatible npm version for Node (Windows)
71-
condition: eq( variables['Agent.OS'], 'Windows_NT' )
50+
- script: npm i -g npm@latest --force
51+
displayName: Use latest npm version
7252
- script: npm ci
7353
displayName: npm ci
7454
- script: npm run build

.azure-pipelines/release-pipeline.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ extends:
5252
displayName: Publish TFX CLI to npm
5353
condition: eq(variables['Build.SourceBranchName'], 'master')
5454
55-
# Install node 16 for CodeQL 3000
55+
# Install node 20 for CodeQL 3000
5656
- task: NodeTool@0
57-
displayName: Use node 16
57+
displayName: Use node 20
5858
inputs:
59-
versionSpec: "16.x"
59+
versionSpec: "20.x"
6060
- stage: Release
6161
displayName: Release to Latest
6262
trigger: manual
@@ -68,9 +68,9 @@ extends:
6868
clean: true
6969

7070
- task: NodeTool@0
71-
displayName: Use node 16
71+
displayName: Use node 20
7272
inputs:
73-
versionSpec: "16.x"
73+
versionSpec: "20.x"
7474
- script: npm i -g npm@8.19.4 --force
7575
displayName: Use npm version 8.19.4
7676

.mocha-multi-reporters.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"reporterEnabled": "spec, xunit",
3+
"xunitReporterOptions": {
4+
"output": "test-results.xml"
5+
}
6+
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"tmp/": true
99
},
1010
"editor.insertSpaces": false,
11-
"typescript.tsdk": "./node_modules/typescript/lib"
11+
"typescript.tsdk": "./node_modules/typescript/lib",
12+
"azure-pipelines.1ESPipelineTemplatesSchemaFile": true
1213
}

package-lock.json

Lines changed: 31 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tfx-cli",
3-
"version": "0.22.7",
3+
"version": "0.23.0",
44
"description": "CLI for Azure DevOps Services and Team Foundation Server",
55
"repository": {
66
"type": "git",
@@ -21,7 +21,7 @@
2121
"build:tests": "tsc -p tsconfig.tests.json",
2222
"postbuild:tests": "ncp tests/build-samples _tests/build-samples && ncp tests/extension-samples _tests/extension-samples",
2323
"test": "npm run build:tests && mocha \"_tests/tests/**/*.js\"",
24-
"test:ci": "npm run build:tests && mocha \"_tests/tests/**/*.js\" --reporter xunit --reporter-options output=test-results.xml",
24+
"test:ci": "npm run build:tests && mocha \"_tests/tests/**/*.js\" --reporter mocha-multi-reporters --reporter-options configFile=.mocha-multi-reporters.json",
2525
"test:commandline": "npm run build:tests && mocha \"_tests/tests/commandline.js\"",
2626
"test:server-integration": "npm run build:tests && mocha \"_tests/tests/server-integration-*.js\"",
2727
"test:focused-login": "npm run build:tests && mocha \"_tests/tests/focused-login-test.js\"",
@@ -79,12 +79,13 @@
7979
"@types/xml2js": "0.0.27",
8080
"adm-zip": "^0.5.16",
8181
"mocha": "^10.2.0",
82+
"mocha-multi-reporters": "^1.5.1",
8283
"ncp": "^2.0.0",
8384
"rimraf": "^2.6.1",
8485
"typescript": "^4.9.5"
8586
},
8687
"engines": {
87-
"node": ">=16.0.0"
88+
"node": ">=20.0.0"
8889
},
8990
"author": "Microsoft Corporation",
9091
"contributors": [

0 commit comments

Comments
 (0)