<div dir="ltr">Swagger is not related to test improvement, but we started to discuss it here so..<div><br></div><div>@<span style="font-family:arial,sans-serif;font-size:13.3333339691162px;white-space:nowrap">Przemyslaw</span><span style="font-family:arial,sans-serif;font-size:13.3333339691162px;font-weight:bold;white-space:nowrap">, </span><span style="font-family:arial,sans-serif;font-size:13.3333339691162px;white-space:nowrap">how hard it will be to integrate it with nailgun rest api (web.py and handlers hierarchy)?</span></div><div><span style="font-family:arial,sans-serif;font-size:13.3333339691162px;white-space:nowrap">Also is there any way to use auth with swagger?</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 1, 2014 at 1:14 PM, Przemyslaw Kaminski <span dir="ltr"><<a href="mailto:pkaminski@mirantis.com" target="_blank">pkaminski@mirantis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div><div class="h5">
<br>
<div>On 11/28/2014 05:15 PM, Ivan Kliuk
wrote:<br>
</div>
<blockquote type="cite">
Hi, team!<br>
<br>
Let me please present ideas collected during the unit tests
improvement meeting:<br>
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 href="http://swagger.io/" target="_blank">Swagger
tool</a><br>
</blockquote>
<br></div></div>
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 href="https://github.com/swagger-api/swagger-ui" target="_blank">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 href="https://www.dropbox.com/s/y0nuxull9mxm5nm/Swagger%20UI%202014-12-01%2012-13-06.png?dl=0" target="_blank">https://www.dropbox.com/s/y0nuxull9mxm5nm/Swagger%20UI%202014-12-01%2012-13-06.png?dl=0</a><span class="HOEnZb"><font color="#888888"><br>
<br>
P.<br>
<br>
</font></span><blockquote type="cite"><span class="">
<pre cols="72">--
Sincerely yours,
Ivan Kliuk</pre>
<br>
<fieldset></fieldset>
<br>
</span><span class=""><pre>_______________________________________________
OpenStack-dev mailing list
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
</span></blockquote>
<br>
</div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>