[openstack-dev] [Fuel] Introducing bash unit testing

Oleg Gelbukh ogelbukh at mirantis.com
Thu Jul 9 08:27:19 UTC 2015


I am one hundred percent support this proposal.

Just to clarify, did you consider shunit2
<https://github.com/kward/shunit2/> [1 <https://github.com/kward/shunit2/>]
as a unittest framework for Bash? It seems a little bit closer to shell
scripting itself, so you don't need to learn another syntax to write
unittests.

--
Best regards,
Oleg Gelbukh

On Thu, Jul 9, 2015 at 11:12 AM, Bartlomiej Piotrowski <
bpiotrowski at mirantis.com> wrote:

> Hi all,
>
> as hopefully everyone knows, it's very challenging to prove that Bash
> encourages
> writing readable, maintainable code that actually works first time it is
> run.
> Sadly we have quite a long history of merging various shell scripts
> without any
> test coverage.
>
> Fortunately Peter Zhurba bore with me and we decided to use bats[1] to
> test his
> fuel-migrate[2] script. Obviously it's close to impossible to properly
> code that
> uses ssh or rsync, but it's good enough for functions that take some
> arbitrary
> data and return another set.
>
> As we have quite a long history of merging various bash scripts without
> any test
> coverage, I'd like to introduce more formal rule requiring engineers to
> ship any
> bash code longer than 100 lines with unit tests. BATS tests are not
> currently run
> by our CI, but we're getting there[3].
>
> My TL;DR skills are nowhere close to Dmitry Borodaenko's but let me try:
> bash is
> terrible so let's do our best to make it work as we want it to.
>
> What is your opinion?
>
> Bartłomiej Piotrowski
>
> [1] https://github.com/sstephenson/bats
> [2] https://review.openstack.org/#/c/198355/2
> [3] https://review.fuel-infra.org/#/c/9130/
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150709/dca7d223/attachment.html>


More information about the OpenStack-dev mailing list