Skip to content

Commit

Permalink
Test matrix update: add Node.js 20.x / remove 14.x
Browse files Browse the repository at this point in the history
Update unit tests to deal with latest runtimes and runtime deprecations
Update deps and changelog
  • Loading branch information
ryanblock committed Jan 9, 2024
1 parent 02824cd commit 6f63669
Show file tree
Hide file tree
Showing 24 changed files with 167 additions and 132 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [ 14.x ]
node-version: [ 16.x ]
os: [ windows-latest, ubuntu-latest, macOS-latest ]

# Go
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
ruby-version: '3.2'

- name: Set up Deno
uses: denolib/setup-deno@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [ 14.x, 16.x, 18.x ]
node-version: [ 16.x, 18.x, 20.x ]
os: [ windows-latest, ubuntu-latest, macOS-latest ]

# Go
Expand Down
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

---

## [6.0.0] 2024-01-09

### Changed

- Transitioned from `aws-sdk` to [`aws-lite`](https://aws-lite.org)
- Breaking change: Sandbox no longer includes `aws-sdk` + `@aws-sdk/*` as dependencies; projects that rely on the AWS SDK should install those dependencies to their project directly
- Added Node.js 20.x to test matrix
- Breaking change: removed support for Node.js 14.x (now EOL, and no longer available to created in AWS Lambda)
- Updated dependencies

---

## [5.9.4] 2023-11-20

### Changed
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"src/*"
],
"dependencies": {
"@architect/asap": "~6.1.0-RC.0",
"@architect/create": "~4.2.4",
"@architect/asap": "~7.0.0-RC.0",
"@architect/create": "~5.0.0-RC.0",
"@architect/hydrate": "~3.5.1",
"@architect/inventory": "~3.6.5",
"@architect/utils": "~4.0.0-RC.1",
"@aws-lite/client": "~0.12.2",
"@aws-lite/dynamodb": "~0.3.0",
"@architect/inventory": "~4.0.0-RC.0",
"@architect/utils": "~4.0.0-RC.2",
"@aws-lite/client": "~0.13.4",
"@aws-lite/dynamodb": "~0.3.1",
"@begin/hashid": "~1.0.0",
"chalk": "4.1.2",
"chokidar": "~3.5.3",
Expand All @@ -43,7 +43,7 @@
"finalhandler": "~1.2.0",
"glob": "~10.3.10",
"http-proxy": "~1.18.1",
"lambda-runtimes": "~1.1.6",
"lambda-runtimes": "~1.1.7",
"minimist": "~1.2.8",
"router": "~1.3.8",
"run-parallel": "~1.2.0",
Expand All @@ -53,16 +53,16 @@
"tmp": "~0.2.1",
"tree-kill": "~1.2.2",
"update-notifier-cjs": "~5.1.6",
"ws": "~8.15.0"
"ws": "~8.16.0"
},
"devDependencies": {
"@architect/eslint-config": "~2.1.2",
"@architect/functions": "~7.0.0",
"@architect/req-res-fixtures": "git+https://github.com/architect/req-res-fixtures.git",
"@aws-lite/apigatewaymanagementapi": "~0.0.5",
"@aws-lite/ssm": "~0.2.1",
"@aws-lite/apigatewaymanagementapi": "~0.0.6",
"@aws-lite/ssm": "~0.2.2",
"cross-env": "~7.0.3",
"eslint": "~8.55.0",
"eslint": "~8.56.0",
"fs-extra": "~11.2.0",
"nyc": "~15.1.0",
"pkg": "~5.8.1",
Expand Down
53 changes: 30 additions & 23 deletions test/integration/http/http-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,17 @@ function runTests (runType, t) {
})
})

