Exclude 'no-ci' test group with CI. Removed testAll.

This commit is contained in:
Erik C. Thauvin 2022-09-17 12:00:53 -07:00
parent 646682e2a9
commit 9b595490bd

View file

@ -18,6 +18,8 @@ final def packageName = 'net.thauvin.erik.mobibot'
final def deployDir = 'deploy' final def deployDir = 'deploy'
final def semverProcessor = "net.thauvin.erik:semver:1.2.0" final def semverProcessor = "net.thauvin.erik:semver:1.2.0"
final def isCI = (System.getenv('CI') != null)
def isNonStable = { String version -> def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA', 'JRE'].any { it -> version.toUpperCase().contains(it) } def stableKeyword = ['RELEASE', 'FINAL', 'GA', 'JRE'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/ def regex = /^[0-9,.v-]+(-r)?$/
@ -88,22 +90,20 @@ dependencies {
test { test {
useTestNG() { useTestNG() {
if (isCI) {
excludeGroups('no-ci') excludeGroups('no-ci')
println "Excluded test groups: ${excludeGroups}"
}
} }
} }
tasks.withType(Test).configureEach { tasks.withType(Test).configureEach {
testLogging { testLogging {
exceptionFormat = 'full' exceptionFormat = 'full'
events('skipped', 'failed') events('passed', 'skipped', 'failed')
} }
} }
task testAll(type: Test, group: 'verification', description: 'Run all tests.') {
useTestNG()
}
java { java {
sourceCompatibility = JavaVersion.VERSION_11 sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11
@ -169,20 +169,14 @@ run {
incrementBuildMeta { incrementBuildMeta {
doFirst { doFirst {
if (!System.getenv('CI')) { if (isCI) {
buildMeta = sprintf("%03d", (buildMeta as Integer) + 1)
} else {
println 'No increment with CI.' println 'No increment with CI.'
} else {
buildMeta = sprintf("%03d", (buildMeta as Integer) + 1)
} }
} }
} }
kover {
instrumentation {
excludeTasks.add('testAll')
}
}
sonarqube { sonarqube {
properties { properties {
property('sonar.organization', 'ethauvin-github') property('sonar.organization', 'ethauvin-github')