ci: fix junit regex parsing in jenkinsfile
This commit is contained in:
parent
990045f157
commit
b35986111a
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@ -137,10 +137,10 @@ if (!fs.existsSync(coveragePath)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const junit = fs.readFileSync(junitPath, 'utf8');
|
const junit = fs.readFileSync(junitPath, 'utf8');
|
||||||
const tests = Number((junit.match(/tests="(\d+)"/) || [])[1] || 0);
|
const tests = Number((junit.match(/tests="([0-9]+)"/) || [])[1] || 0);
|
||||||
const failures = Number((junit.match(/failures="(\d+)"/) || [])[1] || 0);
|
const failures = Number((junit.match(/failures="([0-9]+)"/) || [])[1] || 0);
|
||||||
const errors = Number((junit.match(/errors="(\d+)"/) || [])[1] || 0);
|
const errors = Number((junit.match(/errors="([0-9]+)"/) || [])[1] || 0);
|
||||||
const skipped = Number((junit.match(/skipped="(\d+)"/) || [])[1] || 0);
|
const skipped = Number((junit.match(/skipped="([0-9]+)"/) || [])[1] || 0);
|
||||||
|
|
||||||
const cov = JSON.parse(fs.readFileSync(coveragePath, 'utf8'));
|
const cov = JSON.parse(fs.readFileSync(coveragePath, 'utf8'));
|
||||||
const total = cov.total || {};
|
const total = cov.total || {};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user