t.test(`${mode} get /nodejs18.x`, t => {
t.test(`${mode} get /nodejs20.x`, t => {
t.plan(15)
let rawPath = '/nodejs18.x'
let rawPath = '/nodejs20.x'
tiny.get({
url: url + rawPath
}, function _got (err, result) {
if (err) t.end(err)
else {
checkResult(t, result.body, {
message: 'Hello from get /nodejs18.x (running nodejs18.x)',
routeKey: 'GET /nodejs18.x',
message: 'Hello from get /nodejs20.x (running nodejs20.x)',
routeKey: 'GET /nodejs20.x',
rawPath,
pathParameters: undefined,
cookies: undefined,
Expand All @@ -190,17 +190,17 @@ function runTests (runType, t) {
})
})

t.test(`${mode} get /nodejs14.x`, t => {
t.test(`${mode} get /nodejs18.x`, t => {
t.plan(15)
let rawPath = '/nodejs14.x'
let rawPath = '/nodejs18.x'
tiny.get({
url: url + rawPath
}, function _got (err, result) {
if (err) t.end(err)
else {
checkResult(t, result.body, {
message: 'Hello from get /nodejs14.x (running nodejs14.x)',
routeKey: 'GET /nodejs14.x',
message: 'Hello from get /nodejs18.x (running nodejs18.x)',
routeKey: 'GET /nodejs18.x',
rawPath,
pathParameters: undefined,
cookies: undefined,
Expand Down Expand Up @@ -238,18 +238,18 @@ function runTests (runType, t) {
})
})

t.test(`${mode} get /python3.8`, t => {
t.test(`${mode} get /python3.11`, t => {
t.plan(16)
let rawPath = '/python3.8'
let rawPath = '/python3.11'
tiny.get({
url: url + rawPath
}, function _got (err, result) {
if (isWindowsPythonStalling(err, t)) return
else if (err) t.end(err)
else {
checkResult(t, result.body, {
message: 'Hello from get /python3.8 (running python3.8)',
routeKey: 'GET /python3.8',
message: 'Hello from get /python3.11 (running python3.11)',
routeKey: 'GET /python3.11',
rawPath,
pathParameters: undefined,
cookies: undefined,
Expand All @@ -260,7 +260,7 @@ function runTests (runType, t) {
body: undefined,
context: {
aws_request_id: true, // Just check for presence
function_name: 'sandbox-get-python3_8',
function_name: 'sandbox-get-python3_11',
function_version: '$LATEST',
invoked_function_arn: 'sandbox',
memory_limit_in_mb: 1152,
Expand All @@ -270,18 +270,18 @@ function runTests (runType, t) {
})
})

t.test(`${mode} get /python3.7`, t => {
t.plan(15)
let rawPath = '/python3.7'
t.test(`${mode} get /python3.8`, t => {
t.plan(16)
let rawPath = '/python3.8'
tiny.get({
url: url + rawPath
}, function _got (err, result) {
if (isWindowsPythonStalling(err, t)) return
else if (err) t.end(err)
else {
checkResult(t, result.body, {
message: 'Hello from get /python3.7 (running python3.7)',
routeKey: 'GET /python3.7',
message: 'Hello from get /python3.8 (running python3.8)',
routeKey: 'GET /python3.8',
rawPath,
pathParameters: undefined,
cookies: undefined,
Expand All @@ -290,22 +290,29 @@ function runTests (runType, t) {
headers: '🤷🏽‍♀️',
isBase64Encoded: false,
body: undefined,
context: {
aws_request_id: true, // Just check for presence
function_name: 'sandbox-get-python3_8',
function_version: '$LATEST',
invoked_function_arn: 'sandbox',
memory_limit_in_mb: 1152,
}
})
}
})
})

t.test(`${mode} get /ruby2.7`, t => {
t.test(`${mode} get /ruby3.2`, t => {
t.plan(16)
let rawPath = '/ruby2.7'
let rawPath = '/ruby3.2'
tiny.get({
url: url + rawPath
}, function _got (err, result) {
if (err) t.end(err)
else {
checkResult(t, result.body, {
message: 'Hello from get /ruby2.7 (running ruby2.7)',
routeKey: 'GET /ruby2.7',
message: 'Hello from get /ruby3.2 (running ruby3.2)',
routeKey: 'GET /ruby3.2',
rawPath,
pathParameters: undefined,
cookies: undefined,
Expand All @@ -316,7 +323,7 @@ function runTests (runType, t) {
body: undefined,
context: {
aws_request_id: true, // Just check for presence
function_name: 'sandbox-get-ruby2_7',
function_name: 'sandbox-get-ruby3_2',
function_version: '$LATEST',
invoked_function_arn: 'sandbox',
memory_limit_in_mb: 1152,
Expand Down
44 changes: 25 additions & 19 deletions test/integration/http/httpv1-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ function runTests (runType, t) {
})
})

t.test(`${mode} get /nodejs18.x`, t => {
t.test(`${mode} get /nodejs20.x`, t => {
t.plan(16)
let path = '/nodejs18.x'
let path = '/nodejs20.x'
tiny.get({
url: url + path
}, function _got (err, result) {
if (err) t.end(err)
else {
checkResult(t, result.body, {
message: 'Hello from get /nodejs18.x (running nodejs18.x)',
message: 'Hello from get /nodejs20.x (running nodejs20.x)',
resource: path,
path,
httpMethod: 'GET',
Expand All @@ -153,16 +153,16 @@ function runTests (runType, t) {
})
})

t.test(`${mode} get /nodejs14.x`, t => {
t.test(`${mode} get /nodejs18.x`, t => {
t.plan(16)
let path = '/nodejs14.x'
let path = '/nodejs18.x'
tiny.get({
url: url + path
}, function _got (err, result) {
if (err) t.end(err)
else {
checkResult(t, result.body, {
message: 'Hello from get /nodejs14.x (running nodejs14.x)',
message: 'Hello from get /nodejs18.x (running nodejs18.x)',
resource: path,
path,
httpMethod: 'GET',
Expand Down Expand Up @@ -203,17 +203,17 @@ function runTests (runType, t) {
})
})

t.test(`${mode} get /python3.8`, t => {
t.test(`${mode} get /python3.11`, t => {
t.plan(17)
let path = '/python3.8'
let path = '/python3.11'
tiny.get({
url: url + path
}, function _got (err, result) {
if (isWindowsPythonStalling(err, t)) return
else if (err) t.end(err)
else {
checkResult(t, result.body, {
message: 'Hello from get /python3.8 (running python3.8)',
message: 'Hello from get /python3.11 (running python3.11)',
resource: path,
path,
httpMethod: 'GET',
Expand All @@ -226,7 +226,7 @@ function runTests (runType, t) {
isBase64Encoded: false,
context: {
aws_request_id: true, // Just check for presence
function_name: 'sandbox-get-python3_8',
function_name: 'sandbox-get-python3_11',
function_version: '$LATEST',
invoked_function_arn: 'sandbox',
memory_limit_in_mb: 1152,
Expand All @@ -235,18 +235,17 @@ function runTests (runType, t) {
}
})
})

t.test(`${mode} get /python3.7`, t => {
t.plan(16)
let path = '/python3.7'
t.test(`${mode} get /python3.8`, t => {
t.plan(17)
let path = '/python3.8'
tiny.get({
url: url + path
}, function _got (err, result) {
if (isWindowsPythonStalling(err, t)) return
else if (err) t.end(err)
else {
checkResult(t, result.body, {
message: 'Hello from get /python3.7 (running python3.7)',
message: 'Hello from get /python3.8 (running python3.8)',
resource: path,
path,
httpMethod: 'GET',
Expand All @@ -257,21 +256,28 @@ function runTests (runType, t) {
pathParameters: null,
body: null,
isBase64Encoded: false,
context: {
aws_request_id: true, // Just check for presence
function_name: 'sandbox-get-python3_8',
function_version: '$LATEST',
invoked_function_arn: 'sandbox',
memory_limit_in_mb: 1152,
}
})
}
})
})

t.test(`${mode} get /ruby2.7`, t => {
t.test(`${mode} get /ruby3.2`, t => {
t.plan(17)
let path = '/ruby2.7'
let path = '/ruby3.2'
tiny.get({
url: url + path
}, function _got (err, result) {
if (err) t.end(err)
else {
checkResult(t, result.body, {
message: 'Hello from get /ruby2.7 (running ruby2.7)',
message: 'Hello from get /ruby3.2 (running ruby3.2)',
resource: path,
path,
httpMethod: 'GET',
Expand All @@ -284,7 +290,7 @@ function runTests (runType, t) {
isBase64Encoded: false,
context: {
aws_request_id: true, // Just check for presence
function_name: 'sandbox-get-ruby2_7',
function_name: 'sandbox-get-ruby3_2',
function_version: '$LATEST',
invoked_function_arn: 'sandbox',
memory_limit_in_mb: 1152,
Expand Down
Loading

0 comments on commit 6f63669

Please sign in to comment.