Slackbot
03/18/2023, 11:02 AMmelix
03/18/2023, 11:02 AMmelix
03/18/2023, 11:03 AMcheck
or test
, the configuration cache is reused, so the task graph is the same, but it shouldn'tmelix
03/18/2023, 11:05 AMVampire
03/18/2023, 12:28 PMmelix
03/18/2023, 1:11 PMbut did you consider using Spocks ability to run tests in parallel instead?Yes, but that's not the same. AFAIK Spock would run in-process, vs out of process. This could cause potential issues with shared state. Also I would benefit from individual caching of tests and predictive test selection with my technique. But the drawback is that it is also more resource intensitve.
Adam
03/18/2023, 2:42 PMVampire
03/18/2023, 3:50 PMAFAIK Spock would run in-process, vs out of process.That's correct.
This could cause potential issues with shared state.Of course the tests have to properly support it, yes, or define that they need a specific resource.
Also I would benefit from individual caching of testsYeah, that's true of course
and predictive test selection with my technique.I'm curious, as I'm not working with GE, why does your technique benefit from it and just using Spock parallel support not? Afair it selects individual tests from the whole test suite, not only specific test tasks.
But the drawback is that it is also more resource intensitve.And more complex to setup and so far not CC compatible. 😄
Vampire
03/18/2023, 3:52 PMFor a more 'correct' implementation, but complicated: Use incremental task inputs to get the packages, and for each added/modified package launch the tests in parallel via the Worker API.But that would then not integrate with test reporting, would it? Unless maybe you use internal Gradle API to somehow forward it.
melix
03/18/2023, 3:53 PMVampire
03/18/2023, 3:54 PMPaul Merlin
03/18/2023, 10:03 PMwolfs
03/20/2023, 7:46 AMThe idea, which seems to work pretty well, is to benefit from the ability of the configuration cache to run tasks in parallelGradle already runs tests in parallel on different JVMs. What is the advantage of using separate tasks per package?
melix
03/20/2023, 7:58 AMmelix
03/20/2023, 7:59 AMt looks like calls to traverse directories are not properly captured as configuration inputs. There have been lots of progress on this in 8.1, it might be worth trying it out and reporting issues if need be.mmm, right, but is there a way I can declare the inputs to configuration manually?
Vampire
03/20/2023, 9:16 AMTextResource#fileContent
?melix
03/20/2023, 9:48 AMmelix
03/20/2023, 10:07 AMmelix
03/20/2023, 10:13 AMValueSource
melix
03/20/2023, 10:16 AMMikhail Lopatkin
03/20/2023, 12:12 PMValueSource
seems more fitting anyway - it looks like adding a file to an existing directory should not invalidate the configuration, and this is something you won't get with just listdir
- Gradle has no way of knowing what you're going to do with the listing, so all directory's contents become part of the cache fingerprint. The ValueSource
only invalidates the cache if its output changes, so you have a chance to ignore irrelevant differences.
a way I can declare the inputs to configuration manually?
ValueSource
is the recommended way to do that.