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

Commit 30d5bd0c by Jan Aagaard Meier

Coverage

1 parent c513f17f
Showing with 50 additions and 39 deletions
...@@ -2,7 +2,6 @@ language: node_js ...@@ -2,7 +2,6 @@ language: node_js
node_js: node_js:
- "0.10" - "0.10"
- "0.12"
- "iojs-v1" - "iojs-v1"
- "iojs-v2" - "iojs-v2"
...@@ -17,7 +16,6 @@ env: ...@@ -17,7 +16,6 @@ env:
- DIALECT=postgres - DIALECT=postgres
- DIALECT=postgres-native - DIALECT=postgres-native
- DIALECT=sqlite - DIALECT=sqlite
- DIALECT=mariadb
addons: addons:
postgresql: "9.4" postgresql: "9.4"
...@@ -28,10 +26,20 @@ before_script: ...@@ -28,10 +26,20 @@ before_script:
- "psql sequelize_test -c 'create extension postgis;' -U postgres" - "psql sequelize_test -c 'create extension postgis;' -U postgres"
script: script:
- "npm test" - "if [ $COVERAGE ]; then npm run cover && bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info; else npm run test; fi"
matrix:
include:
- node_js: "0.12"
env: COVERAGE=true DIALECT=mysql
- node_js: "0.12"
env: COVERAGE=true DIALECT=postgres
- node_js: "0.12"
env: COVERAGE=true DIALECT=postgres-native
- node_js: "0.12"
env: COVERAGE=true DIALECT=sqlite
branches: branches:
only: only:
- master - master
- v3 - v3
...@@ -13,8 +13,8 @@ cache: ...@@ -13,8 +13,8 @@ cache:
environment: environment:
matrix: matrix:
- {NODE_VERSION: 0.12, DIALECT: mssql}
- {NODE_VERSION: 0.10, DIALECT: mssql} - {NODE_VERSION: 0.10, DIALECT: mssql}
- {NODE_VERSION: 0.12, DIALECT: mssql, COVERAGE: true}
install: install:
- ps: Install-Product node $env:NODE_VERSION x64 - ps: Install-Product node $env:NODE_VERSION x64
...@@ -31,7 +31,15 @@ before_test: ...@@ -31,7 +31,15 @@ before_test:
- ps: . .\appveyor-setup.ps1 - ps: . .\appveyor-setup.ps1
test_script: test_script:
- npm test - 'IF "%COVERAGE%" == "true" (npm run cover) ELSE (npm test)'
after_test:
- ps: |
$env:PATH = 'C:\Program Files\Git\usr\bin;' + $env:PATH
if (Test-Path env:\COVERAGE) {
Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh
bash codecov.sh -f "coverage\lcov.info"
}
branches: branches:
only: only:
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
"chai-spies": "^0.7.0", "chai-spies": "^0.7.0",
"commander": "^2.6.0", "commander": "^2.6.0",
"continuation-local-storage": "^3.1.4", "continuation-local-storage": "^3.1.4",
"cross-env": "^2.0.1",
"dox": "~0.8.0", "dox": "~0.8.0",
"git": "^0.1.5", "git": "^0.1.5",
"hints": "^0.2.0", "hints": "^0.2.0",
...@@ -70,6 +71,7 @@ ...@@ -70,6 +71,7 @@
"pg-hstore": "^2.3.1", "pg-hstore": "^2.3.1",
"pg-native": "^1.8.0", "pg-native": "^1.8.0",
"pg-types": "^1.11.0", "pg-types": "^1.11.0",
"rimraf": "^2.5.4",
"sinon": "^1.17.4", "sinon": "^1.17.4",
"sinon-chai": "^2.8.0", "sinon-chai": "^2.8.0",
"sqlite3": "^3.1.4", "sqlite3": "^3.1.4",
...@@ -88,7 +90,7 @@ ...@@ -88,7 +90,7 @@
], ],
"main": "index", "main": "index",
"scripts": { "scripts": {
"test": "if [ $COVERAGE ]; then npm run codeclimate; else npm run jshint && npm run teaser && npm run test-unit && npm run test-integration; fi", "test": "npm run jshint && npm run teaser && npm run test-unit && npm run test-integration",
"test-docker": "docker-compose run sequelize /bin/sh -c \"npm run test-all\"", "test-docker": "docker-compose run sequelize /bin/sh -c \"npm run test-all\"",
"test-docker-unit": "docker-compose run sequelize /bin/sh -c \"npm run test-unit-all\"", "test-docker-unit": "docker-compose run sequelize /bin/sh -c \"npm run test-unit-all\"",
"test-docker-integration": "docker-compose run sequelize /bin/sh -c \"npm run test-integration-all\"", "test-docker-integration": "docker-compose run sequelize /bin/sh -c \"npm run test-integration-all\"",
...@@ -97,45 +99,38 @@ ...@@ -97,45 +99,38 @@
"jshint": "./node_modules/.bin/jshint lib test", "jshint": "./node_modules/.bin/jshint lib test",
"teaser": "echo ''; node -pe \"Array(20 + process.env.DIALECT.length + 3).join('#')\"; echo '# Running tests for '$DIALECT' #'; node -pe \"Array(20 + process.env.DIALECT.length + 3).join('#')\";echo '';", "teaser": "echo ''; node -pe \"Array(20 + process.env.DIALECT.length + 3).join('#')\"; echo '# Running tests for '$DIALECT' #'; node -pe \"Array(20 + process.env.DIALECT.length + 3).join('#')\";echo '';",
"test-unit": "./node_modules/.bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 15000 --reporter spec 'test/unit/**/*.js'", "test-unit": "./node_modules/.bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 15000 --reporter spec 'test/unit/**/*.js'",
"test-unit-mysql": "DIALECT=mysql npm run test-unit", "test-unit-mysql": "cross-env DIALECT=mysql npm run test-unit",
"test-unit-postgres": "DIALECT=postgres npm run test-unit", "test-unit-postgres": "cross-env DIALECT=postgres npm run test-unit",
"test-unit-postgres-native": "DIALECT=postgres-native npm run test-unit", "test-unit-postgres-native": "cross-env DIALECT=postgres-native npm run test-unit",
"test-unit-mariadb": "DIALECT=mariadb npm run test-unit", "test-unit-mariadb": "cross-env DIALECT=mariadb npm run test-unit",
"test-unit-sqlite": "DIALECT=sqlite npm run test-unit", "test-unit-sqlite": "cross-env DIALECT=sqlite npm run test-unit",
"test-unit-mssql": "DIALECT=mssql npm run test-unit", "test-unit-mssql": "cross-env DIALECT=mssql npm run test-unit",
"test-unit-all": "npm run test-unit-mysql && npm run test-unit-postgres && npm run test-unit-postgres-native && npm run test-unit-mssql && npm run test-unit-sqlite && npm run test-unit-mariadb", "test-unit-all": "npm run test-unit-mysql && npm run test-unit-postgres && npm run test-unit-postgres-native && npm run test-unit-mssql && npm run test-unit-sqlite && npm run test-unit-mariadb",
"test-integration": "./node_modules/.bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 15000 --reporter spec --grep \"$GREP\" 'test/integration/**/*.test.js'", "test-integration": "./node_modules/.bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 15000 --reporter spec --grep \"$GREP\" 'test/integration/**/*.test.js'",
"test-integration-mysql": "DIALECT=mysql npm run test-integration", "test-integration-mysql": "cross-env DIALECT=mysql npm run test-integration",
"test-integration-postgres": "DIALECT=postgres npm run test-integration", "test-integration-postgres": "cross-env DIALECT=postgres npm run test-integration",
"test-integration-postgres-native": "DIALECT=postgres-native npm run test-integration", "test-integration-postgres-native": "cross-env DIALECT=postgres-native npm run test-integration",
"test-integration-mariadb": "DIALECT=mariadb npm run test-integration", "test-integration-mariadb": "cross-env DIALECT=mariadb npm run test-integration",
"test-integration-sqlite": "DIALECT=sqlite npm run test-integration", "test-integration-sqlite": "cross-env DIALECT=sqlite npm run test-integration",
"test-integration-mssql": "DIALECT=mssql npm run test-integration", "test-integration-mssql": "cross-env DIALECT=mssql npm run test-integration",
"test-integration-all": "npm run test-integration-mysql && npm run test-integration-postgres && npm run test-integration-postgres-native && npm run test-integration-mssql && npm run test-integration-sqlite && npm run test-integration-mariadb", "test-integration-all": "npm run test-integration-mysql && npm run test-integration-postgres && npm run test-integration-postgres-native && npm run test-integration-mssql && npm run test-integration-sqlite && npm run test-integration-mariadb",
"test-mysql": "DIALECT=mysql npm test", "test-mysql": "cross-env DIALECT=mysql npm test",
"test-sqlite": "DIALECT=sqlite npm test", "test-sqlite": "cross-env DIALECT=sqlite npm test",
"test-postgres": "DIALECT=postgres npm test", "test-postgres": "cross-env DIALECT=postgres npm test",
"test-pgsql": "npm run test-postgres", "test-pgsql": "npm run test-postgres",
"test-postgres-native": "DIALECT=postgres-native npm test", "test-postgres-native": "cross-env DIALECT=postgres-native npm test",
"test-postgresn": "npm run test-postgres-native", "test-postgresn": "npm run test-postgres-native",
"test-mariadb": "DIALECT=mariadb npm test", "test-mariadb": "cross-env DIALECT=mariadb npm test",
"test-mssql": "DIALECT=mssql npm test", "test-mssql": "cross-env DIALECT=mssql npm test",
"test-all": "npm run test-mysql && npm run test-sqlite && npm run test-postgres && npm run test-postgres-native && npm run test-mariadb && npm run test-mssql", "test-all": "npm run test-mysql && npm run test-sqlite && npm run test-postgres && npm run test-postgres-native && npm run test-mariadb && npm run test-mssql",
"cover": "rm -rf coverage && npm run teaser && COVERAGE=true ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -t 30000 --ui tdd 'test/integration/**/*.test.js'", "cover": "rimraf coverage && npm run teaser && npm run cover-unit && npm run cover-integration && npm run merge-coverage",
"cover-mysql": "DIALECT=mysql npm run cover && mv coverage coverage-mysql", "cover-integration": "cross-env COVERAGE=true node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -t 60000 --ui tdd \"test/integration/**/*.test.js\" && node -e \"require('fs').renameSync('coverage/lcov.info', 'coverage/integration.info')\"",
"cover-sqlite": "DIALECT=sqlite npm run cover && mv coverage coverage-sqlite", "cover-unit": "cross-env COVERAGE=true node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -t 30000 --ui tdd \"test/unit/**/*.test.js\" && node -e \"require('fs').renameSync('coverage/lcov.info', 'coverage/unit.info')\"",
"cover-postgres": "DIALECT=postgres npm run cover && mv coverage coverage-postgres", "merge-coverage": "lcov-result-merger \"coverage/*.info\" \"coverage/lcov.info\"",
"cover-postgres-native": "DIALECT=postgres-native npm run cover && mv coverage coverage-postgres-native",
"cover-mariadb": "DIALECT=mariadb npm run cover && mv coverage coverage-mariadb",
"cover-mssql": "DIALECT=mssql npm run cover && mv coverage coverage-mssql",
"cover-all": "npm run cover-mysql && npm run cover-postgres && npm run cover-postgres-native && npm run cover-mssql && npm run cover-sqlite && npm run cover-mariadb && npm run merge-coverage",
"merge-coverage": "rm -rf coverage && mkdir coverage && ./node_modules/.bin/lcov-result-merger 'coverage-*/lcov.info' 'coverage/lcov.info'",
"codeclimate-send": "npm install -g codeclimate-test-reporter && CODECLIMATE_REPO_TOKEN=ce835a510bbf423a5ab5400a9bdcc2ec2d189d840b31657c6ee7cb9916b161d6 codeclimate-test-reporter < coverage/lcov.info",
"codeclimate": "npm run cover-all && npm run codeclimate-send",
"sscce": "docker-compose run sequelize /bin/sh -c \"node sscce.js\"", "sscce": "docker-compose run sequelize /bin/sh -c \"node sscce.js\"",
"sscce-mysql": "DIALECT=mysql npm run sscce", "sscce-mysql": "cross-env DIALECT=mysql npm run sscce",
"sscce-postgres": "DIALECT=postgres npm run sscce", "sscce-postgres": "cross-env DIALECT=postgres npm run sscce",
"sscce-sqlite": "DIALECT=sqlite npm run sscce" "sscce-sqlite": "cross-env DIALECT=sqlite npm run sscce"
}, },
"engines": { "engines": {
"node": ">=0.6.21" "node": ">=0.6.21"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!