Skip to content
Merged
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 benchmark-overhead/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repositories {
}

dependencies {
implementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
implementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))

testImplementation("org.testcontainers:testcontainers:1.21.1")
testImplementation("org.testcontainers:postgresql:1.21.1")
Expand Down
2 changes: 1 addition & 1 deletion conventions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dependencies {
implementation("net.ltgt.gradle:gradle-nullaway-plugin:2.2.0")
implementation("me.champeau.gradle:japicmp-gradle-plugin:0.4.6")

testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
testImplementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testImplementation("org.assertj:assertj-core:3.27.3")
Expand Down
2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ val CORE_DEPENDENCIES = listOf(
// There are dependencies included here that appear to have no usages, but are maintained at
// this top level to help consistently satisfy large numbers of transitive dependencies.
val DEPENDENCIES = listOf(
"org.junit.jupiter:junit-jupiter-api:5.12.2",
"org.junit.jupiter:junit-jupiter-api:5.13.0",
"org.spockframework:spock-core:2.4-M6-groovy-4.0",
"org.spockframework:spock-junit4:2.4-M6-groovy-4.0",

Expand Down
2 changes: 1 addition & 1 deletion examples/distro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ subprojects {

testImplementation("org.mockito:mockito-core:5.18.0")

testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
testImplementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
Expand Down
2 changes: 1 addition & 1 deletion examples/extension/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ dependencies {
testImplementation("io.opentelemetry:opentelemetry-api")
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.7.0-alpha")

testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
testImplementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
Expand Down
2 changes: 1 addition & 1 deletion gradle-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies {

testImplementation("org.assertj:assertj-core:3.27.3")

testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
testImplementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.ArgumentsProvider;
import org.junit.jupiter.params.support.ParameterDeclarations;

final class ValidRequestMethodsProvider implements ArgumentsProvider {

@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
public Stream<? extends Arguments> provideArguments(
ParameterDeclarations parameters, ExtensionContext context) {
return HttpConstants.KNOWN_METHODS.stream().map(Arguments::of);
}
}
2 changes: 1 addition & 1 deletion instrumentation-docs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.19.0")
implementation("io.opentelemetry:opentelemetry-sdk-common")

testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
testImplementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
testImplementation("org.assertj:assertj-core:3.27.3")
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.Assumptions
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.api.extension.ExtensionContext
import org.junit.jupiter.api.extension.RegisterExtension
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.Arguments.arguments
import org.junit.jupiter.params.provider.ArgumentsProvider
import org.junit.jupiter.params.provider.ArgumentsSource
import org.junit.jupiter.params.provider.MethodSource
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
import java.util.function.Consumer
Expand Down Expand Up @@ -83,7 +81,7 @@ class KotlinCoroutinesInstrumentationTest {
val tracer = testing.openTelemetry.getTracer("test")

@ParameterizedTest
@ArgumentsSource(DispatchersSource::class)
@MethodSource("dispatchersSourceArguments")
fun `cancellation prevents trace`(dispatcher: DispatcherWrapper) {
runCatching {
runTest(dispatcher) {
Expand Down Expand Up @@ -116,7 +114,7 @@ class KotlinCoroutinesInstrumentationTest {
}

@ParameterizedTest
@ArgumentsSource(DispatchersSource::class)
@MethodSource("dispatchersSourceArguments")
fun `propagates across nested jobs`(dispatcher: DispatcherWrapper) {
runTest(dispatcher) {
val goodDeferred = async { 1 }
Expand Down Expand Up @@ -310,7 +308,7 @@ class KotlinCoroutinesInstrumentationTest {
}

@ParameterizedTest
@ArgumentsSource(DispatchersSource::class)
@MethodSource("dispatchersSourceArguments")
fun `traced mono`(dispatcherWrapper: DispatcherWrapper) {
runTest(dispatcherWrapper) {
mono(dispatcherWrapper.dispatcher) {
Expand All @@ -337,7 +335,7 @@ class KotlinCoroutinesInstrumentationTest {
private val animalKey: ContextKey<String> = ContextKey.named("animal")

@ParameterizedTest
@ArgumentsSource(DispatchersSource::class)
@MethodSource("dispatchersSourceArguments")
fun `context contains expected value`(dispatcher: DispatcherWrapper) {
runTest(dispatcher) {
val context1 = Context.current().with(animalKey, "cat")
Expand Down Expand Up @@ -512,18 +510,16 @@ class KotlinCoroutinesInstrumentationTest {
span.end()
}

class DispatchersSource : ArgumentsProvider {
override fun provideArguments(context: ExtensionContext?): Stream<out Arguments> = Stream.of(
// Wrap dispatchers since it seems that ParameterizedTest tries to automatically close
// Closeable arguments with no way to avoid it.
arguments(DispatcherWrapper(Dispatchers.Default)),
arguments(DispatcherWrapper(Dispatchers.IO)),
arguments(DispatcherWrapper(Dispatchers.Unconfined)),
arguments(DispatcherWrapper(threadPool.asCoroutineDispatcher())),
arguments(DispatcherWrapper(singleThread.asCoroutineDispatcher())),
arguments(DispatcherWrapper(vertx.dispatcher()))
)
}
private fun dispatchersSourceArguments(): Stream<Arguments> = Stream.of(
// Wrap dispatchers since it seems that ParameterizedTest tries to automatically close
// Closeable arguments with no way to avoid it.
arguments(DispatcherWrapper(Dispatchers.Default)),
arguments(DispatcherWrapper(Dispatchers.IO)),
arguments(DispatcherWrapper(Dispatchers.Unconfined)),
arguments(DispatcherWrapper(threadPool.asCoroutineDispatcher())),
arguments(DispatcherWrapper(singleThread.asCoroutineDispatcher())),
arguments(DispatcherWrapper(vertx.dispatcher()))
)

class DispatcherWrapper(val dispatcher: CoroutineDispatcher) {
override fun toString(): String = dispatcher.toString()
Expand Down Expand Up @@ -566,7 +562,7 @@ class KotlinCoroutinesInstrumentationTest {
// regression test for
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/11411
@ParameterizedTest
@ArgumentsSource(DispatchersSource::class)
@MethodSource("dispatchersSourceArguments")
fun `dispatch does not propagate context`(dispatcher: DispatcherWrapper) {
Assumptions.assumeTrue(dispatcher.dispatcher != Dispatchers.Unconfined)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.api.extension.ExtensionContext
import org.junit.jupiter.api.extension.RegisterExtension
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.Arguments.arguments
import org.junit.jupiter.params.provider.ArgumentsProvider
import org.junit.jupiter.params.provider.ArgumentsSource
import org.junit.jupiter.params.provider.MethodSource
import java.util.concurrent.Executors
import java.util.stream.Stream

Expand All @@ -58,7 +56,7 @@ class KotlinCoroutines13InstrumentationTest {
val tracer = testing.openTelemetry.getTracer("test")

@ParameterizedTest
@ArgumentsSource(DispatchersSource::class)
@MethodSource("dispatchersSourceArguments")
fun `traced across channels`(dispatcher: DispatcherWrapper) {
runTest(dispatcher) {
val producer = produce {
Expand Down Expand Up @@ -110,7 +108,7 @@ class KotlinCoroutines13InstrumentationTest {
}

@ParameterizedTest
@ArgumentsSource(DispatchersSource::class)
@MethodSource("dispatchersSourceArguments")
fun `traced mono with context propagation operator`(dispatcherWrapper: DispatcherWrapper) {
runTest(dispatcherWrapper) {
val currentContext = Context.current()
Expand Down Expand Up @@ -145,7 +143,7 @@ class KotlinCoroutines13InstrumentationTest {
}

@ParameterizedTest
@ArgumentsSource(DispatchersSource::class)
@MethodSource("dispatchersSourceArguments")
fun `traced flux`(dispatcherWrapper: DispatcherWrapper) {
runTest(dispatcherWrapper) {
flux(dispatcherWrapper.dispatcher) {
Expand Down Expand Up @@ -198,17 +196,15 @@ class KotlinCoroutines13InstrumentationTest {
}
}

class DispatchersSource : ArgumentsProvider {
override fun provideArguments(context: ExtensionContext?): Stream<out Arguments> = Stream.of(
// Wrap dispatchers since it seems that ParameterizedTest tries to automatically close
// Closeable arguments with no way to avoid it.
arguments(DispatcherWrapper(Dispatchers.Default)),
arguments(DispatcherWrapper(Dispatchers.IO)),
arguments(DispatcherWrapper(Dispatchers.Unconfined)),
arguments(DispatcherWrapper(threadPool.asCoroutineDispatcher())),
arguments(DispatcherWrapper(singleThread.asCoroutineDispatcher())),
)
}
private fun dispatchersSourceArguments(): Stream<Arguments> = Stream.of(
// Wrap dispatchers since it seems that ParameterizedTest tries to automatically close
// Closeable arguments with no way to avoid it.
arguments(DispatcherWrapper(Dispatchers.Default)),
arguments(DispatcherWrapper(Dispatchers.IO)),
arguments(DispatcherWrapper(Dispatchers.Unconfined)),
arguments(DispatcherWrapper(threadPool.asCoroutineDispatcher())),
arguments(DispatcherWrapper(singleThread.asCoroutineDispatcher())),
)

class DispatcherWrapper(val dispatcher: CoroutineDispatcher) {
override fun toString(): String = dispatcher.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,26 @@ graalvmNative {

binaries.all {
resources.autodetect()

// see https://github.com/junit-team/junit5/wiki/Upgrading-to-JUnit-5.13
// should not be needed after updating native build tools to 0.11.0
val initializeAtBuildTime = listOf(
"org.junit.jupiter.api.DisplayNameGenerator\$IndicativeSentences",
"org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor\$ClassInfo",
"org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor\$LifecycleMethods",
"org.junit.jupiter.engine.descriptor.ClassTemplateInvocationTestDescriptor",
"org.junit.jupiter.engine.descriptor.ClassTemplateTestDescriptor",
"org.junit.jupiter.engine.descriptor.DynamicDescendantFilter\$Mode",
"org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector\$1",
"org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor\$MethodInfo",
"org.junit.jupiter.engine.discovery.ClassSelectorResolver\$DummyClassTemplateInvocationContext",
"org.junit.platform.engine.support.store.NamespacedHierarchicalStore\$EvaluatedValue",
"org.junit.platform.launcher.core.DiscoveryIssueNotifier",
"org.junit.platform.launcher.core.HierarchicalOutputDirectoryProvider",
"org.junit.platform.launcher.core.LauncherDiscoveryResult\$EngineResultInfo",
"org.junit.platform.suite.engine.SuiteTestDescriptor\$LifecycleMethods",
)
buildArgs.add("--initialize-at-build-time=${initializeAtBuildTime.joinToString(",")}")
}

// See https://github.com/graalvm/native-build-tools/issues/572
Expand Down
12 changes: 12 additions & 0 deletions javaagent-tooling/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ testing {
// Used by byte-buddy but not brought in as a transitive dependency.
compileOnly("com.google.code.findbugs:annotations")
}
targets {
all {
testTask.configure {
filter {
// Helper class used in test that refers to a class that is missing from the test
// classpath. We need to exclude it to avoid junit failing while it is searching for
// test classes.
excludeTestsMatching("MissingTypeTest\$SomeClass")
}
}
}
}
}

val testPatchBytecodeVersion by registering(JvmTestSuite::class) {
Expand Down
24 changes: 24 additions & 0 deletions smoke-tests-otel-starter/spring-boot-3.2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,28 @@ graalvmNative {
useJUnitPlatform()
setForkEvery(1)
}

// see https://github.com/junit-team/junit5/wiki/Upgrading-to-JUnit-5.13
// should not be needed after updating native build tools to 0.11.0
val initializeAtBuildTime = listOf(
"org.junit.jupiter.api.DisplayNameGenerator\$IndicativeSentences",
"org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor\$ClassInfo",
"org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor\$LifecycleMethods",
"org.junit.jupiter.engine.descriptor.ClassTemplateInvocationTestDescriptor",
"org.junit.jupiter.engine.descriptor.ClassTemplateTestDescriptor",
"org.junit.jupiter.engine.descriptor.DynamicDescendantFilter\$Mode",
"org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector\$1",
"org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor\$MethodInfo",
"org.junit.jupiter.engine.discovery.ClassSelectorResolver\$DummyClassTemplateInvocationContext",
"org.junit.platform.engine.support.store.NamespacedHierarchicalStore\$EvaluatedValue",
"org.junit.platform.launcher.core.DiscoveryIssueNotifier",
"org.junit.platform.launcher.core.HierarchicalOutputDirectoryProvider",
"org.junit.platform.launcher.core.LauncherDiscoveryResult\$EngineResultInfo",
"org.junit.platform.suite.engine.SuiteTestDescriptor\$LifecycleMethods",
)
binaries {
named("test") {
buildArgs.add("--initialize-at-build-time=${initializeAtBuildTime.joinToString(",")}")
}
}
}
24 changes: 24 additions & 0 deletions smoke-tests-otel-starter/spring-boot-3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,28 @@ graalvmNative {
useJUnitPlatform()
setForkEvery(1)
}

// see https://github.com/junit-team/junit5/wiki/Upgrading-to-JUnit-5.13
// should not be needed after updating native build tools to 0.11.0
val initializeAtBuildTime = listOf(
"org.junit.jupiter.api.DisplayNameGenerator\$IndicativeSentences",
"org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor\$ClassInfo",
"org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor\$LifecycleMethods",
"org.junit.jupiter.engine.descriptor.ClassTemplateInvocationTestDescriptor",
"org.junit.jupiter.engine.descriptor.ClassTemplateTestDescriptor",
"org.junit.jupiter.engine.descriptor.DynamicDescendantFilter\$Mode",
"org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector\$1",
"org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor\$MethodInfo",
"org.junit.jupiter.engine.discovery.ClassSelectorResolver\$DummyClassTemplateInvocationContext",
"org.junit.platform.engine.support.store.NamespacedHierarchicalStore\$EvaluatedValue",
"org.junit.platform.launcher.core.DiscoveryIssueNotifier",
"org.junit.platform.launcher.core.HierarchicalOutputDirectoryProvider",
"org.junit.platform.launcher.core.LauncherDiscoveryResult\$EngineResultInfo",
"org.junit.platform.suite.engine.SuiteTestDescriptor\$LifecycleMethods",
)
binaries {
named("test") {
buildArgs.add("--initialize-at-build-time=${initializeAtBuildTime.joinToString(",")}")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,28 @@ graalvmNative {
useJUnitPlatform()
setForkEvery(1)
}

// see https://github.com/junit-team/junit5/wiki/Upgrading-to-JUnit-5.13
// should not be needed after updating native build tools to 0.11.0
val initializeAtBuildTime = listOf(
"org.junit.jupiter.api.DisplayNameGenerator\$IndicativeSentences",
"org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor\$ClassInfo",
"org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor\$LifecycleMethods",
"org.junit.jupiter.engine.descriptor.ClassTemplateInvocationTestDescriptor",
"org.junit.jupiter.engine.descriptor.ClassTemplateTestDescriptor",
"org.junit.jupiter.engine.descriptor.DynamicDescendantFilter\$Mode",
"org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector\$1",
"org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor\$MethodInfo",
"org.junit.jupiter.engine.discovery.ClassSelectorResolver\$DummyClassTemplateInvocationContext",
"org.junit.platform.engine.support.store.NamespacedHierarchicalStore\$EvaluatedValue",
"org.junit.platform.launcher.core.DiscoveryIssueNotifier",
"org.junit.platform.launcher.core.HierarchicalOutputDirectoryProvider",
"org.junit.platform.launcher.core.LauncherDiscoveryResult\$EngineResultInfo",
"org.junit.platform.suite.engine.SuiteTestDescriptor\$LifecycleMethods",
)
binaries {
named("test") {
buildArgs.add("--initialize-at-build-time=${initializeAtBuildTime.joinToString(",")}")
}
}
}
Loading