Repeated tests: Don’t Run Your Ruby Minitest Classes Twice!

Using subclasses in Minitest

ProductTest and GrandProductTest classes.
Test execution for ProducITest and GrandProductTest classes.

Analyze your tests application with the Minitest Analyzer library

A graph containing duplicated Test information.
Minitest Analyzer against the last example graph.
Class GrandParentTest
test_a: 6 times -> 5 extra runs that can be avoided.
Class Parent1Test
test_b: 3 times -> 2 extra runs that can be avoided.
test_c: 3 times -> 2 extra runs that can be avoided.
Class Child1Test
test_y: 1 time
Class Child2Test
test_z: 1 time
Class Parent2Test
test_d: 2 times -> 1 extra runs that can be avoided.
test_e: 2 times -> 1 extra runs that can be avoided.
test_f: 2 times -> 1 extra runs that can be avoided.
Class Child2Test
test_o: 1 time
test_p: 1 time

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ignacio Chiazzo

Ignacio Chiazzo

Staff Software Engineer at Shopify. Opinions are my own. ignaciochiazzo.com