Никита Гучаков
02/15/2025, 7:27 AMgradle testCompile --continue --parallel
then
gradle test --continue --parallel
it takes 40m summary
when running as
gradle testCompile test --continue --parallel
it takes 35m because of better workers utilization.
However, in that case it will run all unaffected tests when there were a compilation failure
I want to combine benefits of both approaches and skip all test task if any module compilation failed, but not stopping compilation of the modules (as it works with --continue)
How can I do that?Vampire
02/15/2025, 7:40 PM--continue
.
If you want the tests to not run if any compile task fails, you probably need to make the test tasks depend on all compile tasks, but then of course all compile tasks need to run first even if only one test task should run.
You can probably hack it in somehow like some operation completion listener that watches for compile tasks and remembers if any failed and then check that listener in an onlyIf
for the test tasks, so that at least no new ones are started or similar contructs, but you should really consider whether you want to do that.Никита Гучаков
02/16/2025, 9:21 AMWhy should unaffected tests not runThere is no point to occupy CI worker, we need --continue to get all compilation problems, tests problems make sense only if everything compiles. If there was a compilation problem - there is no point to occupy CI worker anymore, because developer will only fix compilation at this iteration. Most builds should compile and have green builds, so it will be fine to speed them up, as I said it takes ~5m less if we run everything as one gradle run. Maybe it's an overkill for 10% speedup, though, I don't know)
Vampire
02/16/2025, 12:22 PM--continue
is to find as many build problems as possible in one run, if some tests fail the devs also need to fix them, why should fixing failing tests require to first fix all compile problems that are totally unrelated to the tests that fail?
Besides that, as I said, I'm not aware of anything built-in that does what you want, you would somehow need to hack this in yourself if you really want it. For example having a project property that you set on CI and that then adds all compile tasks as dependencies to all test tasks or something along those lines.