Skip to content

Commit

Permalink
add coverage report to travis script
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Jan 23, 2015
1 parent 0a7652a commit 034bcef
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ static/bower_components/
.DS_Store

.vagrant
/iisnode
/iisnode

# istanbul output
coverage/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ before_script:
- sleep 10
- echo mongo mongo_travis
script:
- make test
- make travis
27 changes: 9 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,23 @@ TESTS=tests/*.js
MONGO_CONNECTION?=mongodb://localhost/test_db
CUSTOMCONNSTR_mongo_settings_collection?=test_settings
CUSTOMCONNSTR_mongo_collection?=test_sgvs

BLANKET=--require blanket
MONGO_SETTINGS=MONGO_CONNECTION=${MONGO_CONNECTION} \
CUSTOMCONNSTR_mongo_collection=${CUSTOMCONNSTR_mongo_collection} \
CUSTOMCONNSTR_mongo_settings_collection=${CUSTOMCONNSTR_mongo_settings_collection}

all: test

travis-cov:
NODE_ENV=test node_modules/.bin/mocha ${BLANKET} -R 'travis-cov' ${TESTS}

coveralls:
NODE_ENV=test \
./node_modules/.bin/mocha ${BLANKET} -R mocha-lcov-reporter \
${TESTS} | ./coverall.sh

coverhtml:
./node_modules/.bin/mocha ${BLANKET} -R html-cov ${TESTS} > tests/coverage.html
${MONGO_SETTINGS} \
istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -vvv -R tap ${TESTS} && \
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && \
rm -rf ./coverage

test:
MONGO_CONNECTION=${MONGO_CONNECTION} \
CUSTOMCONNSTR_mongo_collection=${CUSTOMCONNSTR_mongo_collection} \
CUSTOMCONNSTR_mongo_settings_collection=${CUSTOMCONNSTR_mongo_settings_collection} \
${MONGO_SETTINGS} \
mocha --verbose -vvv -R tap ${TESTS}

precover:
./node_modules/.bin/mocha ${BLANKET} ${SHOULD} -R html-cov ${TESTS} | w3m -T text/html


travis: test travis-cov coveralls coverhtml
travis: test travis-cov

.PHONY: test
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ cgm-remote-monitor (a.k.a. Nightscout)

[![Build Status][build-img]][build-url]
[![Dependency Status][dependency-img]][dependency-url]
[![Coverage Status][coverage-img]][coverage-url]
[![Gitter chat][gitter-img]][gitter-url]
[![Stories in Ready][ready-img]][ready-url]
[![Stories in Progress][progress-img]][progress-url]
[![Stories in Ready][ready-img]][waffle]
[![Stories in Progress][progress-img]][waffle]

[![Deploy to Heroku][heroku-img]][heroku-url]

Expand All @@ -25,12 +26,13 @@ Community maintained fork of the
[build-url]: https://travis-ci.org/nightscout/cgm-remote-monitor
[dependency-img]: https://img.shields.io/david/nightscout/cgm-remote-monitor.svg
[dependency-url]: https://david-dm.org/nightscout/cgm-remote-monitor
[coverage-img]: https://img.shields.io/coveralls/nightscout/cgm-remote-monitor/coverage.svg
[coverage-url]: https://coveralls.io/r/nightscout/cgm-remote-monitor?branch=coverage
[gitter-img]: https://img.shields.io/badge/Gitter-Join%20Chat%20%E2%86%92-1dce73.svg
[gitter-url]: https://gitter.im/nightscout/public
[ready-img]: https://badge.waffle.io/nightscout/cgm-remote-monitor.svg?label=ready&title=Ready
[ready-url]: https://waffle.io/nightscout/cgm-remote-monitor
[waffle]: https://waffle.io/nightscout/cgm-remote-monitor
[progress-img]: https://badge.waffle.io/nightscout/cgm-remote-monitor.svg?label=in+progress&title=In+Progress
[progress-url]: https://waffle.io/nightscout/cgm-remote-monitor
[heroku-img]: https://www.herokucdn.com/deploy/button.png
[heroku-url]: https://heroku.com/deploy
[original]: https://github.com/rnpenguin/cgm-remote-monitor
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@
"git-rev": "git://github.com/bewest/git-rev.git"
},
"devDependencies": {
"supertest": "~0.13.0",
"coveralls": "~2.11.2",
"istanbul": "~0.3.5",
"mocha": "~1.20.1",
"should": "~4.0.4",
"mocha": "~1.20.1"
"supertest": "~0.13.0"
}
}

0 comments on commit 034bcef

Please sign in to comment.