Skip to content

Quarkus test support - #6820

Merged
lihaoyi merged 11 commits into
com-lihaoyi:mainfrom
vaslabs-ltd:quarkus-test-support
Feb 16, 2026
Merged

lihaoyi merged 11 commits into
com-lihaoyi:mainfrom
vaslabs-ltd:quarkus-test-support

Conversation

@vaslabs

@vaslabs vaslabs commented Feb 11, 2026 •

Copy link
Copy Markdown
Contributor

Part of #3549 and #6496

Quarkus Test support feature

  • QuarkusTests provides the ability to run the unit tests against the relevant modules via serializing a test app model.
  • The discovery needs both the quarkus junit and the quarkus bootstrap deps in the runtime classpath to function. At this moment, I'm not completely sure why the DiscoverJunit5Tests ZincOp is not working but it works with running a forked jvm with the classpath of the runtime classpath (so the QuarkusTest annotation is detected and works).
  • Added a testDiscoverRuntimeOptions for easier integration with the TestModule instead of overriding the whole discoveredTestClasses.
  • Updated the example with the test run
  • Added the quarkus example in the web docs

Other fixes

I've noticed that springboot todo started failing with a docker environment not found error. Probably some update in docker as I updated the deps and (at least locally) it seems fine now:

  • Fixed javalib springboot todo example docker failure
  • Fixed kotlinlib springboot todo example docker failure

What is not supported yet

  • Native builds & tests
  • Multi-module Quarkus builds.

Future PRs

For the native builds tests, I've started a separate work, I think it's close, just missing something to cause the augmented result to generate a native build too.

Also, quarkus has a lot into it, so perhaps in the future we can have a dedicated page like we do with SpringBoot

@vaslabs
vaslabs force-pushed the quarkus-test-support branch from e29b28e to 1108de8 Compare February 12, 2026 07:02
@vaslabs

vaslabs commented Feb 13, 2026

Copy link
Copy Markdown
Contributor Author

I've managed to make tests work with a caveat, we need to implement a new discoveredTestClasses for Quarkus. the classloader that handles the discovery somehow loses the AugmentActionImpl with

// TODO implement a new discoveredTestClasses for Quarkus
    override def discoveredTestClasses: T[Seq[String]] = Task {
      val worker = jvmWorker().internalWorker()
      worker.apply(
        mill.javalib.api.internal.ZincOp.DiscoverJunit5Tests(
          runClasspath().map(_.path),
          testClasspath().map(_.path),
          classesDir()
        ),
        javaHome().map(_.path),
        javaRuntimeOptions = forkArgs()
      )
    }

The above passes the quarkus bootstrapping because the fork args

    override def forkArgs = Task {
      Seq(
        s"-Dquarkus-internal-test.serialized-app-model.path=${quarkusSerializedAppModel().path}"
      )
    }

cause the worker to spin a new process but the classloader is not behaving properly resulting in a

1-141] Caused by: java.lang.NoSuchMethodException: io.quarkus.runner.bootstrap.AugmentActionImpl.<init>(io.quarkus.bootstrap.app.CuratedApplication,java.util.List)
1-141]  at java.base/java.lang.Class.getConstructor0(Class.java:3763)
1-141]  at java.base/java.lang.Class.getConstructor(Class.java:2444)
1-141]  at io.quarkus.bootstrap.app.CuratedApplication.createAugmentor(CuratedApplication.java:129)

even though I manually tested that this constructor can be found in DiscoverJunit5Tests

For now I stubbed it and I'll try to implement a fresh one for Quarkus and either I'll figure out where the conflict happens or we use the fresh for quarkus modules

@vaslabs

vaslabs commented Feb 14, 2026

Copy link
Copy Markdown
Contributor Author

with the latest commit we are there for the quarkus test support (at least junit example working)

I'll add scaladocs and add the example into the mill docs and if I have time and the native-tests work out I'll add those too otherwise on a future PR.

The only trouble was separating the classpaths/making the discovery classpath work, but thankfully it can accept java opts, which I introduced with a new testDiscoverRuntimeOptions

Please have an initial review if you have the time @lihaoyi @lefou and I'll take your feedback in mind when I finalise the PR.

@vaslabs
vaslabs force-pushed the quarkus-test-support branch from aee1461 to a3a38fd Compare February 15, 2026 14:48
@vaslabs vaslabs changed the title WIP: Quarkus test support Quarkus test support Feb 15, 2026
@vaslabs
vaslabs marked this pull request as ready for review February 15, 2026 17:28
@lihaoyi
lihaoyi merged commit fe778e0 into com-lihaoyi:main Feb 16, 2026
45 checks passed
@vaslabs
vaslabs deleted the quarkus-test-support branch February 16, 2026 05:25
@lefou lefou added this to the 1.1.3 milestone Feb 16, 2026
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