Skip to content

Commit

Permalink
Preemptively unblock Node 20 (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
ejizba authored Mar 2, 2023
1 parent 07e5356 commit 4607f46
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
12 changes: 11 additions & 1 deletion azure-pipelines/e2e-integration-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
variables: {
NODE_14: '14.x',
NODE_16: '16.x',
NODE_18: '18.x'
NODE_18: '18.x',
NODE_20: '19.x' # Temporarily using v19 until v20 is released
}

pr: none
Expand All @@ -19,6 +20,9 @@ strategy:
UBUNTU_NODE18:
IMAGE_TYPE: 'ubuntu-latest'
NODE_VERSION: $(NODE_18)
UBUNTU_NODE20:
IMAGE_TYPE: 'ubuntu-latest'
NODE_VERSION: $(NODE_20)
WINDOWS_NODE14:
IMAGE_TYPE: 'windows-latest'
NODE_VERSION: $(NODE_14)
Expand All @@ -28,6 +32,9 @@ strategy:
WINDOWS_NODE18:
IMAGE_TYPE: 'windows-latest'
NODE_VERSION: $(NODE_18)
WINDOWS_NODE20:
IMAGE_TYPE: 'windows-latest'
NODE_VERSION: $(NODE_20)
MAC_NODE14:
IMAGE_TYPE: 'macOS-latest'
NODE_VERSION: $(NODE_14)
Expand All @@ -37,6 +44,9 @@ strategy:
MAC_NODE18:
IMAGE_TYPE: 'macOS-latest'
NODE_VERSION: $(NODE_18)
MAC_NODE20:
IMAGE_TYPE: 'macOS-latest'
NODE_VERSION: $(NODE_20)
pool:
vmImage: $(IMAGE_TYPE)
steps:
Expand Down
21 changes: 20 additions & 1 deletion azure-pipelines/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
variables: {
NODE_14: '14.x',
NODE_16: '16.x',
NODE_18: '18.x'
NODE_18: '18.x',
NODE_20: '19.x' # Temporarily using v19 until v20 is released
}

pr:
Expand All @@ -25,6 +26,9 @@ jobs:
UBUNTU_NODE18:
IMAGE_TYPE: 'ubuntu-latest'
NODE_VERSION: $(NODE_18)
UBUNTU_NODE20:
IMAGE_TYPE: 'ubuntu-latest'
NODE_VERSION: $(NODE_20)
WINDOWS_NODE14:
IMAGE_TYPE: 'windows-latest'
NODE_VERSION: $(NODE_14)
Expand All @@ -34,6 +38,9 @@ jobs:
WINDOWS_NODE18:
IMAGE_TYPE: 'windows-latest'
NODE_VERSION: $(NODE_18)
WINDOWS_NODE20:
IMAGE_TYPE: 'windows-latest'
NODE_VERSION: $(NODE_20)
MAC_NODE14:
IMAGE_TYPE: 'macOS-latest'
NODE_VERSION: $(NODE_14)
Expand All @@ -43,6 +50,9 @@ jobs:
MAC_NODE18:
IMAGE_TYPE: 'macOS-latest'
NODE_VERSION: $(NODE_18)
MAC_NODE20:
IMAGE_TYPE: 'macOS-latest'
NODE_VERSION: $(NODE_20)
pool:
vmImage: $(IMAGE_TYPE)
steps:
Expand Down Expand Up @@ -80,6 +90,9 @@ jobs:
UBUNTU_NODE18:
IMAGE_TYPE: 'ubuntu-latest'
NODE_VERSION: $(NODE_18)
UBUNTU_NODE20:
IMAGE_TYPE: 'ubuntu-latest'
NODE_VERSION: $(NODE_20)
WINDOWS_NODE14:
IMAGE_TYPE: 'windows-latest'
NODE_VERSION: $(NODE_14)
Expand All @@ -89,6 +102,9 @@ jobs:
WINDOWS_NODE18:
IMAGE_TYPE: 'windows-latest'
NODE_VERSION: $(NODE_18)
WINDOWS_NODE20:
IMAGE_TYPE: 'windows-latest'
NODE_VERSION: $(NODE_20)
MAC_NODE14:
IMAGE_TYPE: 'macOS-latest'
NODE_VERSION: $(NODE_14)
Expand All @@ -98,6 +114,9 @@ jobs:
MAC_NODE18:
IMAGE_TYPE: 'macOS-latest'
NODE_VERSION: $(NODE_18)
MAC_NODE20:
IMAGE_TYPE: 'macOS-latest'
NODE_VERSION: $(NODE_20)
pool:
vmImage: $(IMAGE_TYPE)
steps:
Expand Down
2 changes: 1 addition & 1 deletion src/nodejsWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const logPrefix = 'LanguageWorkerConsoleLog';
const errorPrefix = logPrefix + '[error] ';
const warnPrefix = logPrefix + '[warn] ';
const supportedVersions: string[] = ['v14', 'v16', 'v18'];
const supportedVersions: string[] = ['v14', 'v16', 'v18', 'v20'];
const devOnlyVersions: string[] = ['v15', 'v17', 'v19'];
let worker;

Expand Down
7 changes: 6 additions & 1 deletion test/eventHandlers/WorkerInitHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as escapeStringRegexp from 'escape-string-regexp';
import 'mocha';
import { ITestCallbackContext } from 'mocha';
import * as mockFs from 'mock-fs';
import * as semver from 'semver';
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
import { logColdStartWarning } from '../../src/eventHandlers/WorkerInitHandler';
import { WorkerChannel } from '../../src/WorkerChannel';
Expand Down Expand Up @@ -232,14 +233,18 @@ describe('WorkerInitHandler', () => {
},
});

const jsonError = semver.gte(process.versions.node, '19.0.0')
? 'Unexpected token \'g\', "gArB@g3 dAtA" is not valid JSON'
: 'Unexpected token g in JSON at position 0';

stream.addTestMessage(Msg.init(appDir));
await stream.assertCalledWith(
Msg.receivedInitLog,
Msg.warning(
`Worker failed to load package.json: file content is not valid JSON: ${path.join(
appDir,
'package.json'
)}: Unexpected token g in JSON at position 0`
)}: ${jsonError}`
),
Msg.response
);
Expand Down

0 comments on commit 4607f46

Please sign in to comment.