I'm trying to generate the summary of the execution time for unittests (surefire) and integration-tests(failsafe) ...basically different [overall] test execution times (and some other metrics like pass/fail rates)
There's already a suggestion on how to do this for unittests with grep : https://stackoverflow.com/a/45859700/3609252
There's also maven surefire reporter plugin which generates an html summary of test results.
There are pros and cons to both of these, there's no summary for the first approach, while parsing data from html in second approach is not that nice/reliable I guess!
Any suggestion on which approach to take?
or is there any plugin which I could use to report the summary of test executions in xml
format for example?
just to clarify, my end goal is to get these metrics and call some APIs to add the metrics to Prometheus server.
I ended up using grep and awk to get the total [unit]test execution runtime :
SUREFIRE_TEST_RUNTIME="$(grep -h testcase target/surefire-reports/TEST-*.xml | awk -F '"' '{sum+=$6} END {print sum}')"