Browse Source

Merge pull request #141 from pelias/acceptance-tests

Add acceptance tests to travis-ci scripts
pull/144/head
Diana Shkolnikov 9 years ago
parent
commit
24b28d8754
  1. 11
      .travis.yml
  2. 4
      package.json
  3. 24
      test/acceptance/remote.sh

11
.travis.yml

@ -1,4 +1,13 @@
language: node_js language: node_js
script: "npm run unit" script:
- npm run unit
- >
if [ "${TRAVIS_BRANCH}" == "production" ]; then
npm run acceptance-prod;
fi;
- >
if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
npm run acceptance-stage;
fi;
node_js: node_js:
- "0.10" - "0.10"

4
package.json

@ -13,7 +13,9 @@
"ciao": "node node_modules/ciao/bin/ciao -c test/ciao.json test/ciao", "ciao": "node node_modules/ciao/bin/ciao -c test/ciao.json test/ciao",
"coverage": "node_modules/.bin/istanbul cover test/unit/run.js", "coverage": "node_modules/.bin/istanbul cover test/unit/run.js",
"audit": "npm shrinkwrap; node node_modules/nsp/bin/nspCLI.js audit-shrinkwrap; rm npm-shrinkwrap.json;", "audit": "npm shrinkwrap; node node_modules/nsp/bin/nspCLI.js audit-shrinkwrap; rm npm-shrinkwrap.json;",
"docs": "rm -r docs; cd test/ciao; node ../../node_modules/ciao/bin/ciao -c ../ciao.json . -d ../../docs" "docs": "rm -r docs; cd test/ciao; node ../../node_modules/ciao/bin/ciao -c ../ciao.json . -d ../../docs",
"acceptance-prod": "sh test/acceptance/remote.sh production",
"acceptance-stage": "sh test/acceptance/remote.sh master"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

24
test/acceptance/remote.sh

@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -ex
if [ -d test/acceptance/acceptance-tests ]; then
rm -rf test/acceptance/acceptance-tests
fi
if [ "$1" == "production" ]; then
git clone -b production --single-branch https://github.com/pelias/acceptance-tests.git test/acceptance/acceptance-tests
else
git clone https://github.com/pelias/acceptance-tests.git test/acceptance/acceptance-tests
fi
cd test/acceptance/acceptance-tests
npm install
if [ "$1" == "production" ]; then
node test -e prod
else
node test -e stage
fi
cd ../../../ && rm -rf test/acceptance/acceptance-tests
Loading…
Cancel
Save