Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not get test method warnings with munit #8441

Open
mwisnicki opened this issue Feb 24, 2025 · 1 comment · Fixed by #8445
Open

Could not get test method warnings with munit #8441

mwisnicki opened this issue Feb 24, 2025 · 1 comment · Fixed by #8445
Assignees
Labels
comp: ci visibility Continuous Integration Visibility type: bug
Milestone

Comments

@mwisnicki
Copy link

Tracer Version(s)

1.46.1~8e0205904b

Java Version(s)

21.0.6

JVM Vendor

Eclipse Adoptium / Temurin

Bug Report

When running munit (scala) tests I'm getting a lot of warnings like these:

[dd.trace 2025-02-24 16:19:32:097 +0000] [io-compute-0] WARN datadog.trace.instrumentation.junit4.JUnit4Utils - Could not get test method
java.lang.NoSuchMethodException: com.example.Test.Name of test()
	at java.base/java.lang.Class.getMethod(Class.java:2395)
	at datadog.trace.instrumentation.junit4.JUnit4Utils.getTestMethod(JUnit4Utils.java:139)
	at datadog.trace.instrumentation.junit4.JUnit4Utils.toTestIdentifier(JUnit4Utils.java:297)
	at munit.MUnitRunner.runTest(MUnitRunner.scala:269)
	at munit.MUnitRunner.runTests$$anonfun$1(MUnitRunner.scala:135)
	at scala.collection.Iterator$$anon$9.next(Iterator.scala:584)
	at munit.MUnitRunner.loop$1(MUnitRunner.scala:150)
	at munit.MUnitRunner.sequenceFutures(MUnitRunner.scala:163)
	at munit.MUnitRunner.runTests(MUnitRunner.scala:135)
	at munit.MUnitRunner.runAll$$anonfun$1(MUnitRunner.scala:183)
	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:470)
	at cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:743)

I guess because munit tests don't correspond to actual methods.
The test result seems visible in datadog.

Expected Behavior

No warnings.

Reproduction Code

package com.example

import munit.CatsEffectSuite

class Test extends CatsEffectSuite {
  test("Name of test") {}
}
@nikita-tkachenko-datadog
Copy link
Contributor

Hi @mwisnicki, thank you for reporting this! The fix will be included in the upcoming DD Java tracer release scheduled for March, 3rd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: ci visibility Continuous Integration Visibility type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants