Skip to content

Commit

Permalink
Merge branch 'dev' into wip/iob-cob
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncalabrese committed Feb 26, 2015
2 parents 37d74a9 + d616b6c commit ddfef10
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 28 deletions.
18 changes: 6 additions & 12 deletions .travis.yml
@@ -1,14 +1,8 @@
language: node_js
sudo: false
node_js:
- "0.10"
- "0.11"
matrix:
allow_failures:
- node_js: "0.11"
services:
- mongodb
before_script:
- sleep 10
- echo mongo mongo_travis
script:
- make travis
- "0.10"
- "0.12"
services: mongodb
script: make travis
after_script: make report
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Expand Up @@ -12,15 +12,14 @@
[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=dev
[coverage-img]: https://img.shields.io/coveralls/nightscout/cgm-remote-monitor/master.svg
[coverage-url]: https://coveralls.io/r/nightscout/cgm-remote-monitor?branch=master
[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
[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


## Design

Participate in the design process by creating an issue to discuss your
Expand Down
40 changes: 30 additions & 10 deletions Makefile
@@ -1,4 +1,5 @@

# Nightscout tests/builds/analysis
TESTS=tests/*.js
MONGO_CONNECTION?=mongodb://localhost/test_db
CUSTOMCONNSTR_mongo_settings_collection?=test_settings
Expand All @@ -7,19 +8,38 @@ MONGO_SETTINGS=MONGO_CONNECTION=${MONGO_CONNECTION} \
CUSTOMCONNSTR_mongo_collection=${CUSTOMCONNSTR_mongo_collection} \
CUSTOMCONNSTR_mongo_settings_collection=${CUSTOMCONNSTR_mongo_settings_collection}

# XXX.bewest: Mocha is an odd process, and since things are being
# wrapped and transformed, this odd path needs to be used, not the
# normal wrapper. When ./node_modules/.bin/mocha is used, no coverage
# information is generated. This happens because typical shell
# wrapper performs process management that mucks with the test
# coverage reporter's ability to instrument the tests correctly.
# Hard coding it to the local with our pinned version is bigger for
# initial installs, but ensures a consistent environment everywhere.
# On Travis, ./node_modules/.bin and other `nvm` and `npm` bundles are
# inserted into the default `$PATH` enviroinment, making pointing to
# the unwrapped mocha executable necessary.
MOCHA=./node_modules/mocha/bin/_mocha
# Pinned from dependency list.
ISTANBUL=./node_modules/.bin/istanbul
ANALYZED=./coverage/lcov.info

all: test

travis-cov:
NODE_ENV=test \
${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
coverage:
NODE_ENV=test ${MONGO_SETTINGS} \
${ISTANBUL} cover ${MOCHA} -- -R tap ${TESTS}

report:
test -f ${ANALYZED} && \
(npm install coveralls && cat ${ANALYZED} | \
./node_modules/.bin/coveralls) || echo "NO COVERAGE"

test:
${MONGO_SETTINGS} \
mocha --verbose -vvv -R tap ${TESTS}
${MONGO_SETTINGS} ${MOCHA} -R tap ${TESTS}

travis: test travis-cov
travis:
NODE_ENV=test ${MONGO_SETTINGS} \
${ISTANBUL} cover ${MOCHA} --report lcovonly -- -R tap ${TESTS}

.PHONY: test
.PHONY: all coverage report test travis
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -129,7 +129,8 @@ Use the [autoconfigure tool][autoconfigure] to sync an uploader to your config.
Easy to emulate on the commandline:

```bash
echo 'MONGO_CONNECTION="mongodb://sally:sallypass@ds099999.mongolab.com:99999/nightscout"' >> my.env
echo 'MONGO_CONNECTION=mongodb://sally:sallypass@ds099999.mongolab.com:99999/nightscout' >> my.env
echo 'MONGO_COLLECTION=entries' >> my.env
```

From now on you can run using
Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -29,7 +29,7 @@
"postinstall": "node node_modules/bower/bin/bower install"
},
"engines": {
"node": "~0.10.0"
"node": "0.10.x"
},
"dependencies": {
"body-parser": "^1.4.3",
Expand All @@ -46,7 +46,6 @@
"git-rev": "git://github.com/bewest/git-rev.git"
},
"devDependencies": {
"coveralls": "~2.11.2",
"istanbul": "~0.3.5",
"mocha": "~1.20.1",
"should": "~4.0.4",
Expand Down

0 comments on commit ddfef10

Please sign in to comment.