From feed0b0328d0e932dbdaa718b2b1727e851aa8f6 Mon Sep 17 00:00:00 2001 From: Daniel Mil <84205762+mildaniel@users.noreply.github.com> Date: Wed, 7 Feb 2024 11:40:23 -0800 Subject: [PATCH] chore: Deprecate nodejs12.x and nodejs14.x (#129) --- .github/workflows/build.yml | 2 - Makefile | 2 - build-image-src/Dockerfile-nodejs12x | 71 ---------- build-image-src/Dockerfile-nodejs14x | 71 ---------- build-image-src/build_all_images.sh | 4 - pytest.ini | 2 - tests/apps/nodejs12.x/sam-test-app/.gitignore | 129 ------------------ .../nodejs12.x/sam-test-app/events/event.json | 62 --------- .../sam-test-app/hello-world/.npmignore | 1 - .../sam-test-app/hello-world/app.js | 33 ----- .../sam-test-app/hello-world/package.json | 21 --- .../nodejs12.x/sam-test-app/template.yaml | 39 ------ tests/apps/nodejs14.x/sam-test-app/.gitignore | 129 ------------------ .../nodejs14.x/sam-test-app/events/event.json | 62 --------- .../sam-test-app/hello-world/.npmignore | 1 - .../sam-test-app/hello-world/app.js | 33 ----- .../sam-test-app/hello-world/package.json | 19 --- .../nodejs14.x/sam-test-app/template.yaml | 39 ------ tests/test_build_images.py | 67 --------- 19 files changed, 787 deletions(-) delete mode 100644 build-image-src/Dockerfile-nodejs12x delete mode 100644 build-image-src/Dockerfile-nodejs14x delete mode 100644 tests/apps/nodejs12.x/sam-test-app/.gitignore delete mode 100644 tests/apps/nodejs12.x/sam-test-app/events/event.json delete mode 100644 tests/apps/nodejs12.x/sam-test-app/hello-world/.npmignore delete mode 100644 tests/apps/nodejs12.x/sam-test-app/hello-world/app.js delete mode 100644 tests/apps/nodejs12.x/sam-test-app/hello-world/package.json delete mode 100644 tests/apps/nodejs12.x/sam-test-app/template.yaml delete mode 100644 tests/apps/nodejs14.x/sam-test-app/.gitignore delete mode 100644 tests/apps/nodejs14.x/sam-test-app/events/event.json delete mode 100644 tests/apps/nodejs14.x/sam-test-app/hello-world/.npmignore delete mode 100644 tests/apps/nodejs14.x/sam-test-app/hello-world/app.js delete mode 100644 tests/apps/nodejs14.x/sam-test-app/hello-world/package.json delete mode 100644 tests/apps/nodejs14.x/sam-test-app/template.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a3c21a..ac88cc1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,8 +72,6 @@ jobs: - "java11" - "java17" - "java21" - - "nodejs12x" - - "nodejs14x" - "nodejs16x" - "nodejs18x" - "nodejs20x" diff --git a/Makefile b/Makefile index 9f1c312..47d577b 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,6 @@ IS_java8_al2 := java8.al2 IS_java11 := java11 IS_java17 := java17 IS_java21 := java21 -IS_nodejs12x := nodejs12.x -IS_nodejs14x := nodejs14.x IS_nodejs16x := nodejs16.x IS_nodejs18x := nodejs18.x IS_nodejs20x := nodejs20.x diff --git a/build-image-src/Dockerfile-nodejs12x b/build-image-src/Dockerfile-nodejs12x deleted file mode 100644 index 92f7965..0000000 --- a/build-image-src/Dockerfile-nodejs12x +++ /dev/null @@ -1,71 +0,0 @@ -ARG IMAGE_ARCH -FROM public.ecr.aws/lambda/nodejs:12-$IMAGE_ARCH - -ENV PATH=/var/lang/bin:$PATH \ - LD_LIBRARY_PATH=/var/lang/lib:$LD_LIBRARY_PATH \ - AWS_EXECUTION_ENV=AWS_Lambda_nodejs12.x \ - NODE_PATH=/opt/nodejs/node12/node_modules:/opt/nodejs/node_modules:/var/runtime/node_modules - -RUN yum groupinstall -y development && \ - yum install -d1 -y \ - yum \ - tar \ - gzip \ - unzip \ - jq \ - grep \ - curl \ - make \ - rsync \ - binutils \ - gcc-c++ \ - procps \ - libgmp3-dev \ - zlib1g-dev \ - libmpc-devel \ - amazon-linux-extras - -# Install extras so that Python 3.8 is installable -# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras -RUN amazon-linux-extras enable python3.8 && \ - yum clean metadata && \ - yum install -y python38 python38-devel && \ - yum clean all && \ - ln -s /usr/bin/python3.8 /usr/bin/python3 && \ - ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \ - python3 --version && \ - pip3 --version - -# Install AWS CLI -ARG AWS_CLI_ARCH -RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$AWS_CLI_ARCH.zip" -o "awscliv2.zip" && unzip awscliv2.zip && ./aws/install && rm awscliv2.zip && rm -rf ./aws - -# Install SAM CLI from native installer -ARG SAM_CLI_VERSION -# need to redefine since ARG is not available after FROM tag: https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact -ARG IMAGE_ARCH -RUN curl -L "https://github.com/aws/aws-sam-cli/releases/download/v$SAM_CLI_VERSION/aws-sam-cli-linux-$IMAGE_ARCH.zip" -o "samcli.zip" && \ - unzip samcli.zip -d sam-installation && ./sam-installation/install && \ - rm samcli.zip && rm -rf sam-installation && sam --version - -# Prepare virtualenv for lambda builders -RUN python3 -m venv --without-pip /usr/local/opt/lambda-builders -RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py -RUN /usr/local/opt/lambda-builders/bin/python3 get-pip.py -# Install lambda builders in a dedicated Python virtualenv -RUN AWS_LB_VERSION=$(curl -sSL https://raw.githubusercontent.com/aws/aws-sam-cli/v$SAM_CLI_VERSION/requirements/base.txt | grep aws_lambda_builders | cut -d= -f3) && \ - /usr/local/opt/lambda-builders/bin/pip3 --no-cache-dir install "aws-lambda-builders==$AWS_LB_VERSION" - -ENV PATH=$PATH:/usr/local/opt/lambda-builders/bin - -ENV LANG=en_US.UTF-8 - -# Wheel is required by SAM CLI to build libraries like cryptography. It needs to be installed in the system -# Python for it to be picked up during `sam build` -RUN pip3 install wheel - -COPY ATTRIBUTION.txt / - -# Compatible with initial base image -ENTRYPOINT [] -CMD ["/bin/bash"] \ No newline at end of file diff --git a/build-image-src/Dockerfile-nodejs14x b/build-image-src/Dockerfile-nodejs14x deleted file mode 100644 index 766ac6a..0000000 --- a/build-image-src/Dockerfile-nodejs14x +++ /dev/null @@ -1,71 +0,0 @@ -ARG IMAGE_ARCH -FROM public.ecr.aws/lambda/nodejs:14-$IMAGE_ARCH - -ENV PATH=/var/lang/bin:$PATH \ - LD_LIBRARY_PATH=/var/lang/lib:$LD_LIBRARY_PATH \ - AWS_EXECUTION_ENV=AWS_Lambda_nodejs14.x \ - NODE_PATH=/opt/nodejs/node14/node_modules:/opt/nodejs/node_modules:/var/runtime/node_modules - -RUN yum groupinstall -y development && \ - yum install -d1 -y \ - yum \ - tar \ - gzip \ - unzip \ - jq \ - grep \ - curl \ - make \ - rsync \ - binutils \ - gcc-c++ \ - procps \ - libgmp3-dev \ - zlib1g-dev \ - libmpc-devel \ - amazon-linux-extras - -# Install extras so that Python 3.8 is installable -# https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras -RUN amazon-linux-extras enable python3.8 && \ - yum clean metadata && \ - yum install -y python38 python38-devel && \ - yum clean all && \ - ln -s /usr/bin/python3.8 /usr/bin/python3 && \ - ln -s /usr/bin/pip3.8 /usr/bin/pip3 && \ - python3 --version && \ - pip3 --version - -# Install AWS CLI -ARG AWS_CLI_ARCH -RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$AWS_CLI_ARCH.zip" -o "awscliv2.zip" && unzip awscliv2.zip && ./aws/install && rm awscliv2.zip && rm -rf ./aws - -# Install SAM CLI from native installer -ARG SAM_CLI_VERSION -# need to redefine since ARG is not available after FROM tag: https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact -ARG IMAGE_ARCH -RUN curl -L "https://github.com/aws/aws-sam-cli/releases/download/v$SAM_CLI_VERSION/aws-sam-cli-linux-$IMAGE_ARCH.zip" -o "samcli.zip" && \ - unzip samcli.zip -d sam-installation && ./sam-installation/install && \ - rm samcli.zip && rm -rf sam-installation && sam --version - -# Prepare virtualenv for lambda builders -RUN python3 -m venv --without-pip /usr/local/opt/lambda-builders -RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py -RUN /usr/local/opt/lambda-builders/bin/python3 get-pip.py -# Install lambda builders in a dedicated Python virtualenv -RUN AWS_LB_VERSION=$(curl -sSL https://raw.githubusercontent.com/aws/aws-sam-cli/v$SAM_CLI_VERSION/requirements/base.txt | grep aws_lambda_builders | cut -d= -f3) && \ - /usr/local/opt/lambda-builders/bin/pip3 --no-cache-dir install "aws-lambda-builders==$AWS_LB_VERSION" - -ENV PATH=$PATH:/usr/local/opt/lambda-builders/bin - -ENV LANG=en_US.UTF-8 - -# Wheel is required by SAM CLI to build libraries like cryptography. It needs to be installed in the system -# Python for it to be picked up during `sam build` -RUN pip3 install wheel - -COPY ATTRIBUTION.txt / - -# Compatible with initial base image -ENTRYPOINT [] -CMD ["/bin/bash"] \ No newline at end of file diff --git a/build-image-src/build_all_images.sh b/build-image-src/build_all_images.sh index fc821db..5edca0d 100755 --- a/build-image-src/build_all_images.sh +++ b/build-image-src/build_all_images.sh @@ -30,8 +30,6 @@ docker build -f Dockerfile-java8_al2 -t amazon/aws-sam-cli-build-image-java8.al2 docker build -f Dockerfile-java11 -t amazon/aws-sam-cli-build-image-java11:x86_64 --platform linux/amd64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=x86_64 --build-arg IMAGE_ARCH=x86_64 . & docker build -f Dockerfile-java17 -t amazon/aws-sam-cli-build-image-java17:x86_64 --platform linux/amd64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=x86_64 --build-arg IMAGE_ARCH=x86_64 . & docker build -f Dockerfile-java21 -t amazon/aws-sam-cli-build-image-java21:x86_64 --platform linux/amd64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=x86_64 --build-arg IMAGE_ARCH=x86_64 . & -docker build -f Dockerfile-nodejs12x -t amazon/aws-sam-cli-build-image-nodejs12.x:x86_64 --platform linux/amd64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=x86_64 --build-arg IMAGE_ARCH=x86_64 . & -docker build -f Dockerfile-nodejs14x -t amazon/aws-sam-cli-build-image-nodejs14.x:x86_64 --platform linux/amd64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=x86_64 --build-arg IMAGE_ARCH=x86_64 . & docker build -f Dockerfile-nodejs16x -t amazon/aws-sam-cli-build-image-nodejs16.x:x86_64 --platform linux/amd64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=x86_64 --build-arg IMAGE_ARCH=x86_64 . & docker build -f Dockerfile-nodejs18x -t amazon/aws-sam-cli-build-image-nodejs18.x:x86_64 --platform linux/amd64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=x86_64 --build-arg IMAGE_ARCH=x86_64 . & docker build -f Dockerfile-nodejs20x -t amazon/aws-sam-cli-build-image-nodejs20.x:x86_64 --platform linux/amd64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=x86_64 --build-arg IMAGE_ARCH=x86_64 . & @@ -54,8 +52,6 @@ docker build -f Dockerfile-java8_al2 -t amazon/aws-sam-cli-build-image-java8.al2 docker build -f Dockerfile-java11 -t amazon/aws-sam-cli-build-image-java11:arm64 --platform linux/arm64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=aarch64 --build-arg IMAGE_ARCH=arm64 . & docker build -f Dockerfile-java17 -t amazon/aws-sam-cli-build-image-java17:arm64 --platform linux/arm64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=aarch64 --build-arg IMAGE_ARCH=arm64 . & docker build -f Dockerfile-java21 -t amazon/aws-sam-cli-build-image-java21:arm64 --platform linux/arm64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=aarch64 --build-arg IMAGE_ARCH=arm64 . & -docker build -f Dockerfile-nodejs12x -t amazon/aws-sam-cli-build-image-nodejs12.x:arm64 --platform linux/arm64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=aarch64 --build-arg IMAGE_ARCH=arm64 . & -docker build -f Dockerfile-nodejs14x -t amazon/aws-sam-cli-build-image-nodejs14.x:arm64 --platform linux/arm64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=aarch64 --build-arg IMAGE_ARCH=arm64 . & docker build -f Dockerfile-nodejs16x -t amazon/aws-sam-cli-build-image-nodejs16.x:arm64 --platform linux/arm64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=aarch64 --build-arg IMAGE_ARCH=arm64 . & docker build -f Dockerfile-nodejs18x -t amazon/aws-sam-cli-build-image-nodejs18.x:arm64 --platform linux/arm64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=aarch64 --build-arg IMAGE_ARCH=arm64 . & docker build -f Dockerfile-nodejs20x -t amazon/aws-sam-cli-build-image-nodejs20.x:arm64 --platform linux/arm64 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION --build-arg AWS_CLI_ARCH=aarch64 --build-arg IMAGE_ARCH=arm64 . & diff --git a/pytest.ini b/pytest.ini index 6c6fc3d..c92c95d 100644 --- a/pytest.ini +++ b/pytest.ini @@ -10,8 +10,6 @@ markers = java11 java17 java21 - nodejs12x - nodejs14x nodejs16x nodejs18x nodejs20x diff --git a/tests/apps/nodejs12.x/sam-test-app/.gitignore b/tests/apps/nodejs12.x/sam-test-app/.gitignore deleted file mode 100644 index eb1db5f..0000000 --- a/tests/apps/nodejs12.x/sam-test-app/.gitignore +++ /dev/null @@ -1,129 +0,0 @@ - -# Created by https://www.gitignore.io/api/osx,node,linux,windows - -### Linux ### -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - -### Node ### -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - - -### OSX ### -*.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -# End of https://www.gitignore.io/api/osx,node,linux,windows \ No newline at end of file diff --git a/tests/apps/nodejs12.x/sam-test-app/events/event.json b/tests/apps/nodejs12.x/sam-test-app/events/event.json deleted file mode 100644 index 070ad8e..0000000 --- a/tests/apps/nodejs12.x/sam-test-app/events/event.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "body": "{\"message\": \"hello world\"}", - "resource": "/{proxy+}", - "path": "/path/to/resource", - "httpMethod": "POST", - "isBase64Encoded": false, - "queryStringParameters": { - "foo": "bar" - }, - "pathParameters": { - "proxy": "/path/to/resource" - }, - "stageVariables": { - "baz": "qux" - }, - "headers": { - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", - "Accept-Encoding": "gzip, deflate, sdch", - "Accept-Language": "en-US,en;q=0.8", - "Cache-Control": "max-age=0", - "CloudFront-Forwarded-Proto": "https", - "CloudFront-Is-Desktop-Viewer": "true", - "CloudFront-Is-Mobile-Viewer": "false", - "CloudFront-Is-SmartTV-Viewer": "false", - "CloudFront-Is-Tablet-Viewer": "false", - "CloudFront-Viewer-Country": "US", - "Host": "1234567890.execute-api.us-east-1.amazonaws.com", - "Upgrade-Insecure-Requests": "1", - "User-Agent": "Custom User Agent String", - "Via": "1.1 08f323deadbeefa7af34d5feb414ce27.cloudfront.net (CloudFront)", - "X-Amz-Cf-Id": "cDehVQoZnx43VYQb9j2-nvCh-9z396Uhbp027Y2JvkCPNLmGJHqlaA==", - "X-Forwarded-For": "127.0.0.1, 127.0.0.2", - "X-Forwarded-Port": "443", - "X-Forwarded-Proto": "https" - }, - "requestContext": { - "accountId": "123456789012", - "resourceId": "123456", - "stage": "prod", - "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef", - "requestTime": "09/Apr/2015:12:34:56 +0000", - "requestTimeEpoch": 1428582896000, - "identity": { - "cognitoIdentityPoolId": null, - "accountId": null, - "cognitoIdentityId": null, - "caller": null, - "accessKey": null, - "sourceIp": "127.0.0.1", - "cognitoAuthenticationType": null, - "cognitoAuthenticationProvider": null, - "userArn": null, - "userAgent": "Custom User Agent String", - "user": null - }, - "path": "/prod/path/to/resource", - "resourcePath": "/{proxy+}", - "httpMethod": "POST", - "apiId": "1234567890", - "protocol": "HTTP/1.1" - } -} diff --git a/tests/apps/nodejs12.x/sam-test-app/hello-world/.npmignore b/tests/apps/nodejs12.x/sam-test-app/hello-world/.npmignore deleted file mode 100644 index e7e1fb0..0000000 --- a/tests/apps/nodejs12.x/sam-test-app/hello-world/.npmignore +++ /dev/null @@ -1 +0,0 @@ -tests/* diff --git a/tests/apps/nodejs12.x/sam-test-app/hello-world/app.js b/tests/apps/nodejs12.x/sam-test-app/hello-world/app.js deleted file mode 100644 index 695d1b5..0000000 --- a/tests/apps/nodejs12.x/sam-test-app/hello-world/app.js +++ /dev/null @@ -1,33 +0,0 @@ -// const axios = require('axios') -// const url = 'http://checkip.amazonaws.com/'; -let response; - -/** - * - * Event doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format - * @param {Object} event - API Gateway Lambda Proxy Input Format - * - * Context doc: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html - * @param {Object} context - * - * Return doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html - * @returns {Object} object - API Gateway Lambda Proxy Output Format - * - */ -exports.lambdaHandler = async (event, context) => { - try { - // const ret = await axios(url); - response = { - 'statusCode': 200, - 'body': JSON.stringify({ - message: 'hello world', - // location: ret.data.trim() - }) - } - } catch (err) { - console.log(err); - return err; - } - - return response -}; diff --git a/tests/apps/nodejs12.x/sam-test-app/hello-world/package.json b/tests/apps/nodejs12.x/sam-test-app/hello-world/package.json deleted file mode 100644 index 8e89399..0000000 --- a/tests/apps/nodejs12.x/sam-test-app/hello-world/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "hello_world", - "version": "1.0.0", - "description": "hello world sample for NodeJS", - "main": "app.js", - "repository": "https://github.com/awslabs/aws-sam-cli/tree/develop/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs", - "author": "SAM CLI", - "license": "MIT", - "dependencies": { - "axios": "^0.21.1" - }, - "scripts": { - "test": "mocha tests/unit/", - "integ-test": "mocha tests/integration/" - }, - "devDependencies": { - "aws-sdk": "^2.815.0", - "chai": "^4.2.0", - "mocha": "^8.2.1" - } -} diff --git a/tests/apps/nodejs12.x/sam-test-app/template.yaml b/tests/apps/nodejs12.x/sam-test-app/template.yaml deleted file mode 100644 index 1cace45..0000000 --- a/tests/apps/nodejs12.x/sam-test-app/template.yaml +++ /dev/null @@ -1,39 +0,0 @@ -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Description: > - sam-test-app4 - - Sample SAM Template for sam-test-app4 - -# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst -Globals: - Function: - Timeout: 3 - -Resources: - HelloWorldFunction: - Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction - Properties: - CodeUri: hello-world/ - Handler: app.lambdaHandler - Runtime: nodejs12.x - Events: - HelloWorld: - Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api - Properties: - Path: /hello - Method: get - -Outputs: - # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function - # Find out more about other implicit resources you can reference within SAM - # https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api - HelloWorldApi: - Description: "API Gateway endpoint URL for Prod stage for Hello World function" - Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/" - HelloWorldFunction: - Description: "Hello World Lambda Function ARN" - Value: !GetAtt HelloWorldFunction.Arn - HelloWorldFunctionIamRole: - Description: "Implicit IAM Role created for Hello World function" - Value: !GetAtt HelloWorldFunctionRole.Arn diff --git a/tests/apps/nodejs14.x/sam-test-app/.gitignore b/tests/apps/nodejs14.x/sam-test-app/.gitignore deleted file mode 100644 index eb1db5f..0000000 --- a/tests/apps/nodejs14.x/sam-test-app/.gitignore +++ /dev/null @@ -1,129 +0,0 @@ - -# Created by https://www.gitignore.io/api/osx,node,linux,windows - -### Linux ### -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - -### Node ### -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - - -### OSX ### -*.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -# End of https://www.gitignore.io/api/osx,node,linux,windows \ No newline at end of file diff --git a/tests/apps/nodejs14.x/sam-test-app/events/event.json b/tests/apps/nodejs14.x/sam-test-app/events/event.json deleted file mode 100644 index 070ad8e..0000000 --- a/tests/apps/nodejs14.x/sam-test-app/events/event.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "body": "{\"message\": \"hello world\"}", - "resource": "/{proxy+}", - "path": "/path/to/resource", - "httpMethod": "POST", - "isBase64Encoded": false, - "queryStringParameters": { - "foo": "bar" - }, - "pathParameters": { - "proxy": "/path/to/resource" - }, - "stageVariables": { - "baz": "qux" - }, - "headers": { - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", - "Accept-Encoding": "gzip, deflate, sdch", - "Accept-Language": "en-US,en;q=0.8", - "Cache-Control": "max-age=0", - "CloudFront-Forwarded-Proto": "https", - "CloudFront-Is-Desktop-Viewer": "true", - "CloudFront-Is-Mobile-Viewer": "false", - "CloudFront-Is-SmartTV-Viewer": "false", - "CloudFront-Is-Tablet-Viewer": "false", - "CloudFront-Viewer-Country": "US", - "Host": "1234567890.execute-api.us-east-1.amazonaws.com", - "Upgrade-Insecure-Requests": "1", - "User-Agent": "Custom User Agent String", - "Via": "1.1 08f323deadbeefa7af34d5feb414ce27.cloudfront.net (CloudFront)", - "X-Amz-Cf-Id": "cDehVQoZnx43VYQb9j2-nvCh-9z396Uhbp027Y2JvkCPNLmGJHqlaA==", - "X-Forwarded-For": "127.0.0.1, 127.0.0.2", - "X-Forwarded-Port": "443", - "X-Forwarded-Proto": "https" - }, - "requestContext": { - "accountId": "123456789012", - "resourceId": "123456", - "stage": "prod", - "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef", - "requestTime": "09/Apr/2015:12:34:56 +0000", - "requestTimeEpoch": 1428582896000, - "identity": { - "cognitoIdentityPoolId": null, - "accountId": null, - "cognitoIdentityId": null, - "caller": null, - "accessKey": null, - "sourceIp": "127.0.0.1", - "cognitoAuthenticationType": null, - "cognitoAuthenticationProvider": null, - "userArn": null, - "userAgent": "Custom User Agent String", - "user": null - }, - "path": "/prod/path/to/resource", - "resourcePath": "/{proxy+}", - "httpMethod": "POST", - "apiId": "1234567890", - "protocol": "HTTP/1.1" - } -} diff --git a/tests/apps/nodejs14.x/sam-test-app/hello-world/.npmignore b/tests/apps/nodejs14.x/sam-test-app/hello-world/.npmignore deleted file mode 100644 index e7e1fb0..0000000 --- a/tests/apps/nodejs14.x/sam-test-app/hello-world/.npmignore +++ /dev/null @@ -1 +0,0 @@ -tests/* diff --git a/tests/apps/nodejs14.x/sam-test-app/hello-world/app.js b/tests/apps/nodejs14.x/sam-test-app/hello-world/app.js deleted file mode 100644 index 695d1b5..0000000 --- a/tests/apps/nodejs14.x/sam-test-app/hello-world/app.js +++ /dev/null @@ -1,33 +0,0 @@ -// const axios = require('axios') -// const url = 'http://checkip.amazonaws.com/'; -let response; - -/** - * - * Event doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format - * @param {Object} event - API Gateway Lambda Proxy Input Format - * - * Context doc: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html - * @param {Object} context - * - * Return doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html - * @returns {Object} object - API Gateway Lambda Proxy Output Format - * - */ -exports.lambdaHandler = async (event, context) => { - try { - // const ret = await axios(url); - response = { - 'statusCode': 200, - 'body': JSON.stringify({ - message: 'hello world', - // location: ret.data.trim() - }) - } - } catch (err) { - console.log(err); - return err; - } - - return response -}; diff --git a/tests/apps/nodejs14.x/sam-test-app/hello-world/package.json b/tests/apps/nodejs14.x/sam-test-app/hello-world/package.json deleted file mode 100644 index 2baf0ac..0000000 --- a/tests/apps/nodejs14.x/sam-test-app/hello-world/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "hello_world", - "version": "1.0.0", - "description": "hello world sample for NodeJS", - "main": "app.js", - "repository": "https://github.com/awslabs/aws-sam-cli/tree/develop/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs", - "author": "SAM CLI", - "license": "MIT", - "dependencies": { - "axios": "^0.21.1" - }, - "scripts": { - "test": "mocha tests/unit/" - }, - "devDependencies": { - "chai": "^4.2.0", - "mocha": "^8.2.1" - } -} diff --git a/tests/apps/nodejs14.x/sam-test-app/template.yaml b/tests/apps/nodejs14.x/sam-test-app/template.yaml deleted file mode 100644 index 4f51973..0000000 --- a/tests/apps/nodejs14.x/sam-test-app/template.yaml +++ /dev/null @@ -1,39 +0,0 @@ -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Description: > - sam-test-app5 - - Sample SAM Template for sam-test-app5 - -# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst -Globals: - Function: - Timeout: 3 - -Resources: - HelloWorldFunction: - Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction - Properties: - CodeUri: hello-world/ - Handler: app.lambdaHandler - Runtime: nodejs14.x - Events: - HelloWorld: - Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api - Properties: - Path: /hello - Method: get - -Outputs: - # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function - # Find out more about other implicit resources you can reference within SAM - # https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api - HelloWorldApi: - Description: "API Gateway endpoint URL for Prod stage for Hello World function" - Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/" - HelloWorldFunction: - Description: "Hello World Lambda Function ARN" - Value: !GetAtt HelloWorldFunction.Arn - HelloWorldFunctionIamRole: - Description: "Implicit IAM Role created for Hello World function" - Value: !GetAtt HelloWorldFunctionRole.Arn diff --git a/tests/test_build_images.py b/tests/test_build_images.py index 5197533..e790314 100644 --- a/tests/test_build_images.py +++ b/tests/test_build_images.py @@ -260,73 +260,6 @@ def test_packages(self): self.assertTrue(self.is_package_present("gradle")) self.assertTrue(self.is_architecture("aarch64")) -@pytest.mark.nodejs12x -class TestBINode12(BuildImageBase): - __test__ = True - - @classmethod - def setUpClass(cls): - super().setUpClass("nodejs12.x", "Dockerfile-nodejs12x", "npm", tag="x86_64") - - def test_packages(self): - """ - Test packages specific to this build image - """ - self.assertTrue(self.check_package_output("node --version", "v12.")) - self.assertTrue(self.is_package_present("npm")) - self.assertTrue(self.is_architecture("x86_64")) - - -@pytest.mark.nodejs12x -class TestBINode12ForArm(BuildImageBase): - __test__ = True - - @classmethod - def setUpClass(cls): - super().setUpClass("nodejs12.x", "Dockerfile-nodejs12x", "npm", tag="arm64") - - def test_packages(self): - """ - Test packages specific to this build image - """ - self.assertTrue(self.check_package_output("node --version", "v12.")) - self.assertTrue(self.is_package_present("npm")) - self.assertTrue(self.is_architecture("aarch64")) - - -@pytest.mark.nodejs14x -class TestBINode14(BuildImageBase): - __test__ = True - - @classmethod - def setUpClass(cls): - super().setUpClass("nodejs14.x", "Dockerfile-nodejs14x", "npm", tag="x86_64") - - def test_packages(self): - """ - Test packages specific to this build image - """ - self.assertTrue(self.check_package_output("node --version", "v14.")) - self.assertTrue(self.is_package_present("npm")) - self.assertTrue(self.is_architecture("x86_64")) - - -@pytest.mark.nodejs14x -class TestBINode14ForArm(BuildImageBase): - __test__ = True - - @classmethod - def setUpClass(cls): - super().setUpClass("nodejs14.x", "Dockerfile-nodejs14x", "npm", tag="arm64") - - def test_packages(self): - """ - Test packages specific to this build image - """ - self.assertTrue(self.check_package_output("node --version", "v14.")) - self.assertTrue(self.is_package_present("npm")) - self.assertTrue(self.is_architecture("aarch64")) - @pytest.mark.nodejs16x class TestBINode16(BuildImageBase):