]> source.dussan.org Git - sonarqube.git/commitdiff
[NO JIRA] Move SCIM bbts to core-extension-scim
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Thu, 6 Jul 2023 07:26:11 +0000 (09:26 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 11 Jul 2023 20:03:24 +0000 (20:03 +0000)
build.gradle
buildSrc/src/main/groovy/org.sonar.build/BlackBoxTest.groovy [new file with mode: 0644]

index f9d738d5f87636a88a90fb5714853e3fddbc7ce3..74e1af5bf86af33e9ee105d824f0ef622640c110 100644 (file)
@@ -1,4 +1,5 @@
 import groovy.json.JsonOutput
+import org.sonar.build.BlackBoxTest
 
 import static org.gradle.api.JavaVersion.VERSION_17
 
@@ -211,6 +212,15 @@ subprojects {
         srcDirs += ['src/it/java']
       }
     }
+
+    bbt {
+      resources {
+        srcDirs = ['src/bbt/resources']
+      }
+      java {
+        srcDirs += ['src/bbt/java']
+      }
+    }
   }
 
   // Central place for definition dependency versions and exclusions.
@@ -407,10 +417,16 @@ subprojects {
     }
   }
 
-  // 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) {
@@ -586,7 +602,6 @@ subprojects {
 
 
   tasks.withType(Test) {
-
     configurations {
       utMonitoring
     }
@@ -598,6 +613,27 @@ subprojects {
     }
   }
 
+  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 {
diff --git a/buildSrc/src/main/groovy/org.sonar.build/BlackBoxTest.groovy b/buildSrc/src/main/groovy/org.sonar.build/BlackBoxTest.groovy
new file mode 100644 (file)
index 0000000..e80468a
--- /dev/null
@@ -0,0 +1,25 @@
+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'
+    }
+  }
+}