<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 11/28/2014 05:15 PM, Ivan Kliuk
wrote:<br>
</div>
<blockquote cite="mid:54789FA6.7050200@mirantis.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
Hi, team!<br>
<br>
Let me please present ideas collected during the unit tests
improvement meeting:<br>
<meta charset="utf-8">
1) Rename class ``Environment`` to something more descriptive<br>
2) Remove hardcoded self.clusters[0], e.t.c from ``Environment``.
Let's use parameters instead<br>
3) run_tests.sh should invoke alternate syncdb() for cases where
we don't need to test migration procedure, i.e. create_db_schema()<br>
4) Consider usage of custom fixture provider. The main
functionality should combine loading from YAML/JSON source and
support fixture inheritance<br>
5) The project needs in a document(policy) which describes:<br>
- Tests creation technique;<br>
- Test categorization (integration/unit) and approaches of
testing different code base<br>
- <br>
6) Review the tests and refactor unit tests as described in the
test policy<br>
7) Mimic Nailgun module structure in unit tests<br>
8) Explore <a moz-do-not-send="true" href="http://swagger.io/">Swagger
tool</a><br>
</blockquote>
<br>
Swagger is a great tool, we used it in my previous job. We used
Tornado, attached some hand-crafted code to RequestHandler class so
that it inspected all its subclasses (i.e. different endpoint with
REST methods), generated swagger file and presented the Swagger UI
(<a class="moz-txt-link-freetext" href="https://github.com/swagger-api/swagger-ui">https://github.com/swagger-api/swagger-ui</a>) under some /docs/ URL.<br>
What this gave us is that we could just add YAML specification
directly to the docstring of the handler method and it would
automatically appear in the UI. It's worth noting that the UI
provides an interactive form for sending requests to the API so that
tinkering with the API is easy [1].<br>
<br>
[1]
<a class="moz-txt-link-freetext" href="https://www.dropbox.com/s/y0nuxull9mxm5nm/Swagger%20UI%202014-12-01%2012-13-06.png?dl=0">https://www.dropbox.com/s/y0nuxull9mxm5nm/Swagger%20UI%202014-12-01%2012-13-06.png?dl=0</a><br>
<br>
P.<br>
<br>
<blockquote cite="mid:54789FA6.7050200@mirantis.com" type="cite">
<pre class="moz-signature" cols="72">--
Sincerely yours,
Ivan Kliuk</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
OpenStack-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>