Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: re-introduce node v14 compatibiliy, bump deps #404

Merged
merged 9 commits into from Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pull.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [14, 16, 18]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -27,7 +27,7 @@ jobs:
with:
name: e2e-test-artifact
path: |
e2e/**/.serverless/*.json
e2e/**/.serverless/*.zip
.test-artifacts/**/.serverless/*.json
.test-artifacts/**/.serverless/*.zip
retention-days: 7
- run: npm run build --if-present
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [14, 16, 18]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ node_modules
dist
*.log
yarn.lock
.test-artifacts/
1 change: 0 additions & 1 deletion e2e/.gitignore

This file was deleted.

25 changes: 12 additions & 13 deletions e2e/Makefile
Expand Up @@ -2,25 +2,24 @@ test-e2e: test-e2e-minimal test-e2e-individually test-e2e-complete

build:
npm run build
npm link

test-e2e-minimal: build
rm -fr ./e2e/.test-artifacts && mkdir -p ./e2e/.test-artifacts/minimal && rsync -r ./examples/minimal/ ./e2e/.test-artifacts/minimal/
cd ./e2e/.test-artifacts/minimal && npm ci && npm link serverless-esbuild && npx sls package
cd ./e2e/.test-artifacts/minimal/.serverless && unzip minimal-example.zip
rm -fr ./.test-artifacts && mkdir -p ./.test-artifacts/minimal && rsync -r ./examples/minimal/ ./.test-artifacts/minimal/
cd ./.test-artifacts/minimal && npm install && npx sls package
cd ./.test-artifacts/minimal/.serverless && unzip minimal-example.zip
npx jest -c jest.config.e2e.js --ci ./e2e/minimal.test.ts
rm -fr ./e2e/.test-artifacts
rm -fr ./.test-artifacts

test-e2e-individually: build
rm -fr ./e2e/.test-artifacts && mkdir -p ./e2e/.test-artifacts/individually && rsync -r ./examples/individually/ ./e2e/.test-artifacts/individually/
cd ./e2e/.test-artifacts/individually && yarn install --frozen-lockfile && npm link serverless-esbuild && npx sls package
cd ./e2e/.test-artifacts/individually/.serverless && unzip hello1.zip && unzip hello2.zip
rm -fr ./.test-artifacts && mkdir -p ./.test-artifacts/individually && rsync -r ./examples/individually/ ./.test-artifacts/individually/
cd ./.test-artifacts/individually && yarn install && npx sls package
cd ./.test-artifacts/individually/.serverless && unzip hello1.zip && unzip hello2.zip
npx jest -c jest.config.e2e.js --ci ./e2e/individually.test.ts
rm -fr ./e2e/.test-artifacts
rm -fr ./.test-artifacts

test-e2e-complete: build
rm -fr ./e2e/.test-artifacts && mkdir -p ./e2e/.test-artifacts/complete && rsync -r ./examples/complete/ ./e2e/.test-artifacts/complete/
cd ./e2e/.test-artifacts/complete && npm ci && npm link serverless-esbuild && npx sls package
cd ./e2e/.test-artifacts/complete/.serverless && unzip complete-example.zip
rm -fr ./.test-artifacts && mkdir -p ./.test-artifacts/complete && rsync -r ./examples/complete/ ./.test-artifacts/complete/
cd ./.test-artifacts/complete && npm install && npx sls package
cd ./.test-artifacts/complete/.serverless && unzip complete-example.zip
npx jest -c jest.config.e2e.js --ci ./e2e/complete.test.ts
rm -fr ./e2e/.test-artifacts
rm -fr ./.test-artifacts
10 changes: 7 additions & 3 deletions e2e/complete.test.ts
@@ -1,11 +1,15 @@
import fs from 'fs';
import cloudformation from './.test-artifacts/complete/.serverless/cloudformation-template-update-stack.json';
import path from 'path';

test('complete', () => {
const indexContents = fs.readFileSync('e2e/.test-artifacts/complete/.serverless/src/index.js').toString();
const testArtifactPath = path.resolve(__dirname, '../.test-artifacts/complete/.serverless');

const cloudformation = require(path.join(testArtifactPath, 'cloudformation-template-update-stack.json'));

const indexContents = fs.readFileSync(path.join(testArtifactPath, 'src/index.js')).toString();
expect(indexContents).toMatchSnapshot();

const nodeModules = fs.readdirSync('e2e/.test-artifacts/complete/.serverless/node_modules').toString();
const nodeModules = fs.readdirSync(path.join(testArtifactPath, 'node_modules')).toString();
expect(nodeModules).toEqual(expect.stringContaining('isin-validator'));

expect(cloudformation.AWSTemplateFormatVersion).toMatchSnapshot();
Expand Down
10 changes: 7 additions & 3 deletions e2e/individually.test.ts
@@ -1,9 +1,13 @@
import fs from 'fs';
import cloudformation from './.test-artifacts/individually/.serverless/cloudformation-template-update-stack.json';
import path from 'path';

test('individually', () => {
const hello1indexContents = fs.readFileSync('e2e/.test-artifacts/individually/.serverless/hello1.js').toString();
const hello2indexContents = fs.readFileSync('e2e/.test-artifacts/individually/.serverless/hello2.js').toString();
const testArtifactPath = path.resolve(__dirname, '../.test-artifacts/individually/.serverless');

const cloudformation = require(path.join(testArtifactPath, 'cloudformation-template-update-stack.json'));

const hello1indexContents = fs.readFileSync(path.join(testArtifactPath, 'hello1.js')).toString();
const hello2indexContents = fs.readFileSync(path.join(testArtifactPath, 'hello2.js')).toString();
expect(hello1indexContents).toMatchSnapshot();

expect(hello2indexContents).toMatchSnapshot();
Expand Down
8 changes: 6 additions & 2 deletions e2e/minimal.test.ts
@@ -1,8 +1,12 @@
import fs from 'fs';
import cloudformation from './.test-artifacts/minimal/.serverless/cloudformation-template-update-stack.json';
import path from 'path';

test('minimal', () => {
const indexContents = fs.readFileSync('e2e/.test-artifacts/minimal/.serverless/index.js').toString();
const testArtifactPath = path.resolve(__dirname, '../.test-artifacts/minimal/.serverless');

const cloudformation = require(path.join(testArtifactPath, 'cloudformation-template-update-stack.json'));

const indexContents = fs.readFileSync(path.join(testArtifactPath, 'index.js')).toString();
expect(indexContents).toMatchSnapshot();

expect(cloudformation.AWSTemplateFormatVersion).toMatchSnapshot();
Expand Down
1 change: 1 addition & 0 deletions examples/complete/.gitignore
@@ -1,2 +1,3 @@
.build
.serverless
package-lock.json