Skip to content

Fix OSGi test setup: version syntax typo and testingBundle classpath#25

Open
zeitlinger wants to merge 2 commits intojack-berg:osgi-supportfrom
zeitlinger:fix/osgi-version-syntax
Open

Fix OSGi test setup: version syntax typo and testingBundle classpath#25
zeitlinger wants to merge 2 commits intojack-berg:osgi-supportfrom
zeitlinger:fix/osgi-version-syntax

Conversation

@zeitlinger
Copy link
Copy Markdown

Two small fixes found during review of open-telemetry#7964 (open-telemetry/opentelemetry-java).

Fix 1: Missing = in version constraint string

In otel.java-conventions.gradle.kts, the Kotlin string produced version"${@}" instead of version="${@}" — 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: testingBundle classpath causes silent test no-ops

The Bundle task uses compileClasspath by default for BND analysis. This means testImplementation dependencies are invisible to BND — including the @Testable annotation needed by the Test-Cases macro. With JUnit in testImplementation, BND can't resolve @Testable, the Test-Cases header 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) to testingBundleTask, which makes testImplementation deps visible to BND and allows junit-jupiter to move back to testImplementation where it belongs.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger marked this pull request as ready for review April 8, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant