Skip to content
This repository has been archived by the owner on Feb 26, 2018. It is now read-only.

Commit

Permalink
Merge pull request #27 from nhsuk/feature/stop-snyk
Browse files Browse the repository at this point in the history
Feature/stop snyk
  • Loading branch information
markysoft committed Jul 12, 2017
2 parents fe88ce5 + 5160e35 commit 1e6ae0d
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 36 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ before_install:

before_script: greenkeeper-lockfile-update

script:
- docker-compose -f docker-compose-tests.yml build travis-tests
- docker-compose -f docker-compose-tests.yml run travis-tests
script: bash ./scripts/test-ci

after_script:
- docker-compose -f docker-compose-tests.yml down -v
Expand Down
5 changes: 5 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Adam Graves (https://github.com/adamgraves-choices)
Eva Barabas (https://github.com/beseven)
Mark Harrop (https://github.com/markysoft)
Neil McLaughlin (https://github.com/neilbmclaughlin)
Steven Hunt (https://github.com/st3v3nhunt)
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# GP redirect

[![Greenkeeper badge](https://badges.greenkeeper.io/nhsuk/gp-redirect.svg)](https://greenkeeper.io/)

[![Build Status](https://travis-ci.org/nhsuk/gp-redirect.svg?branch=master)](https://travis-ci.org/nhsuk/gp-redirect)
[![Coverage Status](https://coveralls.io/repos/github/nhsuk/gp-redirect/badge.svg?branch=master)](https://coveralls.io/github/nhsuk/gp-redirect?branch=master)
[![Known Vulnerabilities](https://snyk.io/test/github/nhsuk/gp-redirect/badge.svg)](https://snyk.io/test/github/nhsuk/gp-redirect)
Expand Down
15 changes: 7 additions & 8 deletions docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,32 @@ version: '2.1'

services:

tests:
test:
extends:
file: docker-compose.yml
service: base-app
command: yarn run test-watch
volumes:
- redirect-tests-node_modules:/code/node_modules
- redirect-test-node_modules:/code/node_modules
environment:
NODE_ENV: test

travis-tests:
test-ci:
extends:
file: docker-compose.yml
service: base-app
command: yarn run travis
command: yarn run test-ci
user: root
volumes:
- redirect-travis-tests-node_modules:/code/node_modules
- redirect-test-ci-node_modules:/code/node_modules
environment:
COVERALLS_REPO_TOKEN: ${COVERALLS_REPO_TOKEN}
NODE_ENV: development
SNYK_TOKEN: ${SNYK_TOKEN}
TRAVIS: ${TRAVIS}
TRAVIS_BRANCH: ${TRAVIS_BRANCH}
TRAVIS_COMMIT: ${TRAVIS_COMMIT}
TRAVIS_JOB_ID: ${TRAVIS_JOB_ID}

volumes:
redirect-tests-node_modules:
redirect-travis-tests-node_modules:
redirect-test-node_modules:
redirect-test-ci-node_modules:
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
"description": "Redirects requests for GP surgeries based on the referring page",
"main": "app-start.js",
"scripts": {
"check-coverage": "istanbul check-coverage --config .istanbul.yml",
"generate-coverage": "yarn run istanbul -- cover _mocha -- --recursive",
"git-hook": "yarn run lint && yarn run generate-coverage && yarn run check-coverage",
"coverage-check": "istanbul check-coverage --config .istanbul.yml",
"coverage-generate": "yarn istanbul -- cover _mocha -- --recursive",
"coverage-upload": "cat ./coverage/lcov.info | coveralls",
"git-hook": "yarn lint && yarn coverage-generate && yarn coverage-check",
"istanbul": "NODE_ENV=test istanbul",
"lint": "eslint --ext .js,.json .",
"lint-watch": "esw --watch .",
"precommit": "yarn run git-hook",
"prepush": "yarn run snyk -- test",
"precommit": "yarn git-hook",
"prepush": "yarn git-hook && yarn snyk test",
"start": "node app-start.js",
"start-watch": "nodemon app-start.js | ./node_modules/bunyan/bin/bunyan",
"upload-coverage": "cat ./coverage/lcov.info | coveralls",
"test": "NODE_ENV=test mocha --recursive test",
"test-watch": "yarn run test -- --watch --reporter min",
"travis": "yarn run git-hook && yarn run upload-coverage && yarn run snyk -- test --org=nhsuk && yarn run snyk -- monitor --org=nhsuk"
"test-ci": "yarn git-hook && yarn coverage-upload",
"test-watch": "yarn test -- --watch --reporter min"
},
"author": "",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ Starts the application a Docker container. Available at:
[`test`](test)
Starts a Docker container specifically for continually running tests.

[`test-ci`](test-ci)
Runs the tests in a Docker container once so that an exit code is reported and
can be used by the CI server.

[`ci-deployment`](ci-deployment)
Infrastructure related work.
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Specifying the project name (-p) creates a non-default network for the tests
# to run isolated from the main app
docker-compose -p tests -f docker-compose-tests.yml down -v
docker-compose -p tests -f docker-compose-tests.yml up --build --force-recreate tests
docker-compose -p tests -f docker-compose-tests.yml up --build --force-recreate test
6 changes: 6 additions & 0 deletions scripts/test-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# Specifying the project name (-p) creates a non-default network for the tests
# to run isolated from the main app
docker-compose -p test-ci -f docker-compose-tests.yml down -v
docker-compose -p test-ci -f docker-compose-tests.yml build test-ci
docker-compose -p test-ci -f docker-compose-tests.yml run test-ci
49 changes: 34 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
# yarn lockfile v1


abbrev@1, abbrev@1.0.x, abbrev@^1.0.7:
abbrev@1, abbrev@1.0.x:
version "1.0.9"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135"

abbrev@^1.0.7:
version "1.1.0"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f"

accepts@~1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.3.tgz#c3ca7434938648c3e0d9c1e328dd68b622c284ca"
Expand Down Expand Up @@ -979,6 +983,10 @@ esprima@^3.1.1:
version "3.1.3"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"

esprima@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"

esquery@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa"
Expand Down Expand Up @@ -1844,13 +1852,20 @@ js-yaml@3.6.1:
argparse "^1.0.7"
esprima "^2.6.0"

js-yaml@3.x, js-yaml@^3.5.3, js-yaml@^3.8.4:
js-yaml@3.x, js-yaml@^3.8.4:
version "3.8.4"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6"
dependencies:
argparse "^1.0.7"
esprima "^3.1.1"

js-yaml@^3.5.3:
version "3.9.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.0.tgz#4ffbbf25c2ac963b8299dc74da7e3740de1c18ce"
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"

jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
Expand Down Expand Up @@ -2119,11 +2134,11 @@ lowercase-keys@^1.0.0:
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306"

lru-cache@^4.0.0:
version "4.0.2"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e"
version "4.1.1"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55"
dependencies:
pseudomap "^1.0.1"
yallist "^2.0.0"
pseudomap "^1.0.2"
yallist "^2.1.2"

map-stream@~0.1.0:
version "0.1.0"
Expand Down Expand Up @@ -2636,8 +2651,8 @@ progress@^2.0.0:
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"

"promise@>=3.2 <8":
version "7.1.1"
resolved "https://registry.yarnpkg.com/promise/-/promise-7.1.1.tgz#489654c692616b8aa55b0724fa809bb7db49c5bf"
version "7.3.1"
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
dependencies:
asap "~2.0.3"

Expand All @@ -2654,7 +2669,7 @@ ps-tree@^1.0.1:
dependencies:
event-stream "~3.3.0"

pseudomap@^1.0.1:
pseudomap@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"

Expand Down Expand Up @@ -2781,8 +2796,8 @@ regex-cache@^0.4.2:
is-primitive "^2.0.0"

registry-auth-token@^3.0.1:
version "3.3.0"
resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.0.tgz#57ae67347e73d96345ed1bc01294c7237c02aa63"
version "3.3.1"
resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.1.tgz#fb0d3289ee0d9ada2cbb52af5dfe66cb070d3006"
dependencies:
rc "^1.1.6"
safe-buffer "^5.0.1"
Expand Down Expand Up @@ -2817,7 +2832,7 @@ repeating@^2.0.0:
dependencies:
is-finite "^1.0.0"

request@2.79.0, request@^2.74.0:
request@2.79.0:
version "2.79.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de"
dependencies:
Expand All @@ -2842,7 +2857,7 @@ request@2.79.0, request@^2.74.0:
tunnel-agent "~0.4.1"
uuid "^3.0.0"

request@^2.81.0:
request@^2.74.0, request@^2.81.0:
version "2.81.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
dependencies:
Expand Down Expand Up @@ -3540,10 +3555,14 @@ uuid@^2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a"

uuid@^3.0.0, uuid@^3.0.1:
uuid@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1"

uuid@^3.0.1:
version "3.1.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"

validate-npm-package-license@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc"
Expand Down Expand Up @@ -3652,7 +3671,7 @@ y18n@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"

yallist@^2.0.0:
yallist@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"

Expand Down

0 comments on commit 1e6ae0d

Please sign in to comment.