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

Akihiro Motoki amotoki at gmail.com
Sun Mar 18 08:54:47 UTC 2018


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



More information about the OpenStack-dev mailing list