Currently, mix espec command return zero exit code in case when there is some error during spec files compilation step:
bash-5.0$ mix espec
Compiling 1 file (.ex)
==> arkenston
== Compilation error in file spec/arkenston/mutator/user_mutator_spec.ex ==
** (SyntaxError) spec/arkenston/mutator/user_mutator_spec.ex:67: unexpected token: ). The "do" at line 60 is missing terminator "end"
(elixir 1.10.3) lib/kernel/parallel_compiler.ex:305: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7
0 examples, 0 failures
Finished in 0.37 seconds (0.36s on load, 0.0s on specs)
Randomized with seed 22698
bash-5.0$ echo $?
0
This is very annoying because CI/CD process does not known that testing step was failed.
The only way to detect such a failure is to check coverage percentage which is 0:
Currently,
mix espec
command return zero exit code in case when there is some error during spec files compilation step:This is very annoying because CI/CD process does not known that testing step was failed. The only way to detect such a failure is to check coverage percentage which is 0:
This PR adds a check after compilation step, exit code will be 1: