Skip to content

Commit

Permalink
Organize the main test suite into unit/E2E tests
Browse files Browse the repository at this point in the history
And also test suite utility tests. Also, provide the appropriate npm
scripts and document them.

Fixes #1546
  • Loading branch information
strugee committed Jun 1, 2018
1 parent 51b963c commit 3707fa6
Show file tree
Hide file tree
Showing 161 changed files with 30 additions and 2 deletions.
21 changes: 21 additions & 0 deletions TESTING.md
Expand Up @@ -19,6 +19,27 @@ behavior. Here's all of them:
In general you don't need to worry about these - the right one will be
run in Travis.

## The main test suite

The main test suite is broken up into subsuites. There's the unit test
subsuite, and the end-to-end test subsuite. The unit test subsuite is
fast and the end-to-end test subsuite is slow.

There's also some tests that test the utilities used in the rest of
the test suite.

When you run `npm test`, it will run the linters and then, in order:

* The test suite utilities tests, because if these fail everything
else will definitely blow up with confusing errors
* The unit test subsuite, because if there's failures in it they'll be
reported faster
* The end-to-end test subsuite

You can also run these individually with `npm run
test:vows:testsuite`, `npm run test:vows:unit`, and `npm run
test:vows:e2e`, respectively.

## Running as root

Some of the functionality that this package provides requires
Expand Down
7 changes: 5 additions & 2 deletions package.json
Expand Up @@ -79,9 +79,12 @@
"scripts": {
"build": "jade --client --extension jade.js --no-debug public/template/*.jade",
"fullbuild": "npm run build && echo 'use `npm run build` instead next time' 1>&2",
"test": "npm run lint && npm run test:vows",
"test": "npm run lint && nyc -r lcov npm run test:vows",
"test:oauth2": "vows test/authenticationcode-test.js test/bearertoken-test.js test/oauth2-authorization-test.js test/schema-test.js test/authc-oauth2-test.js",
"test:vows": "nyc -r lcov vows -v test/*-test.js",
"test:vows": "for i in testsuite unit e2e; do npm run test:vows:$i || break; done",
"test:vows:testsuite": "vows -v test/*-testsuite-test.js",
"test:vows:unit": "vows -v test/*-unit-test.js",
"test:vows:e2e": "vows -v test/*-e2e-test.js",
"test:root": "nyc -r lcov --report-dir coverage-root vows -v test/*-test-as-root.js",
"test:install": "npm pack && npm install -g pump.io-*.tgz # npm/npm#20241",
"test:security-sigs": "gpg --keyserver hkp://keys.gnupg.net --recv-keys C46D8E7A3F13AD1C8EC6784843BF769C4ACA8B96 && gpg --verify doc/SECURITY.md.gpg",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions test/mailer-test.js → test/mailer-unit-test.js
Expand Up @@ -16,6 +16,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// XXX should this run with the "fast" unit tests since it sets up SMTP?

"use strict";

var assert = require("assert"),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions test/web-test.js → test/web-unit-test.js
Expand Up @@ -16,6 +16,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// XXX should this run with the "fast" unit tests since it sets up HTTP?

"use strict";

var fs = require("fs"),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3707fa6

Please sign in to comment.