Add support for codecov

This commit is contained in:
Emanuele Zattin 2017-10-09 15:56:54 +02:00
parent 99bfc7ef2c
commit 2d7822d971
3 changed files with 35 additions and 3 deletions

6
Jenkinsfile vendored
View File

@ -61,7 +61,11 @@ stage('build') {
jsdoc: doDockerBuild('jsdoc', { jsdoc: doDockerBuild('jsdoc', {
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'docs/output', reportFiles: 'index.html', reportName: 'Docs']) publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'docs/output', reportFiles: 'index.html', reportName: 'Docs'])
}), }),
linux_node_debug: doDockerBuild('node Debug'), linux_node_debug: doDockerBuild('node Debug', {
withCredentials([string(credentialsId: 'codecov-token-js', variable: 'codecov-token')]) {
sh 'tests/node_modules/codecov/bin/codecov'
}
}),
linux_node_release: doDockerBuild('node Release'), linux_node_release: doDockerBuild('node Release'),
linux_test_runners: doDockerBuild('test-runners'), linux_test_runners: doDockerBuild('test-runners'),
macos_node_debug: doMacBuild('node Debug'), macos_node_debug: doMacBuild('node Debug'),

View File

@ -376,6 +376,32 @@ case "$TARGET" in
popd popd
stop_server stop_server
;; ;;
"node-cover")
npm run check-environment
if [ "$(uname)" = 'Darwin' ]; then
echo "downloading server"
download_server
echo "starting server"
start_server
npm_tests_cmd="npm run test"
npm install --build-from-source=realm --realm_enable_sync
else
npm_tests_cmd="npm run test"
npm install --build-from-source=realm
fi
# Change to a temp directory.
cd "$(mktemp -q -d -t realm.node.XXXXXX)"
test_temp_dir=$PWD # set it to be cleaned at exit
pushd "$SRCROOT/tests"
npm install
eval "istanbul cover $npm_tests_cmd"
popd
stop_server
;;
"electron") "electron")
if [ "$(uname)" = 'Darwin' ]; then if [ "$(uname)" = 'Darwin' ]; then
download_server download_server

View File

@ -11,11 +11,13 @@
"terminate": "^1.0.8", "terminate": "^1.0.8",
"tmp": "^0.0.30", "tmp": "^0.0.30",
"url-parse": "^1.1.7", "url-parse": "^1.1.7",
"typescript": "^2.5.2" "typescript": "^2.5.2",
"istanbul": "^0.3.2",
"codecov": "^1.0.0"
}, },
"scripts": { "scripts": {
"check-typescript" : "tsc --noEmit --alwaysStrict ./../lib/index.d.ts", "check-typescript" : "tsc --noEmit --alwaysStrict ./../lib/index.d.ts",
"js-tests" : "jasmine spec/unit_tests.js", "js-tests" : "istanbul cover jasmine spec/unit_tests.js",
"test": "npm run check-typescript && npm run js-tests" "test": "npm run check-typescript && npm run js-tests"
} }
} }