How can I list the slowest JUnit tests in a multi-module Maven build?
This should be accross all modules.
A Hudson/Jenkins solution could also do.
How can I list the slowest JUnit tests in a multi-module Maven build?
This should be accross all modules.
A Hudson/Jenkins solution could also do.
Disclaimer: I truly apologize for my bash solution, although it works and fits in one line :-). If you are impatient, go to the bottom.
First we need to find all
TEST-*.xml
files produced bymaven-surefire-plugin
. Run this aftermvn test
in the root directory of your project to discover test results in all submodules:Fortunately the format of these files is pretty straightforward, a simple
grep
and we have what we need:Now some
sed
magic to extract invocation time, test case class and method name:There's nothing more left just to sort the result and display longest running tests:
Promised one-liner:
Amazingly, the results look reasonable (Activiti 5.1 multi-module code-base taken as an example):