Skip to content

Allow users to discover tests classes via zinc - #6901

Merged
lihaoyi merged 1 commit into
com-lihaoyi:mainfrom
alexarchambault:discover-tests-zinc
Mar 6, 2026
Merged

lihaoyi merged 1 commit into
com-lihaoyi:mainfrom
alexarchambault:discover-tests-zinc

Conversation

@alexarchambault

@alexarchambault alexarchambault commented Mar 5, 2026 •

Copy link
Copy Markdown
Collaborator

This allows users to enable test class discovery using the zinc analysis file, rather than by inspecting test class files.

This is useful when using Scala.js' junit4 compatibility library. Tests are annotated with @Test, but these annotations are nowhere to be found in the resulting class files, so that Mill's current test class discovery misses those. sbt finds those on the other hand, as it finds test classes using the zinc analysis file.

This PR allows users to do the same from Mill, by setting discoverTestsWithZinc to true in Scala test modules. This allows Mill to run Scala.js junit4 test suites, as shown in the tests added in this PR.

This is not enabled by default, as this is only useful in a very specific case (use of junit4 in Scala.js tests), and the current test discovery mechanism seems to work fine aside from that very specific case.

@alexarchambault
alexarchambault marked this pull request as ready for review March 5, 2026 19:15
@lihaoyi
lihaoyi merged commit e3e0beb into com-lihaoyi:main Mar 6, 2026
46 checks passed
@lefou lefou added this to the 1.1.3 milestone Mar 6, 2026
@alexarchambault
alexarchambault deleted the discover-tests-zinc branch March 9, 2026 15:45
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.

3 participants