From 8e24b10dc39071401722ff654055f14cf0585c3e Mon Sep 17 00:00:00 2001 From: Steve Marion Date: Fri, 21 Jun 2024 17:00:33 +0200 Subject: [PATCH] SONAR-21207 make nightly build depend on external trigger instead of internal state detection --- build.gradle | 7 ++++--- .../src/main/groovy/org.sonar.build/BlackBoxTest.groovy | 5 ----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 193d11f160a..a316bb73375 100644 --- a/build.gradle +++ b/build.gradle @@ -30,8 +30,8 @@ if (!JavaVersion.current().isCompatibleWith(VERSION_17)) { def bomTasks = "cyclonedxBom" def ghBranch = System.getenv()["GITHUB_BRANCH"] def isMainBranch = ghBranch in ['master'] || ghBranch ==~ 'branch-[\\d.]+' -def isNightlyBuild = ghBranch == "branch-nightly-build" -boolean enableBom = System.getenv('CI') == "true" && (isMainBranch || isNightlyBuild) || + +boolean enableBom = System.getenv('CI') == "true" && (isMainBranch) || System.getProperty("bom") != null || gradle.startParameter.taskNames.findAll({ it.matches(".*:($bomTasks)") }) @@ -65,6 +65,7 @@ allprojects { release = project.hasProperty('release') && project.getProperty('release') official = project.hasProperty('official') && project.getProperty('official') testMonitoringEnabled = project.hasProperty('withTestMonitoring') + utMonitoringEnabled = project.hasProperty('withUtMonitoring') } ext.enableBom = enableBom @@ -756,7 +757,7 @@ subprojects { } } - if (isNightlyBuild) { + if (ext.utMonitoringEnabled) { tasks.withType(Test) { doFirst { ext { diff --git a/buildSrc/src/main/groovy/org.sonar.build/BlackBoxTest.groovy b/buildSrc/src/main/groovy/org.sonar.build/BlackBoxTest.groovy index 46bc9ff0d03..bb5fa3b4485 100644 --- a/buildSrc/src/main/groovy/org.sonar.build/BlackBoxTest.groovy +++ b/buildSrc/src/main/groovy/org.sonar.build/BlackBoxTest.groovy @@ -4,11 +4,6 @@ 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') systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver') -- 2.39.5