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

Mike Scherbakov mscherbakov at mirantis.com
Thu Jul 9 22:14:32 UTC 2015


We need this. Please find a tool which suites best, and we will let
Dmitry's team to enable it. I assume there is not such a thing in OpenStack
Infra (otherwise we could just reuse it).

Also, I would add a check, that any new bash file should not contain, let's
say, more than 50 lines. If it is larger than that, it has to be very well
explained, why it can't be written in Python and covered by unit tests.
It is quite sad to see bash hacks in different places of something which
has to be maintainable by many people over years.


On Thu, Jul 9, 2015 at 11:36 AM Oleg Gelbukh <ogelbukh at mirantis.com> wrote:

> And I realized all of a sudden that even more interesting than unittest
> framework itself would be some analog of Python mock for shell scripts.
> Though I doubt that anyone ever really gone that far.
>
> --
> Best regards,
> Oleg Gelbukh
>
> On Thu, Jul 9, 2015 at 5:12 PM, Jeremy Stanley <fungi at yuggoth.org> wrote:
>
>> On 2015-07-09 11:24:14 +0300 (+0300), Matthew Mosesohn wrote:
>> > What about bashate? It is already in use in several OpenStack projects?
>> [...]
>>
>> It's a style checker (its name is an allusion to the "pep8" tool for
>> checking Python coding style conventions). And shellcheck (mentioned
>> later in this thread) is a static code analysis tool for shell
>> scripts (analogous to pylint/pyflakes in the Python world). Both
>> potentially useful tools for helping you maintain code quality on
>> shell script based projects, but neither of these is a unit testing
>> framework.
>> --
>> Jeremy Stanley
>>
>> __________________________________________________________________________
>> 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
>>
>
> __________________________________________________________________________
> 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
>
-- 
Mike Scherbakov
#mihgen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150709/a0d537ae/attachment.html>


More information about the OpenStack-dev mailing list