Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ tasks {
// Append wildcard "*" last to import any other referenced packages
val optionalPackages = mutableListOf("javax.annotation")
optionalPackages.addAll(otelJava.osgiOptionalPackages.get())
val importPackages = optionalPackages.joinToString(",") { it + ".*;resolution:=optional;version\"\${@}\"" } + ",*"
val importPackages = optionalPackages.joinToString(",") { it + ".*;resolution:=optional;version=\"\${@}\"" } + ",*"

bnd(mapOf(
// Once https://github.com/open-telemetry/opentelemetry-java/issues/6970 is resolved, exclude .internal packages
Expand Down
8 changes: 5 additions & 3 deletions integration-tests/osgi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ dependencies {
// - with file configuration
testImplementation(project(":sdk:all"))

// For some reason, changing this to testImplementation causes the tests to pass even when failures are present.
// Probably some dependency resolution interplay with otel.java-conventions but I couldn't figure it out.
implementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.junit.jupiter:junit-jupiter")

testCompileOnly("org.osgi:osgi.core")
testImplementation("org.osgi:org.osgi.test.junit5")
Expand All @@ -52,6 +50,10 @@ dependencies {
val testingBundleTask = tasks.register<Bundle>("testingBundle") {
archiveClassifier.set("testing")
from(sourceSets.test.get().output)
// 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)
bundle {
bnd(
"Test-Cases: \${classes;HIERARCHY_INDIRECTLY_ANNOTATED;org.junit.platform.commons.annotation.Testable;CONCRETE}",
Expand Down