Fast and consistent testing is an essential part of any modern development process. In this talk we would like to share the experience we gained in DSE on our journey towards more effective testing. Introducing Gradle as the build tools allowed us to execute tests in parallel, shortening the test round times, and enable them an integral part of the pre-merge checks. On the other hand, Docker helped us to run functional and integration tests safely in parallel on a single machine requiring no changes to the production code. Equally important, Dockerized environment added repeatability to our workflows. Tests are executed within the very same environment everywhere, from engineers laptops to our CI servers. At the moment, we squeeze 15+ hours of testing time into test rounds shorter than an hour. Our future work will be focused on exploring Docker Swarms. The implemented approach is based fully on other open-source projects, and could be applied to any project and/or organization.
13. Split Slow Test Classes for More Throughput
class FooTest {
@Test
void bar1() {
}
@Test
void bar2() {
}
}
class Foo1Test {
@Test
void bar1() {
}
}
class Foo2Test {
@Test
void bar2() {
}
}
● Manual
○ Group by common
fixture
○ Extreme: one test per
class
● Bytecode manipulations
(auto split annotated class)
● Grouping tests classes
into JUnit suites forces
their sequential execution!