From 3ae08c4c83d3455deac7d4946fef250b770fd97b Mon Sep 17 00:00:00 2001 From: dnalborczyk Date: Tue, 31 May 2022 20:12:43 -0400 Subject: [PATCH] feat: add new runtimes (#1464) --- src/config/supportedRuntimes.js | 20 +++------- tests/_setupTeardown/npmInstall.js | 8 +--- .../python/python2.7/dockerPython2.7.test.js | 39 ------------------- .../docker/python/python2.7/handler.py | 11 ------ .../docker/python/python2.7/serverless.yml | 24 ------------ tests/integration/python/python2/handler.py | 11 ------ .../python/python2/python2.test.js | 39 ------------------- .../integration/python/python2/serverless.yml | 20 ---------- 8 files changed, 7 insertions(+), 165 deletions(-) delete mode 100644 tests/integration/docker/python/python2.7/dockerPython2.7.test.js delete mode 100644 tests/integration/docker/python/python2.7/handler.py delete mode 100644 tests/integration/docker/python/python2.7/serverless.yml delete mode 100644 tests/integration/python/python2/handler.py delete mode 100644 tests/integration/python/python2/python2.test.js delete mode 100644 tests/integration/python/python2/serverless.yml diff --git a/src/config/supportedRuntimes.js b/src/config/supportedRuntimes.js index c61d5514e..5d5352358 100644 --- a/src/config/supportedRuntimes.js +++ b/src/config/supportedRuntimes.js @@ -3,38 +3,28 @@ // .NET CORE export const supportedDotnetcore = new Set([ - // deprecated - // 'dotnetcore1.0', - // 'dotnetcore2.0', - // supported - // 'dotnetcore2.1' + // 'dotnet6', + // 'dotnetcore3.1', ]) // GO export const supportedGo = new Set(['go1.x']) // JAVA -export const supportedJava = new Set(['java8', 'java11']) +export const supportedJava = new Set(['java8', 'java8.al2', 'java11']) // NODE.JS export const supportedNodejs = new Set([ - // deprecated, but still working - 'nodejs4.3', - 'nodejs6.10', - 'nodejs8.10', - // supported - 'nodejs10.x', 'nodejs12.x', 'nodejs14.x', 'nodejs16.x', ]) // PROVIDED -export const supportedProvided = new Set(['provided']) +export const supportedProvided = new Set(['provided', 'provided.al2']) // PYTHON export const supportedPython = new Set([ - 'python2.7', 'python3.6', 'python3.7', 'python3.8', @@ -42,7 +32,7 @@ export const supportedPython = new Set([ ]) // RUBY -export const supportedRuby = new Set(['ruby2.5', 'ruby2.7']) +export const supportedRuby = new Set(['ruby2.7']) // deprecated runtimes // https://docs.aws.amazon.com/lambda/latest/dg/runtime-support-policy.html diff --git a/tests/_setupTeardown/npmInstall.js b/tests/_setupTeardown/npmInstall.js index 89e90dcfc..8dbc081c9 100644 --- a/tests/_setupTeardown/npmInstall.js +++ b/tests/_setupTeardown/npmInstall.js @@ -8,7 +8,7 @@ import { detectExecutable, } from '../../src/utils/index.js' -const executables = ['java', 'python2', 'python3', 'ruby'] +const executables = ['java', 'python3', 'ruby'] const testFolders = [ '../integration/docker/access-host/src', @@ -36,7 +36,7 @@ function installNpmModules(dirPath) { } export default async function npmInstall() { - const [python2, python3, ruby, java] = await promiseMap( + const [java, python3, ruby] = await promiseMap( executables, (executable) => executable === 'java' @@ -66,10 +66,6 @@ export default async function npmInstall() { env.JAVA_DETECTED = true } - if (python2) { - env.PYTHON2_DETECTED = true - } - if (python3) { env.PYTHON3_DETECTED = true } diff --git a/tests/integration/docker/python/python2.7/dockerPython2.7.test.js b/tests/integration/docker/python/python2.7/dockerPython2.7.test.js deleted file mode 100644 index f37cdb5af..000000000 --- a/tests/integration/docker/python/python2.7/dockerPython2.7.test.js +++ /dev/null @@ -1,39 +0,0 @@ -import assert from 'node:assert' -import { resolve } from 'node:path' -import { env } from 'node:process' -import fetch from 'node-fetch' -import { joinUrl, setup, teardown } from '../../../_testHelpers/index.js' - -// "Could not find 'Docker', skipping 'Docker' tests." -const _describe = env.DOCKER_DETECTED ? describe : describe.skip - -_describe('Python 2.7 with Docker tests', function desc() { - this.timeout(120000) - - beforeEach(() => - setup({ - servicePath: resolve(__dirname), - }), - ) - - afterEach(() => teardown()) - - // - ;[ - { - description: 'should work with python2.7 in docker container', - expected: { - message: 'Hello Python 2.7!', - }, - path: '/dev/hello', - }, - ].forEach(({ description, expected, path }) => { - it(description, async () => { - const url = joinUrl(env.TEST_BASE_URL, path) - const response = await fetch(url) - const json = await response.json() - - assert.deepEqual(json, expected) - }) - }) -}) diff --git a/tests/integration/docker/python/python2.7/handler.py b/tests/integration/docker/python/python2.7/handler.py deleted file mode 100644 index db9fd4a74..000000000 --- a/tests/integration/docker/python/python2.7/handler.py +++ /dev/null @@ -1,11 +0,0 @@ -import json - -def hello(event, context): - body = { - "message": "Hello Python 2.7!" - } - - return { - "body": json.dumps(body), - "statusCode": 200, - } diff --git a/tests/integration/docker/python/python2.7/serverless.yml b/tests/integration/docker/python/python2.7/serverless.yml deleted file mode 100644 index 5fb68e39f..000000000 --- a/tests/integration/docker/python/python2.7/serverless.yml +++ /dev/null @@ -1,24 +0,0 @@ -service: docker-python-2.7-tests - -plugins: - - ./../../../../../ - -provider: - memorySize: 128 - name: aws - region: us-east-1 # default - runtime: python2.7 - stage: dev - versionFunctions: false - -custom: - serverless-offline: - useDocker: true - -functions: - hello: - events: - - http: - method: get - path: hello - handler: handler.hello diff --git a/tests/integration/python/python2/handler.py b/tests/integration/python/python2/handler.py deleted file mode 100644 index 8064fe490..000000000 --- a/tests/integration/python/python2/handler.py +++ /dev/null @@ -1,11 +0,0 @@ -import json - -def hello(event, context): - body = { - "message": "Hello Python 2!" - } - - return { - "body": json.dumps(body), - "statusCode": 200, - } diff --git a/tests/integration/python/python2/python2.test.js b/tests/integration/python/python2/python2.test.js deleted file mode 100644 index dc92acd04..000000000 --- a/tests/integration/python/python2/python2.test.js +++ /dev/null @@ -1,39 +0,0 @@ -import assert from 'node:assert' -import { resolve } from 'node:path' -import { env } from 'node:process' -import fetch from 'node-fetch' -import { joinUrl, setup, teardown } from '../../_testHelpers/index.js' - -// Could not find 'Python 2' executable, skipping 'Python' tests. -const _describe = env.PYTHON2_DETECTED ? describe : describe.skip - -_describe('Python 2 tests', function desc() { - this.timeout(60000) - - beforeEach(() => - setup({ - servicePath: resolve(__dirname), - }), - ) - - afterEach(() => teardown()) - - // - ;[ - { - description: 'should work with python 2', - expected: { - message: 'Hello Python 2!', - }, - path: '/dev/hello', - }, - ].forEach(({ description, expected, path }) => { - it(description, async () => { - const url = joinUrl(env.TEST_BASE_URL, path) - const response = await fetch(url) - const json = await response.json() - - assert.deepEqual(json, expected) - }) - }) -}) diff --git a/tests/integration/python/python2/serverless.yml b/tests/integration/python/python2/serverless.yml deleted file mode 100644 index 8b8005c84..000000000 --- a/tests/integration/python/python2/serverless.yml +++ /dev/null @@ -1,20 +0,0 @@ -service: python-2-tests - -plugins: - - ../../../../ - -provider: - memorySize: 128 - name: aws - region: us-east-1 # default - runtime: python2.7 - stage: dev - versionFunctions: false - -functions: - hello: - events: - - http: - method: get - path: hello - handler: handler.hello