不要怂,就是干,撸起袖子干!

Commit d03d3c88 by Mick Hansen

Merge pull request #1092 from webcast-io/feature/code-coverage

Code Coverage and Coveralls.io
2 parents eb6bb1e4 30a3bcb2
Showing with 39 additions and 1 deletions
...@@ -7,3 +7,4 @@ npm-debug.log ...@@ -7,3 +7,4 @@ npm-debug.log
*~ *~
test/binary/tmp/* test/binary/tmp/*
test/tmp/* test/tmp/*
coverage-*
...@@ -18,6 +18,10 @@ test: ...@@ -18,6 +18,10 @@ test:
make teaser && ./node_modules/mocha/bin/mocha --check-leaks --colors -t 10000 --reporter $(REPORTER) $(TESTS); \ make teaser && ./node_modules/mocha/bin/mocha --check-leaks --colors -t 10000 --reporter $(REPORTER) $(TESTS); \
fi fi
cover:
rm -rf coverage \
make teaser && ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- -- -u exports --report lcovonly -- -R spec -- $(TESTS); \
mv coverage coverage-$(DIALECT) \
mariadb: mariadb:
@DIALECT=mariadb make test @DIALECT=mariadb make test
...@@ -32,6 +36,33 @@ postgres-native: ...@@ -32,6 +36,33 @@ postgres-native:
binary: binary:
@./test/binary/sequelize.test.bats @./test/binary/sequelize.test.bats
mariadb-cover:
rm -rf coverage
@DIALECT=mariadb make cover
sqlite-cover:
rm -rf coverage
@DIALECT=sqlite make cover
mysql-cover:
rm -rf coverage
@DIALECT=mysql make cover
postgres-cover:
rm -rf coverage
@DIALECT=postgres make cover
postgres-native-cover:
rm -rf coverage
@DIALECT=postgres-native make cover
binary-cover:
rm -rf coverage
@./test/binary/sequelize.test.bats
merge-coverage:
rm -rf coverage
mkdir coverage
./node_modules/.bin/lcov-result-merger 'coverage-*/lcov.info' 'coverage/lcov.info'
coveralls-send:
cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf ./coverage
# test aliases # test aliases
pgsql: postgres pgsql: postgres
...@@ -41,4 +72,7 @@ postgresn: postgres-native ...@@ -41,4 +72,7 @@ postgresn: postgres-native
all: sqlite mysql postgres postgres-native mariadb all: sqlite mysql postgres postgres-native mariadb
all-cover: sqlite-cover mysql-cover postgres-cover postgres-native-cover mariadb-cover merge-coverage
coveralls: sqlite-cover mysql-cover postgres-cover postgres-native-cover mariadb-cover merge-coverage coveralls-send
.PHONY: sqlite mysql postgres pgsql postgres-native postgresn all test .PHONY: sqlite mysql postgres pgsql postgres-native postgresn all test
...@@ -58,7 +58,10 @@ ...@@ -58,7 +58,10 @@
"mocha": "~1.13.0", "mocha": "~1.13.0",
"chai-datetime": "~1.1.1", "chai-datetime": "~1.1.1",
"sinon": "~1.7.3", "sinon": "~1.7.3",
"mariasql": "git://github.com/sequelize/node-mariasql.git" "mariasql": "git://github.com/sequelize/node-mariasql.git",
"lcov-result-merger": "0.0.2",
"istanbul": "~0.1.45",
"coveralls": "~2.5.0"
}, },
"keywords": [ "keywords": [
"mysql", "mysql",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!