Currently, it is quite hard to apply test coverage for the project as there are many places where log.fatalf is used. It means that the command exits on this step, so coverage could not be counted as the only way to run such test it envolve separate process.
Currently, it is quite hard to apply test coverage for the project as there are many places where
log.fatalf
is used. It means that the command exits on this step, so coverage could not be counted as the only way to run such test it envolve separate process.The solution is to redefine
log.fatalf
and mock it in tests (see example here https://stackoverflow.com/questions/40615641/testing-os-exit-scenarios-in-go-with-coverage-information-coveralls-io-goverall/40801733)