Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring boot test versions #11357

Closed
zeitlinger opened this issue May 15, 2024 · 7 comments · Fixed by #11474
Closed

spring boot test versions #11357

zeitlinger opened this issue May 15, 2024 · 7 comments · Fixed by #11474
Assignees

Comments

@zeitlinger
Copy link
Member

zeitlinger commented May 15, 2024

Is your feature request related to a problem? Please describe.

question from #11262 (comment)

we have the capability to test with earliest supported boot version, by using library dependencies, but looks like we aren't taking advantage of that capability and are just pinning the spring boot library dependencies to the latest 2.x and 3.x versions
it's a good question though, as typically we test all the instrumentation against an "earliest supported version" (and document that as the earliest supported version).
we should decide if/how we want to test/support earlier Spring Boot minor versions

@zeitlinger zeitlinger self-assigned this May 15, 2024
@zeitlinger
Copy link
Member Author

@trask the tests are mainly in the smoke tests, where the version comes from the plugin id.

would this still work?

@trask
Copy link
Member

trask commented May 15, 2024

maybe could run the smoke tests twice, e.g. once with earliest 2.x version and one with latest 2.x version?

@trask
Copy link
Member

trask commented May 15, 2024

(maybe would require building two different images?)

@zeitlinger
Copy link
Member Author

there's no image build step - we'd just need to update the version

@laurit do you have an idea how to do that?

@trask
Copy link
Member

trask commented May 15, 2024

check out

val testV1_3_3 by registering(JvmTestSuite::class) {
dependencies {
implementation(project(":instrumentation:reactor:reactor-kafka-1.0:testing"))
if (testLatestDeps) {
implementation("io.projectreactor.kafka:reactor-kafka:+")
implementation("io.projectreactor:reactor-core:3.4.+")
} else {
implementation("io.projectreactor.kafka:reactor-kafka:1.3.3")
}
}
targets {
all {
testTask.configure {
systemProperty("hasConsumerGroup", true)
}
}
}
}
(there are other similar examples in this repo also)

@zeitlinger
Copy link
Member Author

that doesn't work - the version here has to be exact:

@zeitlinger
Copy link
Member Author

we could add this script to be called before gradle

Index: .github/scripts/set-earliest-spring-boot-version.sh
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8

diff --git a/.github/scripts/set-earliest-spring-boot-version.sh b/.github/scripts/set-earliest-spring-boot-version.sh
new file mode 100755
--- /dev/null (date 1716880087153)
+++ b/.github/scripts/set-earliest-spring-boot-version.sh (date 1716880087153)
@@ -0,0 +1,6 @@
+#!/bin/bash -e
+
+sed -i 's/id("org.springframework.boot") version "[^"]"/id("org.springframework.boot") version "2.4.0"/' smoke-tests-otel-starter/spring-boot-2/build.gradle.kts
+sed -i 's/id("org.springframework.boot") version "[^"]
"/id("org.springframework.boot") version "2.4.0"/' smoke-tests-otel-starter/spring-boot-reactive-2/build.gradle.kts
+sed -i 's/id("org.springframework.boot") version "[^"]"/id("org.springframework.boot") version "3.0.0"/' smoke-tests-otel-starter/spring-boot-3/build.gradle.kts
+sed -i 's/id("org.springframework.boot") version "[^"]
"/id("org.springframework.boot") version "3.0.0"/' smoke-tests-otel-starter/spring-boot-reactive-3/build.gradle.kts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants