mavengradlemaven-surefire-plugin

Maven Surefire: Is it possible to get test result summary on console during execution


I have a test suite that takes hours to complete. It would be very helpful if I could get a runtime summary of the test execution.

I want something like gradle logger plugin. As shown in the link, the console output of this plugin shows test results on the console for each test, and as it happens.


Solution

  • I'm not sure what exactly you are expecting because if I run my build with tests it looks similar like this:

    [INFO] --- surefire:3.1.2:test (default-test) @ kata-fraction ---
    [INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
    [INFO] 
    [INFO] -------------------------------------------------------
    [INFO]  T E S T S
    [INFO] -------------------------------------------------------
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$Limits
    [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.073 s -- in com.soebes.kata.fraction.FractionIntegerTest$Limits
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$Pow
    [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s -- in com.soebes.kata.fraction.FractionIntegerTest$Pow
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$Addition
    [INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s -- in com.soebes.kata.fraction.FractionIntegerTest$Addition
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$Subtraction
    [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s -- in com.soebes.kata.fraction.FractionIntegerTest$Subtraction
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$Divide
    [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s -- in com.soebes.kata.fraction.FractionIntegerTest$Divide
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$Multiplikation
    [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s -- in com.soebes.kata.fraction.FractionIntegerTest$Multiplikation
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$Normalizing
    [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s -- in com.soebes.kata.fraction.FractionIntegerTest$Normalizing
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$InvalideValues
    [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s -- in com.soebes.kata.fraction.FractionIntegerTest$InvalideValues
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$Verification
    [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.304 s -- in com.soebes.kata.fraction.FractionIntegerTest$Verification
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$CompareTo
    [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s -- in com.soebes.kata.fraction.FractionIntegerTest$CompareTo
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$Signum
    [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s -- in com.soebes.kata.fraction.FractionIntegerTest$Signum
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$Negate
    [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s -- in com.soebes.kata.fraction.FractionIntegerTest$Negate
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$DoubleValue
    [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s -- in com.soebes.kata.fraction.FractionIntegerTest$DoubleValue
    [INFO] Running com.soebes.kata.fraction.FractionIntegerTest$BigDecimalValue
    [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s -- in com.soebes.kata.fraction.FractionIntegerTest$BigDecimalValue
    [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.421 s -- in com.soebes.kata.fraction.FractionIntegerTest
    [INFO] Running com.soebes.kata.fraction.dynamic.DynamicFractionTest
     ....
    

    That's continous output????