Skip to content

Commit

Permalink
add coverage test
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Sokołowski <jakub@status.im>
  • Loading branch information
tbenr authored and jakubgs committed Jul 10, 2019
1 parent b77139c commit b78bb45
Show file tree
Hide file tree
Showing 11 changed files with 1,298 additions and 25 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -166,3 +166,7 @@ conan.cmake
status-modules/translations
status-modules/cljs
status-modules/resources

## coverage
/.nyc_output
/coverage-report
17 changes: 17 additions & 0 deletions .nycrc
@@ -0,0 +1,17 @@
{
"include": [
"target/test/status_im/**"
],
"exclude": [
"target/test/status_im/test/**",
"target/test/status_im/ui/**"
],
"report-dir": "./coverage-report",
"all": true,
"source-map": true,
"produce-source-map": true,
"instrument": true,
"exclude-after-remap": false,
"extension": [".js"],
"reporter": ["lcovonly"]
}
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -191,6 +191,9 @@ test: ##@test Run tests once in NodeJS
test-auto: ##@test Run tests in interactive (auto) mode in NodeJS
lein with-profile test doo node test

coverage: ##@test Run tests once in NodeJS generating coverage
@scripts/run-coverage.sh

#--------------
# Other
#--------------
Expand Down
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -66,3 +66,5 @@ Licensed under the [Mozilla Public License v2.0](https://github.com/status-im/st
## Testing Supported by

[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=SFBWQ3k5R2tnT2t6UGsxU1h1U0g3VFlCNnoxVTRHYWNoTDhsb1laaTJZWT0tLUZMUm5sSVFBSU9qSWM1RUJvK1I3Z3c9PQ==--ad15ae7992b432b33743749d40318952415bd98f)](https://www.browserstack.com/automate/public-build/SFBWQ3k5R2tnT2t6UGsxU1h1U0g3VFlCNnoxVTRHYWNoTDhsb1laaTJZWT0tLUZMUm5sSVFBSU9qSWM1RUJvK1I3Z3c9PQ==--ad15ae7992b432b33743749d40318952415bd98f)

[![Coverage Status](https://coveralls.io/repos/github/status-im/status-react/badge.svg?)](https://coveralls.io/github/status-im/status-react)
8 changes: 8 additions & 0 deletions ci/Jenkinsfile.android
Expand Up @@ -35,6 +35,9 @@ pipeline {
LEIN_HOME = "/var/tmp/lein-${EXECUTOR_NUMBER}"
YARN_CACHE_FOLDER = "/var/tmp/yarn-${EXECUTOR_NUMBER}"
GRADLE_USER_HOME = "/var/tmp/gradle-${EXECUTOR_NUMBER}"
/* coverage report identification */
COVERALLS_SERVICE_NAME = "jenkins"
COVERALLS_SERVICE_JOB_ID = "${JOB_NAME}#${BUILD_NUMBER}"
}

stages {
Expand Down Expand Up @@ -65,6 +68,11 @@ pipeline {
script { cmn.nix.shell('lein test-cljs') }
}
}
stage('Coverage') {
steps {
script { android.coverage() }
}
}
} }
stage('Build') { stages {
stage('Clojure') {
Expand Down
11 changes: 11 additions & 0 deletions ci/android.groovy
Expand Up @@ -101,4 +101,15 @@ def uploadToDiawi() {
return diawiUrl
}

def coverage() {
withCredentials([
string(credentialsId: 'coveralls-status-react-token', variable: 'COVERALLS_REPO_TOKEN'),
]) {
nix.shell(
'make coverage',
keep: ['COVERALLS_REPO_TOKEN', 'COVERALLS_SERVICE_NAME', 'COVERALLS_SERVICE_JOB_ID']
)
}
}

return this
4 changes: 3 additions & 1 deletion desktop_files/package.json.orig
Expand Up @@ -110,7 +110,9 @@
"@babel/plugin-transform-block-scoping": "7.0.0",
"@babel/preset-env": "7.1.0",
"@babel/register": "7.0.0",
"patch-package": "^5.1.1"
"patch-package": "^5.1.1",
"coveralls": "^3.0.4",
"nyc": "^14.1.1"
},
"optionalDependencies": {
"appdmg": "^0.5.2"
Expand Down

0 comments on commit b78bb45

Please sign in to comment.