[openstack-dev] [Fuel][Puppet] New Rspec Noop Tests Matcher to Ensure Transitive Dependencies

Vladimir Kuklin vkuklin at mirantis.com
Wed Feb 17 15:23:56 UTC 2016


Fuelers

It seems that this change [0] into Fuel came unnoticed, but it may help you
in testing your puppet catalogues.

I was refactoring our code pieces that actually wait for Load Balancer to
be ready to serve requests. I ended putting things into a special define
called `wait_for_backend`. This broke direct dependencies between resources
as there was only transitive order between them (e.g. A->B->C) instead of
direct (A->C). And this broke our noop tests as they were expecting to see
the latter ordering. This in turn required me to write an additional
matcher based on puppet source code.

[0] https://review.openstack.org/#/c/272702/

Here is an example of the code you might want to use in your rspecs:

`expect(graph).to
ensure_transitive_dependency("Class[openstack::galera::status]",
"Haproxy_backend_status[mysql]")`
graph is lazy calculated within noop tests shared_examples.

So, if you need to just check if one resource will execute after the
another, you do not need 'that_comes_[before|after]' anymore.

Puppeters

Folks, this may be also interesting for you.

-- 
Yours Faithfully,
Vladimir Kuklin,
Fuel Library Tech Lead,
Mirantis, Inc.
+7 (495) 640-49-04
+7 (926) 702-39-68
Skype kuklinvv
35bk3, Vorontsovskaya Str.
Moscow, Russia,
www.mirantis.com <http://www.mirantis.ru/>
www.mirantis.ru
vkuklin at mirantis.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20160217/e553cbc7/attachment.html>


More information about the OpenStack-dev mailing list