From b1f508bb8a3750c1e1e1bdeb9b07e66f2a6d9ba4 Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Tue, 24 May 2022 20:19:23 +0200 Subject: [PATCH] feat(all): nodejs16x support (#877) * feat: added node16 to e2e test * Added runtime to e2eUtils * feat: added node16 to e2e test * chore: added runtime key * chore: update occurrences of nodejs14x * test sam version * test sam version * revert * sam * sam * sam * sam * chore: added .nvmrc * chore: updated cdk example runtime * Update packages/metrics/tests/e2e/basicFeatures.decorators.test.ts Co-authored-by: Florian Chazal Co-authored-by: Florian Chazal --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 2 +- .github/workflows/on-merge-to-main.yml | 9 +++++++-- .github/workflows/on-release-prod.yml | 9 +++++++-- .github/workflows/pr_lint_and_test.yml | 9 +++++++-- .github/workflows/run-e2e-tests.yml | 17 ++++++++++------- .nvmrc | 2 +- CONTRIBUTING.md | 4 ++-- docs/core/logger.md | 2 +- docs/core/metrics.md | 2 +- docs/core/tracer.md | 2 +- examples/cdk/src/example-function.ts | 3 ++- examples/sam/template.yaml | 2 +- package.json | 2 +- packages/commons/tests/utils/e2eUtils.ts | 3 ++- packages/logger/package.json | 3 ++- .../tests/e2e/basicFeatures.middy.test.ts | 2 +- .../logger/tests/e2e/childLogger.manual.test.ts | 2 +- .../tests/e2e/sampleRate.decorator.test.ts | 2 +- packages/metrics/package.json | 3 ++- .../tests/e2e/basicFeatures.decorators.test.ts | 2 +- .../tests/e2e/basicFeatures.manual.test.ts | 2 +- packages/tracer/package.json | 3 ++- .../tests/e2e/allFeatures.decorator.test.ts | 2 +- .../tracer/tests/e2e/allFeatures.manual.test.ts | 2 +- .../tracer/tests/e2e/allFeatures.middy.test.ts | 2 +- .../tests/e2e/asyncHandler.decorator.test.ts | 2 +- .../helpers/populateEnvironmentVariables.ts | 2 +- .../config/EnvironmentVariablesService.test.ts | 4 ++-- packages/tracer/tests/unit/helpers.test.ts | 2 +- 30 files changed, 64 insertions(+), 41 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1a7334ee80..b491a08341 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/v0.212.0/containers/javascript-node/.devcontainer/base.Dockerfile # [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster -ARG VARIANT="14-bullseye" +ARG VARIANT="16-bullseye" FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} # This section to install additional OS packages. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b4f8c88210..7040bc6847 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ // Update 'VARIANT' to pick a Node version: 16, 14, 12. // Append -bullseye or -buster to pin to an OS version. // Use -bullseye variants on local arm64/Apple Silicon. - "args": { "VARIANT": "14-bullseye" } + "args": { "VARIANT": "16-bullseye" } }, // Set *default* container specific settings.json values on container create. diff --git a/.github/workflows/on-merge-to-main.yml b/.github/workflows/on-merge-to-main.yml index 0a3429227c..607265c08b 100644 --- a/.github/workflows/on-merge-to-main.yml +++ b/.github/workflows/on-merge-to-main.yml @@ -21,10 +21,10 @@ jobs: ######################### # Release new version ######################### - - name: "Use NodeJS 14" + - name: "Use NodeJS 16" uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - name: Install npm@8.x run: npm i -g npm@next-8 - name: "Setup npm" @@ -39,6 +39,11 @@ jobs: # the dependencies in a separate step working-directory: ./examples/cdk run: npm ci + - name: "Setup SAM" + # We use an ad-hoc action so we can specify the SAM CLI version + uses: aws-actions/setup-sam@v2 + with: + version: 1.49.0 - name: Install SAM example packages # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step diff --git a/.github/workflows/on-release-prod.yml b/.github/workflows/on-release-prod.yml index 5ee78f4c68..5acdb0fa82 100644 --- a/.github/workflows/on-release-prod.yml +++ b/.github/workflows/on-release-prod.yml @@ -21,10 +21,10 @@ jobs: ######################### # Release new version ######################### - - name: "Use NodeJS 14" + - name: "Use NodeJS 16" uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - name: Install npm@8.x run: npm i -g npm@next-8 - name: "Setup npm" @@ -39,6 +39,11 @@ jobs: # the dependencies in a separate step working-directory: ./examples/cdk run: npm ci + - name: "Setup SAM" + # We use an ad-hoc action so we can specify the SAM CLI version + uses: aws-actions/setup-sam@v2 + with: + version: 1.49.0 - name: Install SAM example packages # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step diff --git a/.github/workflows/pr_lint_and_test.yml b/.github/workflows/pr_lint_and_test.yml index f825016d5c..df1cd9dd3b 100644 --- a/.github/workflows/pr_lint_and_test.yml +++ b/.github/workflows/pr_lint_and_test.yml @@ -9,10 +9,10 @@ jobs: NODE_ENV: dev steps: - uses: actions/checkout@v3 - - name: Set up Node + - name: "Use NodeJS 16" uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - name: Install npm@8.x run: npm i -g npm@next-8 - name: "Setup npm" @@ -27,6 +27,11 @@ jobs: # the dependencies in a separate step working-directory: ./examples/cdk run: npm ci + - name: "Setup SAM" + # We use an ad-hoc action so we can specify the SAM CLI version + uses: aws-actions/setup-sam@v2 + with: + version: 1.49.0 - name: Install SAM example packages # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step diff --git a/.github/workflows/run-e2e-tests.yml b/.github/workflows/run-e2e-tests.yml index 59174b7610..b6420d71f0 100644 --- a/.github/workflows/run-e2e-tests.yml +++ b/.github/workflows/run-e2e-tests.yml @@ -9,11 +9,10 @@ jobs: steps: - name: "Checkout" uses: actions/checkout@v3 - - name: "Use NodeJS 14" + - name: "Use NodeJS 16" uses: actions/setup-node@v3 with: - # Always use version 14 as we use TypeScript target es2020 - node-version: 14 + node-version: 16 - name: "Install npm@8.x" run: npm i -g npm@next-8 - name: "Install monorepo packages" @@ -25,6 +24,11 @@ jobs: # the dependencies in a separate step working-directory: ./examples/cdk run: npm ci + - name: "Setup SAM" + # We use an ad-hoc action so we can specify the SAM CLI version + uses: aws-actions/setup-sam@v2 + with: + version: 1.49.0 - name: Install SAM example packages # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step @@ -43,16 +47,15 @@ jobs: contents: read strategy: matrix: - version: [12, 14] package: [logger, metrics, tracer] + version: [12, 14, 16] steps: - name: "Checkout" uses: actions/checkout@v3 - - name: "Use NodeJS 14" + - name: "Use NodeJS 16" uses: actions/setup-node@v3 with: - # Always use version 14 as we use TypeScript target es2020 - node-version: 14 + node-version: 16 - name: "Install npm@8.x" run: npm i -g npm@next-8 - name: "Install monorepo packages" diff --git a/.nvmrc b/.nvmrc index 7480d3c856..53d838af21 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/fermium \ No newline at end of file +lts/gallium diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 301a291d15..4de6e2f6ce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,7 +61,7 @@ The alternative is to use a Cloud IDE like [Gitpod](https://www.gitpod.io/) or [ The following tools need to be installed on your system prior to starting working on a pull request: -- [Node.js >= 14.18.1](https://nodejs.org/download/release/latest-v14.x/) +- [Node.js >= 16.x](https://nodejs.org/download/release/latest-v16.x/) - We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/) - If you use [nvm](https://github.com/nvm-sh/nvm#nvmrc) or [fnm](https://github.com/Schniz/fnm) you can install the latest LTS version with `nvm use` or `fnm use` respectively. Both will use the `.nvmrc` file in the project's root. - [npm 8.x](https://www.npmjs.com/) @@ -250,7 +250,7 @@ Contributions via pull requests are much appreciated. ### Summary -* This project uses `node@14.x` and `npm@8.x` for development (see [Setup](#setup)). +* This project uses `node@16.x` and `npm@8.x` for development (see [Setup](#setup)). * Before opening a Pull Request, please find the existing related issue or open a new one to discuss the proposed changes. A PR without a related issue or discussion has a high risk of being rejected. We are very appreciative and thankful for your time and efforts, and we want to make sure they are not wasted. * After your proposal has been reviewed and accepted by at least one of the project's maintainers, you can submit a pull request. * When opening a PR, make sure to follow the checklist inside the pull request template. diff --git a/docs/core/logger.md b/docs/core/logger.md index 6a34cab816..aaa25acf82 100644 --- a/docs/core/logger.md +++ b/docs/core/logger.md @@ -82,7 +82,7 @@ For a **complete list** of supported environment variables, refer to [this secti ShoppingCartApiFunction: Type: AWS::Serverless::Function Properties: - Runtime: nodejs14.x + Runtime: nodejs16.x Environment: Variables: LOG_LEVEL: WARN diff --git a/docs/core/metrics.md b/docs/core/metrics.md index c3d1fe873e..bfe04aa609 100644 --- a/docs/core/metrics.md +++ b/docs/core/metrics.md @@ -101,7 +101,7 @@ The `Metrics` utility is instantiated outside of the Lambda handler. In doing th HelloWorldFunction: Type: AWS::Serverless::Function Properties: - Runtime: nodejs14.x + Runtime: nodejs16.x Environment: Variables: POWERTOOLS_SERVICE_NAME: orders diff --git a/docs/core/tracer.md b/docs/core/tracer.md index 8f24399847..4f8241f1e2 100644 --- a/docs/core/tracer.md +++ b/docs/core/tracer.md @@ -88,7 +88,7 @@ The `Tracer` utility is instantiated outside of the Lambda handler. In doing thi HelloWorldFunction: Type: AWS::Serverless::Function Properties: - Runtime: nodejs14.x + Runtime: nodejs16.x Tracing: Active Environment: Variables: diff --git a/examples/cdk/src/example-function.ts b/examples/cdk/src/example-function.ts index def8d2ecdf..be9bbd97a7 100644 --- a/examples/cdk/src/example-function.ts +++ b/examples/cdk/src/example-function.ts @@ -2,7 +2,7 @@ import { custom_resources, aws_iam } from 'aws-cdk-lib'; import { Events } from '@aws-lambda-powertools/commons'; import { Construct } from 'constructs'; import { NodejsFunction, NodejsFunctionProps } from 'aws-cdk-lib/aws-lambda-nodejs'; -import { Tracing } from 'aws-cdk-lib/aws-lambda'; +import { Tracing, Runtime } from 'aws-cdk-lib/aws-lambda'; interface ExampleFunctionProps { readonly functionName: string @@ -23,6 +23,7 @@ class ExampleFunction extends Construct { const fn = new NodejsFunction(this, functionName, { tracing: tracingActive ? Tracing.ACTIVE : Tracing.DISABLED, + runtime: Runtime.NODEJS_16_X, ...fnProps }); diff --git a/examples/sam/template.yaml b/examples/sam/template.yaml index 85bfb190ab..18a5662b42 100644 --- a/examples/sam/template.yaml +++ b/examples/sam/template.yaml @@ -15,7 +15,7 @@ Transform: AWS::Serverless-2016-10-31 # https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-template-anatomy-globals.html Globals: Function: - Runtime: nodejs14.x + Runtime: nodejs16.x Architectures: - x86_64 MemorySize: 128 diff --git a/package.json b/package.json index ac0b4471c7..876b82e109 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "lib/**/*" ], "engines": { - "node": ">=10" + "node": ">=12" }, "dependencies": { "hosted-git-info": "^5.0.0" diff --git a/packages/commons/tests/utils/e2eUtils.ts b/packages/commons/tests/utils/e2eUtils.ts index caced6e568..c4c38d1d21 100644 --- a/packages/commons/tests/utils/e2eUtils.ts +++ b/packages/commons/tests/utils/e2eUtils.ts @@ -14,11 +14,12 @@ import { InvocationLogs } from './InvocationLogs'; const lambdaClient = new AWS.Lambda(); -const testRuntimeKeys = [ 'nodejs12x', 'nodejs14x' ]; +const testRuntimeKeys = [ 'nodejs12x', 'nodejs14x', 'nodejs16x' ]; export type TestRuntimesKey = typeof testRuntimeKeys[number]; export const TEST_RUNTIMES: Record = { nodejs12x: Runtime.NODEJS_12_X, nodejs14x: Runtime.NODEJS_14_X, + nodejs16x: Runtime.NODEJS_16_X, }; export type StackWithLambdaFunctionOptions = { diff --git a/packages/logger/package.json b/packages/logger/package.json index 65de8210a9..c82e147399 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -15,6 +15,7 @@ "test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose", "test:e2e:nodejs12x": "RUNTIME=nodejs12x jest --group=e2e", "test:e2e:nodejs14x": "RUNTIME=nodejs14x jest --group=e2e", + "test:e2e:nodejs16x": "RUNTIME=nodejs16x jest --group=e2e", "test:e2e": "jest --group=e2e", "watch": "jest --watch --group=unit", "build": "tsc", @@ -65,4 +66,4 @@ "lodash.merge": "^4.6.2", "lodash.pickby": "^4.6.0" } -} +} \ No newline at end of file diff --git a/packages/logger/tests/e2e/basicFeatures.middy.test.ts b/packages/logger/tests/e2e/basicFeatures.middy.test.ts index bb4cd014fe..04d964efcb 100644 --- a/packages/logger/tests/e2e/basicFeatures.middy.test.ts +++ b/packages/logger/tests/e2e/basicFeatures.middy.test.ts @@ -27,7 +27,7 @@ import { TEARDOWN_TIMEOUT } from './constants'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/logger/tests/e2e/childLogger.manual.test.ts b/packages/logger/tests/e2e/childLogger.manual.test.ts index 8c2c1e5c02..b8bc59c47d 100644 --- a/packages/logger/tests/e2e/childLogger.manual.test.ts +++ b/packages/logger/tests/e2e/childLogger.manual.test.ts @@ -26,7 +26,7 @@ import { TEARDOWN_TIMEOUT } from './constants'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/logger/tests/e2e/sampleRate.decorator.test.ts b/packages/logger/tests/e2e/sampleRate.decorator.test.ts index 8ccd18e73f..038d61b4b5 100644 --- a/packages/logger/tests/e2e/sampleRate.decorator.test.ts +++ b/packages/logger/tests/e2e/sampleRate.decorator.test.ts @@ -26,7 +26,7 @@ import { TEARDOWN_TIMEOUT } from './constants'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/metrics/package.json b/packages/metrics/package.json index d09117bb9c..bd62059636 100644 --- a/packages/metrics/package.json +++ b/packages/metrics/package.json @@ -15,6 +15,7 @@ "test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose", "test:e2e:nodejs12x": "RUNTIME=nodejs12x jest --group=e2e", "test:e2e:nodejs14x": "RUNTIME=nodejs14x jest --group=e2e", + "test:e2e:nodejs16x": "RUNTIME=nodejs16x jest --group=e2e", "test:e2e": "jest --group=e2e", "watch": "jest --group=unit --watch ", "build": "tsc", @@ -69,4 +70,4 @@ "dependencies": { "@aws-lambda-powertools/commons": "^0.9.1" } -} +} \ No newline at end of file diff --git a/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts b/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts index c23bb78086..5d53d812d5 100644 --- a/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts +++ b/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts @@ -29,7 +29,7 @@ import { } from './constants'; import { getMetrics } from '../helpers/metricsUtils'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/metrics/tests/e2e/basicFeatures.manual.test.ts b/packages/metrics/tests/e2e/basicFeatures.manual.test.ts index 56548fac78..f0ebecfdfc 100644 --- a/packages/metrics/tests/e2e/basicFeatures.manual.test.ts +++ b/packages/metrics/tests/e2e/basicFeatures.manual.test.ts @@ -29,7 +29,7 @@ import { } from './constants'; import { getMetrics } from '../helpers/metricsUtils'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/tracer/package.json b/packages/tracer/package.json index 3236c687d4..a2dc8b8cbf 100644 --- a/packages/tracer/package.json +++ b/packages/tracer/package.json @@ -15,6 +15,7 @@ "test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose", "test:e2e:nodejs12x": "RUNTIME=nodejs12x jest --group=e2e", "test:e2e:nodejs14x": "RUNTIME=nodejs14x jest --group=e2e", + "test:e2e:nodejs16x": "RUNTIME=nodejs16x jest --group=e2e", "test:e2e": "jest --group=e2e", "watch": "jest --watch", "build": "tsc", @@ -51,4 +52,4 @@ "@aws-lambda-powertools/commons": "^0.9.1", "aws-xray-sdk-core": "^3.3.4" } -} +} \ No newline at end of file diff --git a/packages/tracer/tests/e2e/allFeatures.decorator.test.ts b/packages/tracer/tests/e2e/allFeatures.decorator.test.ts index 5869c46e78..535a9660e1 100644 --- a/packages/tracer/tests/e2e/allFeatures.decorator.test.ts +++ b/packages/tracer/tests/e2e/allFeatures.decorator.test.ts @@ -40,7 +40,7 @@ import { assertErrorAndFault, } from '../helpers/traceAssertions'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/tracer/tests/e2e/allFeatures.manual.test.ts b/packages/tracer/tests/e2e/allFeatures.manual.test.ts index ba56577945..de8920f55b 100644 --- a/packages/tracer/tests/e2e/allFeatures.manual.test.ts +++ b/packages/tracer/tests/e2e/allFeatures.manual.test.ts @@ -41,7 +41,7 @@ import { assertAnnotation } from '../helpers/traceAssertions'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/tracer/tests/e2e/allFeatures.middy.test.ts b/packages/tracer/tests/e2e/allFeatures.middy.test.ts index c4be1934f2..8cb26b84b6 100644 --- a/packages/tracer/tests/e2e/allFeatures.middy.test.ts +++ b/packages/tracer/tests/e2e/allFeatures.middy.test.ts @@ -40,7 +40,7 @@ import { assertErrorAndFault, } from '../helpers/traceAssertions'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/tracer/tests/e2e/asyncHandler.decorator.test.ts b/packages/tracer/tests/e2e/asyncHandler.decorator.test.ts index 46f8dedd7b..96f4de7abc 100644 --- a/packages/tracer/tests/e2e/asyncHandler.decorator.test.ts +++ b/packages/tracer/tests/e2e/asyncHandler.decorator.test.ts @@ -40,7 +40,7 @@ import { assertErrorAndFault, } from '../helpers/traceAssertions'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/tracer/tests/helpers/populateEnvironmentVariables.ts b/packages/tracer/tests/helpers/populateEnvironmentVariables.ts index b462aa0847..4eb2b25522 100644 --- a/packages/tracer/tests/helpers/populateEnvironmentVariables.ts +++ b/packages/tracer/tests/helpers/populateEnvironmentVariables.ts @@ -1,7 +1,7 @@ // Reserved variables process.env._X_AMZN_TRACE_ID = '1-abcdef12-3456abcdef123456abcdef12'; process.env.AWS_LAMBDA_FUNCTION_NAME = 'my-lambda-function'; -process.env.AWS_EXECUTION_ENV = 'nodejs14.x'; +process.env.AWS_EXECUTION_ENV = 'nodejs16.x'; process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE = '128'; process.env.AWS_REGION = 'eu-west-1'; process.env._HANDLER = 'index.handler'; diff --git a/packages/tracer/tests/unit/config/EnvironmentVariablesService.test.ts b/packages/tracer/tests/unit/config/EnvironmentVariablesService.test.ts index 8ffc9c46b3..30e0db93f2 100644 --- a/packages/tracer/tests/unit/config/EnvironmentVariablesService.test.ts +++ b/packages/tracer/tests/unit/config/EnvironmentVariablesService.test.ts @@ -175,14 +175,14 @@ describe('Class: EnvironmentVariablesService', () => { test('It returns the value of the environment variable AWS_EXECUTION_ENV', () => { // Prepare - process.env.AWS_EXECUTION_ENV = 'nodejs14.x'; + process.env.AWS_EXECUTION_ENV = 'nodejs16.x'; const service = new EnvironmentVariablesService(); // Act const value = service.getAwsExecutionEnv(); // Assess - expect(value).toEqual('nodejs14.x'); + expect(value).toEqual('nodejs16.x'); }); }); diff --git a/packages/tracer/tests/unit/helpers.test.ts b/packages/tracer/tests/unit/helpers.test.ts index 7fdf7823d7..d74b478ae8 100644 --- a/packages/tracer/tests/unit/helpers.test.ts +++ b/packages/tracer/tests/unit/helpers.test.ts @@ -220,7 +220,7 @@ describe('Helper: createTracer function', () => { test('when AWS_EXECUTION_ENV environment variable is set, tracing is enabled', () => { // Prepare - process.env.AWS_EXECUTION_ENV = 'nodejs14.x'; + process.env.AWS_EXECUTION_ENV = 'nodejs16.x'; // Act const tracer = createTracer();