Skip to content

Commit b78bb45

Browse files
tbenrjakubgs
authored andcommitted
add coverage test
Signed-off-by: Jakub Sokołowski <jakub@status.im>
1 parent b77139c commit b78bb45

11 files changed

Lines changed: 1298 additions & 25 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,7 @@ conan.cmake
166166
status-modules/translations
167167
status-modules/cljs
168168
status-modules/resources
169+
170+
## coverage
171+
/.nyc_output
172+
/coverage-report

.nycrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"include": [
3+
"target/test/status_im/**"
4+
],
5+
"exclude": [
6+
"target/test/status_im/test/**",
7+
"target/test/status_im/ui/**"
8+
],
9+
"report-dir": "./coverage-report",
10+
"all": true,
11+
"source-map": true,
12+
"produce-source-map": true,
13+
"instrument": true,
14+
"exclude-after-remap": false,
15+
"extension": [".js"],
16+
"reporter": ["lcovonly"]
17+
}

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ test: ##@test Run tests once in NodeJS
191191
test-auto: ##@test Run tests in interactive (auto) mode in NodeJS
192192
lein with-profile test doo node test
193193

194+
coverage: ##@test Run tests once in NodeJS generating coverage
195+
@scripts/run-coverage.sh
196+
194197
#--------------
195198
# Other
196199
#--------------

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,5 @@ Licensed under the [Mozilla Public License v2.0](https://github.com/status-im/st
6666
## Testing Supported by
6767

6868
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=SFBWQ3k5R2tnT2t6UGsxU1h1U0g3VFlCNnoxVTRHYWNoTDhsb1laaTJZWT0tLUZMUm5sSVFBSU9qSWM1RUJvK1I3Z3c9PQ==--ad15ae7992b432b33743749d40318952415bd98f)](https://www.browserstack.com/automate/public-build/SFBWQ3k5R2tnT2t6UGsxU1h1U0g3VFlCNnoxVTRHYWNoTDhsb1laaTJZWT0tLUZMUm5sSVFBSU9qSWM1RUJvK1I3Z3c9PQ==--ad15ae7992b432b33743749d40318952415bd98f)
69+
70+
[![Coverage Status](https://coveralls.io/repos/github/status-im/status-react/badge.svg?)](https://coveralls.io/github/status-im/status-react)

ci/Jenkinsfile.android

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ pipeline {
3535
LEIN_HOME = "/var/tmp/lein-${EXECUTOR_NUMBER}"
3636
YARN_CACHE_FOLDER = "/var/tmp/yarn-${EXECUTOR_NUMBER}"
3737
GRADLE_USER_HOME = "/var/tmp/gradle-${EXECUTOR_NUMBER}"
38+
/* coverage report identification */
39+
COVERALLS_SERVICE_NAME = "jenkins"
40+
COVERALLS_SERVICE_JOB_ID = "${JOB_NAME}#${BUILD_NUMBER}"
3841
}
3942

4043
stages {
@@ -65,6 +68,11 @@ pipeline {
6568
script { cmn.nix.shell('lein test-cljs') }
6669
}
6770
}
71+
stage('Coverage') {
72+
steps {
73+
script { android.coverage() }
74+
}
75+
}
6876
} }
6977
stage('Build') { stages {
7078
stage('Clojure') {

ci/android.groovy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,15 @@ def uploadToDiawi() {
101101
return diawiUrl
102102
}
103103

104+
def coverage() {
105+
withCredentials([
106+
string(credentialsId: 'coveralls-status-react-token', variable: 'COVERALLS_REPO_TOKEN'),
107+
]) {
108+
nix.shell(
109+
'make coverage',
110+
keep: ['COVERALLS_REPO_TOKEN', 'COVERALLS_SERVICE_NAME', 'COVERALLS_SERVICE_JOB_ID']
111+
)
112+
}
113+
}
114+
104115
return this

desktop_files/package.json.orig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@
110110
"@babel/plugin-transform-block-scoping": "7.0.0",
111111
"@babel/preset-env": "7.1.0",
112112
"@babel/register": "7.0.0",
113-
"patch-package": "^5.1.1"
113+
"patch-package": "^5.1.1",
114+
"coveralls": "^3.0.4",
115+
"nyc": "^14.1.1"
114116
},
115117
"optionalDependencies": {
116118
"appdmg": "^0.5.2"

0 commit comments

Comments
 (0)