Skip to content

Conversation

@FusionBrah
Copy link

@FusionBrah FusionBrah commented Jan 8, 2026

Summary

  • Adds testQuick command that uses bytecode callgraph analysis to run only tests affected by code changes
  • Re-runs previously failed tests even without code changes
  • Fixes JUnit 4 bug where fullyQualifiedName includes method name ("class.method" vs "class")
  • Supports cross-module dependency tracking (changes in dependency module trigger tests in dependent modules)
  • Works with Java, Scala, and Kotlin projects

Fixes #4109

Test plan

  • Integration test: single module Java (JUnit4) - first run, skip run, code change, failed re-run, fix, final skip
  • Integration test: multi-module Java - changes in bar module trigger tests in dependent foo.test
  • Integration test: Scala module (uTest) - full testQuick cycle
  • Example test: example/javalib/testing/8-test-quick
  • Example test: example/scalalib/testing/8-test-quick

Documentation

  • Added testQuick section to javalib/testing.adoc
  • Added testQuick section to scalalib/testing.adoc

FusionBrah and others added 7 commits January 9, 2026 10:41
Implements the `testQuick` command that only runs tests affected by code
changes, using bytecode callgraph analysis to detect which test classes
need to re-run. Also re-runs previously failed tests even without code
changes.

Fixes the JUnit 4 bug where failed tests weren't re-run because JUnit
reports fullyQualifiedName as "class.method" while discoveredTestClasses
returns just "class".

Fixes com-lihaoyi#4109

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The `testQuick` feature adds `runner.codesig` as a dependency of
`libs.javalib`, which brings ASM and changes dependency scopes in
the Mill build classpath. This updates the golden files to reflect
the new dependencies.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add multi-module integration test (bar → foo dependency tracking)
- Add Scala module integration test (qux with uTest)
- Add Java example in example/javalib/testing/8-test-quick
- Add Scala example in example/scalalib/testing/8-test-quick
- Update javalib and scalalib testing.adoc with testQuick documentation

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add try-catch around JSON parsing with graceful fallback to running all tests
- Add safeWriteState helper for file write operations with error logging
- Add error handling for test artifact cleanup

This prevents cryptic crashes when state files are corrupted and provides
informative messages to users when I/O operations fail.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The testQuick feature adds runner.codesig as a dependency, which brings
additional jars to the build classpath. This updates the golden test to
include the new jars:
- mill-core-internal-cli_3-SNAPSHOT.jar
- mill-core-internal_3-SNAPSHOT.jar
- mill-runner-codesig_3-SNAPSHOT.jar

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

Fine-grained selective testing at a class-level granularity (1500USD Bounty)

1 participant