Skip to content

Commit 14ee0cb

Browse files
Fix proxy settings for maven smoke tests (#9099)
* see if the issue is with settings.xml. Also change update policy to `never` * Disable skipping tests based on git changes * Give names to projects and print command * some more debug info * Revert "Give names to projects and print command" This reverts commit 7f91252. # Conflicts: # dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy * more debug * more debug * set and create MAVEN_USER_HOME in base gradle job * fix maven home * Use mirror instead of repository * offline mode doesn't work * minimize the diff * remove debug and m2 folder changes * Revert "remove debug and m2 folder changes" This reverts commit 02945a2. * undo merged fix * Revert "undo merged fix" This reverts commit 9ad2380. * use "package" in addition to go-offline * fix error, only run some tests * remove "package" because it's too slow * Reapply "remove debug and m2 folder changes" This reverts commit 30b1769. * Cleanup for PR --------- Co-authored-by: Santiago Mola <[email protected]>
1 parent 6cca46e commit 14ee0cb

File tree

17 files changed

+17
-586
lines changed

17 files changed

+17
-586
lines changed

dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class MavenSmokeTest extends CiVisibilitySmokeTest {
5757
}
5858

5959
def "test #projectName, v#mavenVersion"() {
60+
println "Starting: ${projectName} ${mavenVersion}"
6061
Assumptions.assumeTrue(Jvm.current.isJavaVersionCompatible(minSupportedJavaVersion),
6162
"Current JVM " + Jvm.current.javaVersion + " is not compatible with minimum required version " + minSupportedJavaVersion)
6263

@@ -240,6 +241,9 @@ class MavenSmokeTest extends CiVisibilitySmokeTest {
240241
def projectResourcesUri = this.getClass().getClassLoader().getResource(projectFilesSources).toURI()
241242
def projectResourcesPath = Paths.get(projectResourcesUri)
242243
copyFolder(projectResourcesPath, projectHome)
244+
245+
def sharedSettingsPath = Paths.get(this.getClass().getClassLoader().getResource("settings.mirror.xml").toURI())
246+
Files.copy(sharedSettingsPath, projectHome.resolve("settings.mirror.xml"))
243247
}
244248

245249
private void copyFolder(Path src, Path dest) throws IOException {
@@ -327,7 +331,10 @@ class MavenSmokeTest extends CiVisibilitySmokeTest {
327331
command.addAll(jvmArguments(runWithAgent, setServiceName, additionalAgentArgs))
328332
command.addAll((String[]) ["-jar", mavenRunnerShadowJar])
329333
command.addAll(programArguments())
330-
command.addAll(["-s", "${projectHome.toAbsolutePath()}/settings.xml".toString()])
334+
335+
if (System.getenv().get("MAVEN_REPOSITORY_PROXY") != null) {
336+
command.addAll(["-s", "${projectHome.toAbsolutePath()}/settings.mirror.xml".toString()])
337+
}
331338
command.addAll(mvnCommand)
332339

333340
ProcessBuilder processBuilder = new ProcessBuilder(command)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<settings>
2+
<mirrors>
3+
<mirror>
4+
<id>env-proxy</id>
5+
<mirrorOf>*</mirrorOf>
6+
<url>${env.MAVEN_REPOSITORY_PROXY}</url>
7+
</mirror>
8+
</mirrors>
9+
</settings>

dd-smoke-tests/maven/src/test/resources/test_failed_maven_run_flaky_retries/settings.xml

Lines changed: 0 additions & 39 deletions
This file was deleted.

dd-smoke-tests/maven/src/test/resources/test_successful_maven_run/settings.xml

Lines changed: 0 additions & 39 deletions
This file was deleted.

dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_builtin_coverage/settings.xml

Lines changed: 0 additions & 39 deletions
This file was deleted.

dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_child_service_propagation/settings.xml

Lines changed: 0 additions & 39 deletions
This file was deleted.

dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_impacted_tests/settings.xml

Lines changed: 0 additions & 39 deletions
This file was deleted.

dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_junit4_class_ordering/settings.xml

Lines changed: 0 additions & 39 deletions
This file was deleted.

dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_junit4_class_ordering_parallel/settings.xml

Lines changed: 0 additions & 39 deletions
This file was deleted.

dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_junit_platform_runner/settings.xml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)