Re:Testing Bash with BATS
by zenlikethat on Thursday February 21, 2019 @09:21PM
(#19222578)
My experience doing integration testing with BATS was that it was complete misery (not the BATS project’s fault, I think it’s just inherent in the nature of the thing).
You REALLY want a real programming language for any kind of non trivial integration testing. Things like set up and tear down, checking outputs, and testing many-similar-but-not-identical cases gets hairy fast. Sure you CAN do it in bash but just because you can doesn't mean you should. When we rewrote our BATS tests in Go was a huge step forward for the project.
Re:Testing Bash with BATS
by dnautics on Friday February 22, 2019 @04:08AM
(#19224031)
One time I had to write a Json marshaller in bash (don't ask), and bats was invaluable. BATS is great when you need to unit test bash. And for the most basic integration tests on something that is meant to be a CLI.
You REALLY want a real programming language for any kind of non trivial integration testing. Things like set up and tear down, checking outputs, and testing many-similar-but-not-identical cases gets hairy fast. Sure you CAN do it in bash but just because you can doesn't mean you should. When we rewrote our BATS tests in Go was a huge step forward for the project.