Skip to content

Fix ArtifactEngine CI test failures by updating nock to v14#1352

Draft
v-abhishera wants to merge 1 commit intomasterfrom
users/v-abhishera/ArtifactEngineCIChecksfix
Draft

Fix ArtifactEngine CI test failures by updating nock to v14#1352
v-abhishera wants to merge 1 commit intomasterfrom
users/v-abhishera/ArtifactEngineCIChecksfix

Conversation

@v-abhishera
Copy link
Copy Markdown
Contributor

Description:

Summary

The ArtifactEngine integration tests fail in CI due to nock@9.1.0 being incompatible with Node 24's stricter stream type checking. This PR updates nock to v14 and fixes related test issues.

Root Cause

The CI pipeline (azure-pipelines-extensions.yml) runs tests on Node 24. nock@9.1.0 uses internal stream APIs that changed in Node 24, causing TypeError crashes in all nock-based integration tests.

Changes

1. Update nock dependency (package.json)

  • nock: 9.1.0^14.0.6

2. Fix jenkins integration tests (jenkinsTests.ts)

  • Added nock.disableNetConnect() and nock.enableNetConnect('127.0.0.1') in beforeEach — required by nock v14 to properly intercept HTTP requests.

3. Fix proxy integration tests (proxyTests.ts)

  • Replaced unreachable host redvstt-lab43:8080 with 127.0.0.1:9011 (the test's own local server) — the old hostname was a decommissioned dev machine.
  • Replaced 2 occurrences of deprecated new Buffer() with Buffer.from()Buffer() constructor is removed in newer Node versions.

Testing

  • All 60 ArtifactEngine tests passing locally (npx gulp test --suite=ArtifactEngine).
  • No changes to production code — only devDependency and test files.

Files Changed

File Change
package.json nock 9.1.0^14.0.6
jenkinsTests.ts Add nock.disableNetConnect()/enableNetConnect()
proxyTests.ts Fix URL, replace new Buffer()
package-lock.json Regenerated

Risk Assessment

Low — Only test infrastructure changes; no production code affected.

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

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.

1 participant