How to read test result reports on Travis CI?

后端 未结 3 907
天命终不由人
天命终不由人 2021-02-03 21:09

For my builds on Travis, I want to be able to read the test results when there are failing tests to see the stacktrace of those failing tests. Currently, these reports are store

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-03 21:47

    To expand on Rene Groeschke's answer, I found the following configuration to be a good compromise for Travis:

    test {
        testLogging {
            events "passed", "skipped", "failed"
            exceptionFormat "full"
        }
    }
    

    This will result in an output like the following:

    com.package.SomeClassTest > testPass PASSED
    
    com.package.SomeClassTest > testSkip SKIPPED
    
    com.package.SomeClassTest > testFail FAILED
        java.lang.AssertionError: expected: but was:
            at org.junit.Assert.fail(Assert.java:88)
            at org.junit.Assert.failNotEquals(Assert.java:834)
            at org.junit.Assert.assertEquals(Assert.java:118)
            at org.junit.Assert.assertEquals(Assert.java:144)
            at com.package.SomeClassTest.testFail(SomeClassTest.java:42)
    
    3 tests completed, 1 failed, 1 skipped
    

    The test report will still be generated, so you can consult it when running the tests locally.

提交回复
热议问题