This was intentionally done via the following:

JDK-8307076: gradle test should always run tests [1][2]

I see that I forgot to remove the unused FORCE_TESTS property.

I am very much in favor of always running tests, at least by default, as I said in the bug and PR. I would oppose changing the default for those same reasons. As I mentioned there, gradle's test harness is the only UI test framework I've used where the "run tests" command doesn't unconditionally run tests.

If you want to retain the ability to run only if gradle thinks you need to, then I wouldn't oppose the idea of qualifying it with "FORCE_TESTS" as long as the default was changed to true, matching today's behavior.

-- Kevin

[1] https://bugs.openjdk.org/browse/JDK-8307076
[2] https://github.com/openjdk/jfx/pull/1120

On 8/4/2026 4:24 AM, Nir Lisker wrote:
Hi all,

The Gradle build defines:

defineProperty("FORCE_TESTS", "false")
ext.IS_FORCE_TESTS = Boolean.parseBoolean(FORCE_TESTS);

However, it's never used. Meanwhile, the allprojects configuration for the
'test' task declares:

// Always run tests
outputs.upToDateWhen { false }

It's not clear why all tests need to be run every time. I suspect that the
line should be

outputs.upToDateWhen { IS_FORCE_TESTS }

This can save a lot of time during development iterations as there's no
reason to run unaffected tests.

Are there any insights into this?

- Nir

Reply via email to