Fix OSGi test setup: version syntax typo and testingBundle classpath#25
Merged
jack-berg merged 2 commits intojack-berg:osgi-supportfrom Apr 15, 2026
Merged
Conversation
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
jack-berg
reviewed
Apr 15, 2026
| // The Bundle task uses compileClasspath by default for BND analysis (e.g. resolving the | ||
| // @Testable annotation to populate Test-Cases). Without this, testImplementation dependencies | ||
| // like junit-jupiter are invisible to BND, causing Test-Cases to be empty and 0 tests to run. | ||
| classpath(sourceSets.test.get().runtimeClasspath) |
Owner
There was a problem hiding this comment.
Ah, this is what was missing for that required implementation instead of testImplementation on line 41. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small fixes found during review of open-telemetry#7964 (open-telemetry/opentelemetry-java).
Fix 1: Missing
=in version constraint stringIn
otel.java-conventions.gradle.kts, the Kotlin string producedversion"${@}"instead ofversion="${@}"— a one-character typo. The test bundle in this same PR had it right; the conventions file didn't.BND's lenient parser accepts both forms so the generated manifest is correct either way, but the code is wrong and inconsistent.
Fix 2:
testingBundleclasspath causes silent test no-opsThe
Bundletask usescompileClasspathby default for BND analysis. This meanstestImplementationdependencies are invisible to BND — including the@Testableannotation needed by theTest-Casesmacro. With JUnit intestImplementation, BND can't resolve@Testable, theTest-Casesheader comes out empty, 0 tests are discovered, and the task reports success regardless of whether any assertions would have failed.Fix: add
classpath(sourceSets.test.get().runtimeClasspath)totestingBundleTask, which makestestImplementationdeps visible to BND and allowsjunit-jupiterto move back totestImplementationwhere it belongs.