Skip to content

Commit

Permalink
✅ correct test expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandens committed Oct 15, 2024
1 parent 6ab9bdd commit c16411c
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,22 @@ class OTelJavaagentPluginFunctionalTest {
val runner = GradleRunner.create()
runner.forwardOutput()
runner.withPluginClasspath()
runner.withArguments("extendedAgent", "run")
runner.withArguments("mergeInstrumentationServiceFiles", "extendedAgent", "run")
runner.withProjectDir(projectDir)
runner.withDebug(true)
val result = runner.build()

// Verify the result
// TODO use testcontainers to start an otel fake backend and retrieve spans from it here to verify instrumentation worked
assertTrue(result.output.contains("AgentInstaller - Installed 1 extension(s)"))
assertTrue(result.output.contains("InstrumentationLoader - Installed 1 instrumenter(s)"))
/* TOOD fix this
assertTrue(result.output.contains("InstrumentationLoader - Installed 254 instrumenter(s)"))
assertTrue(
result.output.contains(
"Applying instrumentation: sample [class io.opentelemetry.javaagent.instrumentation.ryandens.SampleInstrumentationModule]",
"Applying instrumentation: sample [class com.ryandens.example.SampleInstrumentationModule]",
),
)
assertTrue(result.output.contains("LoggingSpanExporter - 'iterative'")) // span name
assertTrue(result.output.contains(" [tracer: FibonacciTracer:]")) // tracer name
*/
val agent = File(projectDir, "app/build/agents/extended-opentelemetry-javaagent.jar")
assertTrue(agent.exists())
}
Expand Down

0 comments on commit c16411c

Please sign in to comment.