Browse Source

Add acceptance tests to travis-ci scripts

pull/141/head
Diana Shkolnikov 10 years ago
parent
commit
ad37ab6283
  1. 5
      .travis.yml
  2. 4
      package.json
  3. 24
      test/acceptance/remote.sh

5
.travis.yml

@ -1,4 +1,7 @@
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:
- "0.10"

4
package.json

@ -13,7 +13,9 @@
"ciao": "node node_modules/ciao/bin/ciao -c test/ciao.json test/ciao",
"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;",
"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": {
"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