Skip to content

Commit 22e0953

Browse files
Update Gradle Daemon smoke tests to use Maven repository proxy when available
1 parent 1a9af7b commit 22e0953

File tree

19 files changed

+183
-1
lines changed

19 files changed

+183
-1
lines changed

dd-smoke-tests/gradle/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ test {
1818
events "passed", "skipped", "failed", "standardOut", "standardError"
1919
}
2020

21+
if (project.hasProperty("mavenRepositoryProxy")) {
22+
// propagate proxy URL to tests, to then propagate it to nested Gradle builds
23+
environment "MAVEN_REPOSITORY_PROXY", project.property("mavenRepositoryProxy")
24+
}
25+
2126
// overriding the default timeout of 9 minutes set in configure_tests.gradle,
2227
// as Gradle smoke tests might run for a longer duration
2328
timeout = Duration.of(15, ChronoUnit.MINUTES)

dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleDaemonSmokeTest.groovy

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,19 @@ class GradleDaemonSmokeTest extends AbstractGradleTest {
239239
}
240240

241241
private runGradle(String gradleVersion, List<String> arguments, boolean successExpected) {
242+
def buildEnv = ["GRADLE_VERSION": gradleVersion]
243+
244+
def mavenRepositoryProxy = System.getenv("MAVEN_REPOSITORY_PROXY")
245+
if (mavenRepositoryProxy != null) {
246+
buildEnv += ["MAVEN_REPOSITORY_PROXY": System.getenv("MAVEN_REPOSITORY_PROXY")]
247+
}
248+
242249
GradleRunner gradleRunner = GradleRunner.create()
243250
.withTestKitDir(testKitFolder.toFile())
244251
.withProjectDir(projectFolder.toFile())
245252
.withGradleVersion(gradleVersion)
246253
.withArguments(arguments)
247-
.withEnvironment(["GRADLE_VERSION": gradleVersion])
254+
.withEnvironment(buildEnv)
248255
.forwardOutput()
249256

250257
println "${new Date()}: $specificationContext.currentIteration.displayName - Starting Gradle run"

dd-smoke-tests/gradle/src/test/resources/test-corrupted-config-legacy-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-corrupted-config-new-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-failed-flaky-retries/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-failed-legacy-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-failed-new-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-skip-legacy-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-skip-new-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ gradlePlugin {
1414

1515
repositories {
1616
mavenLocal()
17+
18+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
19+
if (proxyUrl) {
20+
println "Using proxy repository: $proxyUrl"
21+
maven {
22+
url = proxyUrl
23+
allowInsecureProtocol = true
24+
}
25+
}
26+
1727
mavenCentral()
1828
}
1929

dd-smoke-tests/gradle/src/test/resources/test-succeed-junit-4-class-ordering/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-succeed-junit-5/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ apply plugin: 'jvm-test-suite'
33

44
repositories {
55
mavenLocal()
6+
7+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
8+
if (proxyUrl) {
9+
println "Using proxy repository: $proxyUrl"
10+
maven {
11+
url = proxyUrl
12+
allowInsecureProtocol = true
13+
}
14+
}
15+
616
mavenCentral()
717
}
818

dd-smoke-tests/gradle/src/test/resources/test-succeed-legacy-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-legacy-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-new-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-module-legacy-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ subprojects {
33

44
repositories {
55
mavenLocal()
6+
7+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
8+
if (proxyUrl) {
9+
println "Using proxy repository: $proxyUrl"
10+
maven {
11+
url = proxyUrl
12+
allowInsecureProtocol = true
13+
}
14+
}
15+
616
mavenCentral()
717
}
818

dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-module-new-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ subprojects {
33

44
repositories {
55
mavenLocal()
6+
7+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
8+
if (proxyUrl) {
9+
println "Using proxy repository: $proxyUrl"
10+
maven {
11+
url = proxyUrl
12+
allowInsecureProtocol = true
13+
}
14+
}
15+
616
mavenCentral()
717
}
818

dd-smoke-tests/gradle/src/test/resources/test-succeed-new-instrumentation/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

dd-smoke-tests/gradle/src/test/resources/test-succeed-old-gradle/build.gradleTest

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ apply plugin: 'java'
22

33
repositories {
44
mavenLocal()
5+
6+
def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY")
7+
if (proxyUrl) {
8+
println "Using proxy repository: $proxyUrl"
9+
maven {
10+
url = proxyUrl
11+
allowInsecureProtocol = true
12+
}
13+
}
14+
515
mavenCentral()
616
}
717

0 commit comments

Comments
 (0)