From 95f3d37b3f35387d25743f5003192827804b6dea Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Wed, 1 Dec 2021 01:02:23 +0200 Subject: [PATCH] Use ratpack 1.4.1 for testing (#4748) * Use ratpack 1.4.1 for testing * don't force netty version in ratpack tests * spotless * Apply suggestions from code review Co-authored-by: Trask Stalnaker * enable https test Co-authored-by: Trask Stalnaker --- .../ratpack-1.4/javaagent/build.gradle.kts | 20 ++++++++++++++++++- .../ratpack-1.4/library/build.gradle.kts | 20 ++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/instrumentation/ratpack-1.4/javaagent/build.gradle.kts b/instrumentation/ratpack-1.4/javaagent/build.gradle.kts index 806e28de42..f329c966a1 100644 --- a/instrumentation/ratpack-1.4/javaagent/build.gradle.kts +++ b/instrumentation/ratpack-1.4/javaagent/build.gradle.kts @@ -17,7 +17,9 @@ dependencies { testImplementation(project(":instrumentation:ratpack-1.4:testing")) - testLibrary("io.ratpack:ratpack-test:1.4.0") + // 1.4.0 has a bug which makes tests flaky + // (https://github.com/ratpack/ratpack/commit/dde536ac138a76c34df03a0642c88d64edde688e) + testLibrary("io.ratpack:ratpack-test:1.4.1") if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) { testImplementation("com.sun.activation:jakarta.activation:1.2.2") @@ -26,3 +28,19 @@ dependencies { // Requires old Guava. Can't use enforcedPlatform since predates BOM configurations.testRuntimeClasspath.resolutionStrategy.force("com.google.guava:guava:19.0") + +// to allow all tests to pass we need to choose a specific netty version +if (!(findProperty("testLatestDeps") as Boolean)) { + configurations.configureEach { + if (!name.contains("muzzle")) { + resolutionStrategy { + eachDependency { + // specifying a fixed version for all libraries with io.netty group + if (requested.group == "io.netty") { + useVersion("4.1.31.Final") + } + } + } + } + } +} diff --git a/instrumentation/ratpack-1.4/library/build.gradle.kts b/instrumentation/ratpack-1.4/library/build.gradle.kts index e8c8465db6..300ad6a6c9 100644 --- a/instrumentation/ratpack-1.4/library/build.gradle.kts +++ b/instrumentation/ratpack-1.4/library/build.gradle.kts @@ -8,7 +8,9 @@ dependencies { testImplementation(project(":instrumentation:ratpack-1.4:testing")) - testLibrary("io.ratpack:ratpack-test:1.4.0") + // 1.4.0 has a bug which makes tests flaky + // (https://github.com/ratpack/ratpack/commit/dde536ac138a76c34df03a0642c88d64edde688e) + testLibrary("io.ratpack:ratpack-test:1.4.1") testLibrary("io.ratpack:ratpack-guice:1.4.0") if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) { @@ -18,3 +20,19 @@ dependencies { // Requires old Guava. Can't use enforcedPlatform since predates BOM configurations.testRuntimeClasspath.resolutionStrategy.force("com.google.guava:guava:19.0") + +// to allow all tests to pass we need to choose a specific netty version +if (!(findProperty("testLatestDeps") as Boolean)) { + configurations.configureEach { + if (!name.contains("muzzle")) { + resolutionStrategy { + eachDependency { + // specifying a fixed version for all libraries with io.netty group + if (requested.group == "io.netty") { + useVersion("4.1.31.Final") + } + } + } + } + } +}