tony
03/09/2022, 7:28 PMdaniel
03/10/2022, 1:59 AMtony
03/10/2022, 5:42 PMDariusz Kuc
03/10/2022, 6:16 PMGradleRunner
Dariusz Kuc
03/10/2022, 6:17 PMGradleRunner
is pretty slow... wondering if folks have some suggestions on how to speed things upDariusz Kuc
03/10/2022, 6:30 PMtony
03/10/2022, 6:31 PMtony
03/10/2022, 6:32 PMTapchicoma
03/10/2022, 7:27 PMwondering if folks have some suggestions on how to speed things upRun tests in parallel, use minimum external dependencies in test projects.
tony
03/10/2022, 7:29 PMDariusz Kuc
03/10/2022, 9:00 PMTapchicoma
03/10/2022, 9:01 PMDariusz Kuc
03/10/2022, 9:03 PMDariusz Kuc
03/10/2022, 9:04 PMTapchicoma
03/10/2022, 9:05 PMDariusz Kuc
03/10/2022, 9:06 PMDariusz Kuc
03/10/2022, 9:06 PMDariusz Kuc
03/10/2022, 9:07 PMtony
03/10/2022, 9:17 PMdaniel
03/10/2022, 9:18 PMcurious what kinds of APIs you have in mind?I wrote a “improved” Gradle Runner in https://github.com/gradle-plugins/toolbox which try to bring some conveniences from the internal Gradle Executor in Gradle code base (https://github.com/gradle-plugins/toolbox/blob/main/subprojects/gradle-runner-kit-api/src/main/java/dev/gradleplugins/runnerkit/GradleRunner.java). There’s a bunch of conveniences as well as some better defaults like showing stack trace by default. One of the major goal was to treat running tests using TestKit or the Wrapper the same way. The result can be asserted via the same API. The parsing of the build result can also be compared and manipulated for better assertion (such as converting a verbose output into a “rich” output or extracting the output of a single task). This is very helpful when testing my samples or testing Gradle execution from within another tool (like Xcode or Visual Studio). These falls closely to you Builder and Truth support. There’s also a need to something similar to your AbstractProject. To me configuring a project for TestKit or for ProjectBuilder should be very similar. I still haven’t figure out how to do it but I have various idea floating around. I also see a lack of support for common unit test needs like accessing an
ObjectFactory
or ProviderFactory
instance. I really like what I did with ProjectTestUtils
(https://github.com/nokeedev/gradle-native/blob/7dc339b659a753c46349fd3a4e405447ce1[…]main/java/dev/nokee/internal/testing/util/ProjectTestUtils.java) which saved me load of work when I enabled parallel JUnit testing on some projects but I feel some things are not in the right place still.tony
03/10/2022, 9:26 PMdaniel
03/10/2022, 9:26 PMObjectFactory
or ProviderFactory
but should avoid anything that creates Project
or apply plugins.
• Integration test uses Project
instance (via ProjectBuilder
) and focus on the configuration phase. There is an unfortunate gap at this level where you can’t reliably test using Settings
instance or Project#afterEvaluate
.
• Functional test uses TestKit and focus on the executions.
That division should help move some tests into unit/integration testing and speed up test execution.
It’s also easy to fall into the trap of testing too much which I have done in the pass. At one point I had parallel tests that serially would take 10 hours to run… that was a bit overkill.daniel
03/10/2022, 9:29 PMtony
03/10/2022, 9:31 PMtony
03/10/2022, 9:31 PMtony
03/16/2022, 11:16 PM