Skip to content

Commit

Permalink
chore: add e2e testing (floydspace#293)
Browse files Browse the repository at this point in the history
* feat: first pass at e2e testing

* fix: snapshot with node 12

* fix: debug with pwd

* chore: debug with ls

* fix: cp command syntax

* fix: more test debugging

* fix: use rsync instead of cp

* chore: clean up makefile

* feat: e2e tests for complete and individually

* feat: run all e2e tests on pull

* Update Makefile

* Update Makefile

* feat: target e2e test at local changes

* fix: e2e npm script

* fix: more robust e2e assertion

* fix: use npm link

* feat: e2e cfn template for minimal

* feat: e2e testing, snapshot cloudformation

* fix: e2e tests deterministic

* fix: e2e deterministic test

* fix: update snap

Co-authored-by: Sam Chung <[email protected]>
  • Loading branch information
mishabruml and samchungy authored May 13, 2022
1 parent fbf213d commit 8db0df8
Show file tree
Hide file tree
Showing 18 changed files with 32,123 additions and 575 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ jobs:
cache: npm
- run: npm install
- run: npm test
- run: npm run test:e2e
- run: npm run build --if-present
26 changes: 26 additions & 0 deletions e2e/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
test-e2e: test-e2e-minimal test-e2e-individually test-e2e-complete

build:
npm run build
npm link

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

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

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

0 comments on commit 8db0df8

Please sign in to comment.