dgroup / docker-unittests

Testing of base docker images during CI/CD process
MIT License
35 stars 4 forks source link

"Testing failed" was printed twice to the STDOUT in case if testing failed #217

Closed dgroup closed 5 years ago

dgroup commented 5 years ago

https://github.com/bodax/docker-unittests/blob/204/docs/image-tests-results-failure.png

Seems to be it was broken somewhere.

dgroup commented 5 years ago

The new snapshot is required for the readme.md once this task is completed.

dgroup commented 5 years ago

The unit test is required in order to check the number of lines which were printed to std output. The com.github.dgroup.dockertest.AppTest#run can be used as skeleton

dgroup commented 5 years ago

Looks like the bug is here com.github.dgroup.dockertest.App#start

} catch (final TestingFailedException ex) {
    throw new AppException(-1, ex);
}        

We should throw the TestingFailedException from start method, no need to catch there. The exception should be catch in com.github.dgroup.dockertest.App#main method, as separate catch block where we will shutdown the application with -1 exit code.