mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-02-28 01:10:49 +01:00
Do not abort on failing test, if we run on ci server
This commit is contained in:
committed by
René Pfeuffer
parent
9e597bb9e0
commit
22375c8096
@@ -57,6 +57,25 @@ class JavaModulePlugin implements Plugin<Project> {
|
||||
failOnError false
|
||||
}
|
||||
|
||||
project.afterEvaluate {
|
||||
if (project.isCI) {
|
||||
project.plugins.apply("jacoco")
|
||||
project.jacocoTestReport {
|
||||
reports {
|
||||
xml.enabled true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
project.test {
|
||||
useJUnitPlatform()
|
||||
if (project.isCI){
|
||||
ignoreFailures = true
|
||||
finalizedBy project.jacocoTestReport
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
project.publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
|
||||
13
build.gradle
13
build.gradle
@@ -144,6 +144,8 @@ project.ext {
|
||||
|
||||
VersionNumber v = VersionNumber.parse(project.version)
|
||||
nextSnapshotVersion = "${v.major}.${v.minor}.${v.micro + 1}-SNAPSHOT"
|
||||
|
||||
isCI = isRunningOnCiServer()
|
||||
}
|
||||
|
||||
publishing {
|
||||
@@ -168,6 +170,17 @@ publishing {
|
||||
}
|
||||
}
|
||||
|
||||
// determine if we run on ci
|
||||
def isRunningOnCiServer() {
|
||||
return isEnvAvailable("JENKINS_URL") && isEnvAvailable("BUILD_ID")
|
||||
}
|
||||
|
||||
def isEnvAvailable(String key) {
|
||||
String value = System.getenv(key)
|
||||
return value != null && !value.trim().isEmpty()
|
||||
}
|
||||
|
||||
|
||||
// release related tasks
|
||||
|
||||
task setVersion {
|
||||
|
||||
@@ -122,6 +122,3 @@ jar {
|
||||
dependsOn 'build-info'
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
@@ -37,7 +37,3 @@ dependencies {
|
||||
compileOnly libraries.lombok
|
||||
annotationProcessor libraries.lombok
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ test {
|
||||
task javaIntegrationTests(type: Test) {
|
||||
include '**/*ITCase.class'
|
||||
exclude '**/*Test.class'
|
||||
ignoreFailures = project.isCI
|
||||
|
||||
dependsOn 'test', 'startScmServer'
|
||||
mustRunAfter 'startScmServer'
|
||||
@@ -90,6 +91,7 @@ node {
|
||||
|
||||
task e2eTests(type: YarnTask) {
|
||||
args = ['run', 'e2e-tests']
|
||||
ignoreExitValue = project.isCI
|
||||
mustRunAfter 'startScmServer'
|
||||
dependsOn 'yarn_install', 'startScmServer'
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ task test(type: YarnTask) {
|
||||
})
|
||||
.withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
outputs.dir('build/jest-reports')
|
||||
ignoreExitValue = project.isCI
|
||||
dependsOn('yarn_install')
|
||||
}
|
||||
|
||||
|
||||
@@ -201,9 +201,3 @@ fix java.lang.NoClassDefFoundError org/w3c/dom/ElementTraversal
|
||||
<version>1.4.01</version>
|
||||
</dependency>
|
||||
**/
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
// TODO integration tests
|
||||
exclude '**/*ITCase.class'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user