Handle ui test errors in Jenkins Pipeline (#1975)

Fix jenkins testing stage to not ignore test result. This led to different results between local builds and Jenkins builds which confused the developer and could hide implementation errors.
This commit is contained in:
Eduard Heimbuch
2022-03-17 09:13:51 +01:00
committed by GitHub
parent a1133176c6
commit 9ec38a858d
4 changed files with 12 additions and 9 deletions

6
Jenkinsfile vendored
View File

@@ -61,8 +61,10 @@ pipeline {
stage('Check') {
steps {
withCheckEnvironment {
gradle 'check'
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
withCheckEnvironment {
gradle 'check'
}
}
junit allowEmptyResults: true, testResults: '**/build/test-results/test/TEST-*.xml,**/build/test-results/tests/test/TEST-*.xml,**/build/jest-reports/TEST-*.xml'
}

View File

@@ -0,0 +1,2 @@
- type: fixed
description: Do not ignore ui test results on Jenkins ([#1975](https://github.com/scm-manager/scm-manager/pull/1975))

View File

@@ -8,7 +8,7 @@
"scripts": {
"build": "webpack-cli --mode=production --config=scm-ui/ui-scripts/src/webpack.config.js",
"build:dev": "webpack-cli --mode=development --config=scm-ui/ui-scripts/src/webpack.config.js",
"test": "lerna run --scope '@scm-manager/ui-*' test",
"test": "lerna run --scope '@scm-manager/ui-*' test --no-bail",
"e2e-tests": "lerna run --scope '@scm-manager/e2e-tests' ci",
"typecheck": "lerna run --scope '@scm-manager/ui-*' typecheck",
"lint": "lerna run --scope '@scm-manager/ui-*' lint",

View File

@@ -44,7 +44,7 @@ task typecheck(type: YarnTask) {
include 'ui-*/**/*.ts'
include 'ui-*/**/*.tsx'
})
.withPathSensitivity(PathSensitivity.RELATIVE)
.withPathSensitivity(PathSensitivity.RELATIVE)
outputs.file('build/tmp/typecheck/marker')
dependsOn('yarn_install')
doLast {
@@ -84,11 +84,10 @@ task test(type: YarnTask) {
include 'ui-*/**/*.ts'
include 'ui-*/**/*.tsx'
})
.withPathSensitivity(PathSensitivity.RELATIVE)
.withPathSensitivity(PathSensitivity.RELATIVE)
outputs.dir('build/jest-reports')
if (project.isCI) {
ignoreExitValue = project.isCI
dependsOn('yarn_install', 'updateUiTestTimestamps')
} else {
dependsOn('yarn_install')
@@ -102,7 +101,7 @@ task chromatic(type: YarnTask) {
include 'ui-components/src/**'
include 'ui-components/.storybook/**'
})
.withPathSensitivity(PathSensitivity.RELATIVE)
.withPathSensitivity(PathSensitivity.RELATIVE)
outputs.file('build/tmp/chromatic/marker')
enabled = System.getenv('CHROMATIC_PROJECT_TOKEN') != null
@@ -130,7 +129,7 @@ yarn_install {
inputs.files(fileTree(project.projectDir) {
include 'ui-*/package.json'
})
.withPathSensitivity(PathSensitivity.RELATIVE)
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.file(new File(project.rootProject.projectDir, 'package.json'))
inputs.file(new File(project.rootProject.projectDir, 'yarn.lock'))
@@ -157,7 +156,7 @@ task bundle(type: YarnTask) {
exclude '**/*.test.ts'
exclude '**/*.test.tsx'
})
.withPathSensitivity(PathSensitivity.RELATIVE)
.withPathSensitivity(PathSensitivity.RELATIVE)
outputs.dir('build/assets')
dependsOn('yarn_install')
}