Skip to content

Commit f976de7

Browse files
committed
Merge branch 'main' into maxday/fix-cve
2 parents c969e68 + b13fef2 commit f976de7

10 files changed

+58
-49
lines changed

.github/dependabot.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "."
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/test-on-push-and-pr.yml

+19-41
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,28 @@ on:
77
branches: [ '*' ]
88

99
jobs:
10-
build:
10+
unit-test:
1111
runs-on: ubuntu-latest
12-
13-
steps:
14-
- uses: actions/checkout@v2
15-
- name: Run 'pr' target
16-
run: make pr
17-
18-
alpine:
19-
runs-on: ubuntu-latest
20-
21-
steps:
22-
- uses: actions/checkout@v2
23-
- name: Run alpine integration tests
24-
run: DISTRO=alpine make test-integ
25-
26-
amazonlinux:
27-
runs-on: ubuntu-latest
28-
29-
steps:
30-
- uses: actions/checkout@v2
31-
- name: Run amazonlinux integration tests
32-
run: DISTRO=amazonlinux make test-integ
33-
34-
centos:
35-
runs-on: ubuntu-latest
36-
37-
steps:
38-
- uses: actions/checkout@v2
39-
- name: Run centos integration tests
40-
run: DISTRO=centos make test-integ
41-
42-
debian:
43-
runs-on: ubuntu-latest
44-
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
node-version: [18, 20, 22]
16+
4517
steps:
46-
- uses: actions/checkout@v2
47-
- name: Run debian integration tests
48-
run: DISTRO=debian make test-integ
18+
- uses: actions/checkout@v4
19+
- name: Build and run tests for Node.js ${{ matrix.node-version }}
20+
run: |
21+
docker build -f test/unit/Dockerfile.nodejs${{ matrix.node-version }}.x -t unit/nodejs.${{ matrix.node-version }}x .
22+
docker run unit/nodejs.${{ matrix.node-version }}x
4923
50-
ubuntu:
24+
integration-test:
5125
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
distro: [alpine, amazonlinux, centos, debian, ubuntu]
5230

5331
steps:
54-
- uses: actions/checkout@v2
55-
- name: Run ubuntu integration tests
56-
run: DISTRO=ubuntu make test-integ
32+
- uses: actions/checkout@v4
33+
- name: Run ${{ matrix.distro }} integration tests
34+
run: DISTRO=${{ matrix.distro }} make test-integ

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@ dist/
5252
deps/artifacts/
5353
deps/aws-lambda-cpp*/
5454
deps/curl*/
55+
56+
# Local codebuild
57+
codebuild.*/

test/integration/codebuild/buildspec.os.debian.1.yml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ batch:
1717
- "buster"
1818
- "bullseye"
1919
RUNTIME_VERSION:
20-
- "16"
2120
- "18"
2221
- "20"
2322
phases:

test/integration/codebuild/buildspec.os.debian.2.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ batch:
1616
DISTRO_VERSION:
1717
- "bookworm"
1818
RUNTIME_VERSION:
19-
- "16"
2019
- "18"
2120
- "20"
2221
phases:

test/integration/codebuild/buildspec.os.ubuntu.1.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ batch:
1414
env:
1515
variables:
1616
DISTRO_VERSION:
17-
- "18.04"
1817
- "20.04"
1918
- "22.04"
2019
RUNTIME_VERSION:
21-
- "16"
20+
- "18"
2221
phases:
2322
pre_build:
2423
commands:

test/unit/Dockerfile.nodejs18.x

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:18
2+
RUN apt-get update
3+
RUN apt-get install -y cmake
4+
WORKDIR /tmp
5+
COPY . /tmp
6+
RUN npm install --ci
7+
CMD ["npm", "run", "test"]

test/unit/Dockerfile.nodejs20.x

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:20
2+
RUN apt-get update
3+
RUN apt-get install -y cmake
4+
WORKDIR /tmp
5+
COPY . /tmp
6+
RUN npm install --ci
7+
CMD ["npm", "run", "test"]

test/unit/Dockerfile.nodejs22.x

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:22
2+
RUN apt-get update
3+
RUN apt-get install -y cmake
4+
WORKDIR /tmp
5+
COPY . /tmp
6+
RUN npm install --ci
7+
CMD ["npm", "run", "test"]

test/unit/UserFunctionTest.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ describe('UserFunction.load method', () => {
262262
response.should.equal('Hello from extensionless CJS');
263263
});
264264

265-
it('should fail to load ESM syntax from extensionless file (no package.json)', async () => {
265+
xit('should fail to load ESM syntax from extensionless file (no package.json)', async () => {
266266
await UserFunction.load(
267267
path.join(HANDLERS_ROOT, 'extensionless'),
268268
'esm-extensionless.handler',
@@ -280,7 +280,7 @@ describe('UserFunction.load method', () => {
280280
response.should.equal('Hello from extensionless CJS');
281281
});
282282

283-
it('should fail to load ESM handler from extensionless file with type:commonjs', async () => {
283+
xit('should fail to load ESM handler from extensionless file with type:commonjs', async () => {
284284
// package.json is ignored in the case of extensionless
285285
await UserFunction.load(
286286
path.join(HANDLERS_ROOT, 'pkg', 'type-cjs'),
@@ -299,7 +299,7 @@ describe('UserFunction.load method', () => {
299299
response.should.equal('Hello from extensionless CJS');
300300
});
301301

302-
it('should fail to load ESM handler from extensionless file with type:module', async () => {
302+
xit('should fail to load ESM handler from extensionless file with type:module', async () => {
303303
// package.json is ignored in the case of extensionless
304304
await UserFunction.load(
305305
path.join(HANDLERS_ROOT, 'pkg', 'type-esm'),
@@ -344,7 +344,7 @@ describe('UserFunction.load method', () => {
344344
);
345345
});
346346

347-
it('should fail to load ESM handler from JS file without type context', async () => {
347+
xit('should fail to load ESM handler from JS file without type context', async () => {
348348
await UserFunction.load(
349349
path.join(HANDLERS_ROOT, 'pkg-less'),
350350
'esmModule.handler',

0 commit comments

Comments
 (0)