mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-10-26 08:06:09 +01:00
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:
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@@ -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'
|
||||
}
|
||||
|
||||
2
gradle/changelog/jenkins_testing_stage.yaml
Normal file
2
gradle/changelog/jenkins_testing_stage.yaml
Normal 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))
|
||||
@@ -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",
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user