TestKit and up-to-date checking

Writing some tests for a plugin using TestKit. For some reason, TestKit thinks my tasks are up-to-date when those tasks’ output file does not exist.

It works perfectly fine in a “real” project using the plugin, but “fails” in the TestKit tests because I explicitly check for TaskOutcome.SUCCESS while TestKit says the tasks are TaskOutcome.UP_TO_DATE.

I very much dislike publishing code if I cannot properly test it. Yes the external project could act as the verification, but I would first have to publish the plugin (to the portal or a Maven repo) first which defeats the purpose of having unit/functional tests.

So am I missing something? Is this just a quirk in TestKit? How do I resolve that?

FWIW as I understand it, it should not be a daemon issue as I have withDebug(true) set

Hi Steve,

TestKit does not do anything different than a real build when it comes to outputs. Do you maybe have a reproducer so I can check what is going on?

Cheers,
Stefan

Thanks for the reply Stefan.

The TestKit-based test is - https://github.com/sebersole/quarkus-gradle-plugin-poc/blob/9d39262eda60ba30e9bc68ed3548a19a33ec1569/quarkus-gradle-poc-plugin/src/test/java/com/github/sebersole/gradle/quarkus/SimpleTest.java#L138

You’d have to remove the @Disabled

The consumer project where the up-to-date checks work as expected is - https://github.com/sebersole/quarkus-plugin-poc-consumer