import groovy.json.JsonOutput
+import org.sonar.build.BlackBoxTest
import static org.gradle.api.JavaVersion.VERSION_17
srcDirs += ['src/it/java']
}
}
+
+ bbt {
+ resources {
+ srcDirs = ['src/bbt/resources']
+ }
+ java {
+ srcDirs += ['src/bbt/java']
+ }
+ }
}
// Central place for definition dependency versions and exclusions.
}
}
- // global exclusions
- configurations.all {
- // do not conflict with com.sun.mail:javax.mail
- exclude group: 'javax.mail', module: 'mail'
+ configurations {
+ bbtCompile.extendsFrom testCompile
+ bbtRuntime.extendsFrom testRuntime
+ bbtImplementation.extendsFrom testImplementation
+
+ // global exclusions
+ all {
+ // do not conflict with com.sun.mail:javax.mail
+ exclude group: 'javax.mail', module: 'mail'
+ }
}
tasks.withType(Javadoc) {
tasks.withType(Test) {
-
configurations {
utMonitoring
}
}
}
+ tasks.withType(BlackBoxTest) {
+ jacoco.enabled = false
+ testClassesDirs = sourceSets.bbt.output.classesDirs
+ classpath = sourceSets.bbt.runtimeClasspath
+
+ configurations {
+ includeInTestResources
+ }
+
+ dependencies {
+ bbtRuntimeOnly 'com.microsoft.sqlserver:mssql-jdbc'
+ bbtRuntimeOnly 'com.oracle.database.jdbc:ojdbc11'
+ bbtRuntimeOnly 'org.postgresql:postgresql'
+ bbtRuntimeOnly project(':plugins:sonar-xoo-plugin')
+
+ bbtImplementation 'org.sonarsource.orchestrator:sonar-orchestrator'
+ bbtImplementation project(":sonar-testing-harness")
+ bbtImplementation project(":private:it-common")
+ }
+ }
+
if (isNightlyBuild) {
tasks.withType(Test) {
doFirst {
--- /dev/null
+package org.sonar.build
+
+import org.gradle.api.tasks.testing.Test
+
+class BlackBoxTest extends Test {
+ BlackBoxTest() {
+ def branch = System.getenv('GITHUB_BRANCH')
+ if (branch != null && Set.of("branch-nightly-build", "master").contains(branch)) {
+ jvmArgs("-javaagent:" + System.getenv('ASPECTJ_WEAVER_PATH'))
+ }
+
+ systemProperty 'java.awt.headless', 'true'
+ systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
+
+ if (!project.version.endsWith("-SNAPSHOT")) {
+ systemProperty 'sonar.runtimeVersion', project.version
+ }
+
+ testLogging {
+ events "skipped", "failed"
+ showStandardStreams = true
+ exceptionFormat 'full'
+ }
+ }
+}