improve-tests #28

Merged
flecomte merged 28 commits from improve-tests into master 2021-07-20 02:24:22 +02:00
2 changed files with 10 additions and 5 deletions
Showing only changes of commit 23b4a17505 - Show all commits

View File

@@ -1,5 +1,6 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val containerAlwaysOn: Boolean by project val containerAlwaysOn: String by project
val disableLint: String by project
plugins { plugins {
jacoco jacoco
@@ -10,7 +11,7 @@ plugins {
id("org.jlleitschuh.gradle.ktlint") version "10.0.0" id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
id("org.owasp.dependencycheck") version "6.1.1" id("org.owasp.dependencycheck") version "6.1.1"
id("fr.coppernic.versioning") version "3.2.1" id("fr.coppernic.versioning") version "3.2.1"
id("com.avast.gradle.docker-compose") version "0.14.0" id("com.avast.gradle.docker-compose") version "0.14.4"
id("org.sonarqube") version "+" id("org.sonarqube") version "+"
} }
@@ -43,8 +44,10 @@ tasks.test {
useJUnit() useJUnit()
useJUnitPlatform() useJUnitPlatform()
systemProperty("junit.jupiter.execution.parallel.enabled", true) systemProperty("junit.jupiter.execution.parallel.enabled", true)
if (disableLint.toBoolean() == false) {
finalizedBy(tasks.ktlintCheck) finalizedBy(tasks.ktlintCheck)
} }
}
tasks.jacocoTestReport { tasks.jacocoTestReport {
dependsOn(tasks.test) dependsOn(tasks.test)
@@ -87,7 +90,7 @@ apply(plugin = "docker-compose")
dockerCompose { dockerCompose {
projectName = "postgres-json" projectName = "postgres-json"
useComposeFiles = listOf("docker-compose.yml") useComposeFiles = listOf("docker-compose.yml")
stopContainers = if (project.hasProperty("containerAlwaysOn")) containerAlwaysOn else false stopContainers = !containerAlwaysOn.toBoolean()
isRequiredBy(project.tasks.test) isRequiredBy(project.tasks.test)
} }

View File

@@ -7,3 +7,5 @@ systemProp.sonar.organization=flecomte
systemProp.sonar.java.coveragePlugin=jacoco systemProp.sonar.java.coveragePlugin=jacoco
systemProp.sonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/test/jacocoTestReport.xml systemProp.sonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/test/jacocoTestReport.xml
org.gradle.jvmargs=-Xmx4096M org.gradle.jvmargs=-Xmx4096M
containerAlwaysOn=false
disableLint=false