Skip to content

Commit

Permalink
update testing specifications
Browse files Browse the repository at this point in the history
  • Loading branch information
manwaring committed Aug 9, 2019
1 parent eecdef1 commit 1a86574
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.dependabot/
.nyc_output/
coverage/
dist/**/*.cucumber*
dist/**/*.test*
dist/**/*/mock-data/**
src/
examples/
Expand Down
2 changes: 1 addition & 1 deletion .nycrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ all: true
cache: false

exclude:
- '**/*cucumber*'
- '**/*test.ts'
- '**/*.d.ts'
- '**/*index.ts'
- '**/*/mock-data'
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html)

## [1.1.3]  (2019-08-09)

### Fixed

- Test example script to `cd` into correct directories

## [1.1.2]  (2019-08-05)

### Fixed
Expand Down Expand Up @@ -36,6 +42,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/),
- Clarify project intent and provide additional examples in README
- Publish now happens from git tags instead of master merges

[1.1.3]: https://github.com/manwaring/serverless-plugin-test-helper/compare/v1.1.2...v1.1.3
[1.1.2]: https://github.com/manwaring/serverless-plugin-test-helper/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/manwaring/serverless-plugin-test-helper/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/manwaring/serverless-plugin-test-helper/compare/v1.0.0...v1.1.0
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
1. [Examples](#Examples)
1. [An opinionated approach to serverless testing](#an-opinionated-approach-to-serverless-testing)

_Feedback appreciated! If you have an idea for how this plugin can be improved [please open an issue](https://github.com/manwaring/serverless-plugin-test-helper/issues/new)._

# Overview

Running tests on deployed services (vs locally mocked ones) is an important final step in a robust serverless deployment pipeline because it isn't possible to recreate all aspects of a final solution locally - concerns such as fine-grained resource access through IAM and scalability/performance characteristics of the system can only be assessed while the application is running on AWS. Running these tests on stage/branch-specific versions of the application (see [serverless testing best practices below](#serverless-testing-best-practices)) is difficult to do given the dynamic nature of AWS resource naming. This package makes it easier to write post-deployment tests for applications and services written and deployed using the [Serverless Framework](https://serverless.com/framework/) by locally persisting dynamic AWS resource information such as endpoint URLs and exposing them to your tests via easily-imported helper functions.
Expand Down
2 changes: 1 addition & 1 deletion cucumber.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const common = [
'src/**/*.feature',
'--require-module ts-node/register',
'--require src/**/*.cucumber.ts',
'--require src/**/*.test.ts',
'--format progress-bar',
'--format node_modules/cucumber-pretty'
].join(' ');
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This project was generated with the aws-nodejs-typescript template using the `sl
Added files (top to bottom):

- [cucumber.js](cucumber.js): configuration file for using cucumber-js to drive tests (what can I say, I like BDD)
- [handler.cucumber.ts](handler.cucumber.ts): test steps for calling the 'hello world' endpoint and validating it's response (this file contains the `serverless-plugin-test-helper` library functions for exposing stack values such as the URL)
- [handler.test.e2e.ts](handler.test.e2e.ts): test steps for calling the 'hello world' endpoint and validating it's response (this file contains the `serverless-plugin-test-helper` library functions for exposing stack values such as the URL)
- [handler.feature](handler.feature): Gherkin file defining how the test steps are called
- [README.md](README.md): this file, hopefully making it easier for you to use this package!

Expand Down
2 changes: 1 addition & 1 deletion examples/custom-ts/cucumber.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const common = [
'*.feature',
'--require-module ts-node/register',
'--require *cucumber.ts',
'--require *e2e.ts',
'--format progress-bar',
'--format node_modules/cucumber-pretty'
].join(' ');
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/default-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This project was generated with the aws-nodejs template using the `sls create -t
Added files (top to bottom):

- [cucumber.js](cucumber.js): configuration file for using cucumber-js to drive tests (what can I say, I like BDD)
- [handler.cucumber.js](handler.cucumber.ts): test steps for calling the 'hello world' endpoint and validating it's response (this file contains the `serverless-plugin-test-helper` library functions for exposing stack values such as the URL)
- [handler.test.e2e.js](handler.test.e2e.js): test steps for calling the 'hello world' endpoint and validating it's response (this file contains the `serverless-plugin-test-helper` library functions for exposing stack values such as the URL)
- [handler.feature](handler.feature): Gherkin file defining how the test steps are called
- [package.json](package.json): added so that can include libraries for testing, and also the latest `*` version of the `serverless-plugin-test-helper` so that I can automatically test new versions of the package after publishing
- [README.md](README.md): this file, hopefully making it easier for you to use this package!
Expand Down
2 changes: 1 addition & 1 deletion examples/default-js/cucumber.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const common = [
'*.feature',
'--require *cucumber.js',
'--require *e2e.js',
'--format progress-bar',
'--format node_modules/cucumber-pretty'
].join(' ');
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/default-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This project was generated with the aws-nodejs-typescript template using the `sl
Added files (top to bottom):

- [cucumber.js](cucumber.js): configuration file for using cucumber-js to drive tests (what can I say, I like BDD)
- [handler.cucumber.ts](handler.cucumber.ts): test steps for calling the 'hello world' endpoint and validating it's response (this file contains the `serverless-plugin-test-helper` library functions for exposing stack values such as the URL)
- [handler.test.e2e.ts](handler.test.e2e.ts): test steps for calling the 'hello world' endpoint and validating it's response (this file contains the `serverless-plugin-test-helper` library functions for exposing stack values such as the URL)
- [handler.feature](handler.feature): Gherkin file defining how the test steps are called
- [README.md](README.md): this file, hopefully making it easier for you to use this package!

Expand Down
2 changes: 1 addition & 1 deletion examples/default-ts/cucumber.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const common = [
'*.feature',
'--require-module ts-node/register',
'--require *cucumber.ts',
'--require *e2e.ts',
'--format progress-bar',
'--format node_modules/cucumber-pretty'
].join(' ');
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/default-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
},
"devDependencies": {
"@types/aws-lambda": "^8.10.17",
"@types/chai": "^4.1.7",
"@types/chai": "^4.2.0",
"@types/cucumber": "^4.0.7",
"@types/node": "^12.6.9",
"@types/node": "^12.7.1",
"@types/request-promise-native": "^1.0.16",
"chai": "^4.2.0",
"cucumber": "^5.1.0",
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "serverless-plugin-test-helper",
"description": "A utility library to help with testing deployed serverless applications",
"version": "1.1.2",
"version": "1.1.3",
"scripts": {
"publish-please-dry-run": "publish-please --dry-run",
"publish-please": "publish-please",
Expand All @@ -12,16 +12,16 @@
"pretest": "rimraf .test-output .serverless dist",
"posttest": "rimraf .test-output .serverless .test.* && nyc report --reporter=json --reporter=lcov",
"codecov": "codecov -f coverage/*.json",
"testexamples-custom-ts": "cd examples/custom && rm -rf node_modules package-lock.json && npm i && npm run deploy && npm test",
"testexamples-default-ts": "cd examples/default && rm -rf node_modules package-lock.json && npm i && npm run deploy && npm test",
"testexamples-custom-ts": "cd examples/custom-ts && rm -rf node_modules package-lock.json && npm i && npm run deploy && npm test",
"testexamples-default-ts": "cd examples/default-ts && rm -rf node_modules package-lock.json && npm i && npm run deploy && npm test",
"testexamples-default-js": "cd examples/default-js && rm -rf node_modules package-lock.json && npm i && npm run deploy && npm test"
},
"dependencies": {
"js-yaml": "^3.13.1"
},
"devDependencies": {
"@types/lodash.clonedeep": "^4.5.6",
"@types/node": "^12.6.9",
"@types/node": "^12.7.1",
"chai": "^4.2.0",
"codecov": "^3.5.0",
"cucumber": "^5.1.0",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1a86574

Please sign in to comment.