Skip to content

Commit

Permalink
Merge pull request #359 from apiaryio/honzajavorek/run-testsuites-of-…
Browse files Browse the repository at this point in the history
…hooks-with-every-release

Run dependent integration builds on every release
  • Loading branch information
w-vi committed Feb 9, 2016
2 parents 9e1139c + 87c2fd4 commit 62e369a
Show file tree
Hide file tree
Showing 11 changed files with 381 additions and 43 deletions.
29 changes: 14 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
sudo: required
dist: trusty

language: node_js

sudo: "required"
dist: "trusty"
language: "node_js"
env:
global:
- secure: "STxhfQh/AHeyRJgErinjZrjnJDChHKLctjqAUDwiIWcZZonopfB8DNp6DgcCHj6FPCTfcHeWdjQjvOiC6ZZugMcMUwzhi+PdDR4kDVP3GoeaMcKC2ckkdjapcA+mnmJDLF35FjhK6PvR1zpRbwlwiYpIayKHEjdgEzna3RmfRH8="
node_js:
- "0.10"
- "0.12"
- "iojs-v2.5.0"
- "4"
- "5"

notifications:
email:
recipients:
- adam@apiary.io
- kubula@apiary.io
on_success: change
on_failure: always

before_install:
- "gem install travis"
before_script:
- "npm run lint"
script:
- "npm test"
- "npm run test:hook-handlers"
after_success:
- ./scripts/coveralls
- "npm run coveralls"
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
},
"scripts": {
"changelist": "github-changes -o apiaryio -r dredd --only-pulls --use-commit-body --file CHANGELOG-Generated.md -a",
"pretest": "coffeelint ./src",
"test": "scripts/test",
"prepublish": "scripts/prepublish"
"lint": "coffeelint ./src",
"compile": "coffee -b -c -o lib/ src/",
"pretest": "npm run compile",
"test": "./scripts/test",
"test:bdd": "./scripts/test -w",
"test:hook-handlers": "coffee ./scripts/test-hook-handlers.coffee",
"prepublish": "npm run compile",
"coveralls": "./scripts/cov mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -55,7 +60,8 @@
"mocha": "^2.1.0",
"mocha-lcov-reporter": "1.0.0",
"nock": "^3.4.1",
"sinon": "^1.12.2"
"sinon": "^1.12.2",
"sync-exec": "^0.6.2"
},
"keywords": [
"api",
Expand Down
2 changes: 0 additions & 2 deletions scripts/bdd

This file was deleted.

9 changes: 0 additions & 9 deletions scripts/build

This file was deleted.

3 changes: 1 addition & 2 deletions scripts/cov
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
rm -rf ./src-cov

COV=./node_modules/coffee-coverage/bin/coffeecoverage
MOCHA=./node_modules/mocha/bin/mocha
MOCHA=./node_modules/.bin/mocha

REPORTER=$1
echo "Using Mocha reporter: $REPORTER" 1>&2
$COV --exclude node_modules,.git,test --path relative . ./src-cov 1>&2
cp -r ./test ./src-cov/test
cp ./package.json ./src-cov

# Excluding test breaking coveralls report :( Reporting to coveralls.io for further investigation
$MOCHA --reporter $REPORTER --recursive --timeout 120000 --compilers 'coffee:coffee-script/register' './src-cov/test/**/*-test.coffee'

rm -rf ./src-cov
1 change: 0 additions & 1 deletion scripts/cov-html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
# Saves HTML coverage report

./scripts/cov html-cov > cov.html
3 changes: 0 additions & 3 deletions scripts/coveralls

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/mocha

This file was deleted.

2 changes: 0 additions & 2 deletions scripts/prepublish

This file was deleted.

10 changes: 8 additions & 2 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/sh
./scripts/build
./scripts/mocha 2>&1
# Runs tests. All arguments given to this script will be passed to mocha.

MOCHA=./node_modules/.bin/mocha

find ./test/ -name '*-test.coffee' | xargs "$MOCHA" \
--compilers 'coffee:coffee-script/register' \
--reporter spec \
--timeout 120000 \
--recursive \
"$@"

0 comments on commit 62e369a

Please sign in to comment.