<div dir="ltr"><div><div>Hello Fuelers,<br><br></div>There is more and more Python code appearing in fuel-library [1] that is used in our Puppet manifests. Now, with introduction of Granular Deployment feature it could appear more often as<br></div><div>writing some tasks as a Python script is a nice option.<br></div><div><br></div><div>First problem that I see is that in some cases this code is getting merged without a positive review from a Python developer from Fuel team.<br></div><div>My proposition of the solution is simple:<br>fuel-library core reviewers shouldn't merge such code if there is no a +1 from a Python developer from fuel-core group [2].<br></div><div><br></div><div>Second problem is that there are no automatic tests for this code. Testing it manually and by running deployment when that code is used is not enough since those scripts could be quite large and complicated and some of them are executed in specific situations so it is hard for reviewers to check how they will work.<br></div><div>In fuel-library we already have tests for Puppet modules: [3].<br></div><div>I suggest that we should introduce similar checks for Python code:<br></div><div> - there will be one global 'test-requirements.txt' file (if there will be a need to, we could introduce more granular split, like per module)<br></div><div> - py.test [4] will be used as a test runner<br></div><div> - (optional, but advised) flake8+hacking checks [5] (could be limited to just run flake8/pyflakes checks)<br><br></div><div>Looking forward to your opinions on those two issues.<br></div><div><br>Best,<br></div>Sebastian<br><br>[1] <a href="https://github.com/stackforge/fuel-library/search?l=python">https://github.com/stackforge/fuel-library/search?l=python</a><br>[2] <a href="https://review.openstack.org/#/admin/groups/209,members">https://review.openstack.org/#/admin/groups/209,members</a><br>[3] <a href="https://fuel-jenkins.mirantis.com/job/fuellib_unit_tests/">https://fuel-jenkins.mirantis.com/job/fuellib_unit_tests/</a><br>[4] <a href="http://pytest.org/latest/">http://pytest.org/latest/</a><br>[5] <a href="https://github.com/openstack-dev/hacking">https://github.com/openstack-dev/hacking</a><br></div>