[openstack-dev] [horizon][plugins] mox -> mock migration

Akihiro Motoki amotoki at gmail.com
Mon Apr 23 11:06:51 UTC 2018


Hi horizon plugin developers,

As I announced in the quoted mail, Rocky-1 was released and mox is NOT
prepared in the horizon test helpers by default now [1].
If your horizon plugin still depends on mox, please ensure to set use_mox =
True in your test classes.

> 2) After Rocky-1, use_mox of openstack_dashboard.test.helpers.TestCase will
be changed from True to False.
>      This means your plugin needs to set use_mox to True explicitly if your
unit tests still depends on mox.
>      Our suggestion is to set use_mox=True until Rocky-1 milestone if your
tests depends on mox not to break your gate.

[1] https://review.openstack.org/558048

Thanks,
Akihiro Motoki (amotoki)

2018-03-18 17:54 GMT+09:00 Akihiro Motoki <amotoki at gmail.com>:

> Hi horizon plugin developers,
>
> As you know, mox-removal is one of the community goal in Rocky and
> horizon team is working on removing usage of mox [1].
>
> This mail announces the plan of dropping mox dependencies in horizon
> test helpers (horizon.test.helpers.TestCase and/or
> openstack_dashboard.test.helpers.TestCase).
>
> 1) The first step is to introduce "use_mox" flag in
> horizon.test.helpers.TestCase. The flag is available now.
>     If you set the flag to False, you can run your plugin test without mox.
>     The default value of use_mox is False for
> horizon.test.helpers.TestCase [2] and True for
> openstack_dashboard.test.helpers.TestCase [3].
>
> 2) After Rocky-1, use_mox of openstack_dashboard.test.helpers.TestCase
> will be changed from True to False.
>      This means your plugin needs to set use_mox to True explicitly if
> your unit tests still depends on mox.
>      Our suggestion is to set use_mox=True until Rocky-1 milestone if
> your tests depends on mox not to break your gate.
>
> 3) After Rocky RC1 is released, "use_mox" flag in the horizon repo
> will be dropped.
>     This means use_mox flag will no longer be in effect.
>     If your plugin tests still depends on mox at this stage, your
> plugin test needs to set up mox explicitly.
>
> Thanks,
> Akihiro Motoki (amotoki)
>
> [1] https://blueprints.launchpad.net/horizon/+spec/mock-
> framework-in-unit-tests
> [2] https://github.com/openstack/horizon/blob/
> 6e29fdde1edc67a6797eba2c3f9c557f840d4ea7/horizon/test/helpers.py#L138
> [3] https://github.com/openstack/horizon/blob/
> 6e29fdde1edc67a6797eba2c3f9c557f840d4ea7/openstack_
> dashboard/test/helpers.py#L257
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20180423/2063080c/attachment.html>


More information about the OpenStack-dev mailing list