<div dir="ltr">TL;DR We're doing a PoC to split out common testing plays/vars into a generic repository, for the purposes of making in-role testing more uniform and generic. Looking for feedback, comments, informal reviews, ideas etc! <a href="https://github.com/andymcc/openstack-ansible-testing-core">https://github.com/andymcc/openstack-ansible-testing-core</a> (Includes a simple README)<div><br></div><div>







<p class="">We now have a lot of duplication after moving to a single role per repository structure with specific testing per role. For example, almost all repositories require Galera/Rabbit/Keystone in order to deploy testing successfully. This has led to a scenario where each repository essentially carries the same deployment code.<br></p>
<p class=""><br></p><p class="">Aims:<br>- The primary aim of extracting the testing infrastructure into a single repository is to reduce the cases where a simple change is needed, which dominoes, causing a patch to each of 15 repositories. Instead, a change to the uniform testing repository would resolve the issue for all other repository's testing.<br>- In the future, we are looking to deploy scenario testing. For example, we may want to test glance with a swift backend, or keystone with memcache. If the testing play to deploy swift is already in a uniform repository, the changes required to get glance testing enabled for that use case would be minimal.<br>- This allows new projects to consume existing structure/playbooks to deploy common components and vars, which should simplify the manner in which new openstack-ansible projects set up their testing.</p>
<p class=""><span class=""><br></span></p><p class=""><span class="">Steps taken so far:<br></span>- The deployment plays for each project have been split out into the separate testing role.<br>- Each role only carries a specific "Test project" play.<br>- The test playbooks have been made generic so it uses the inventory specified per repository (defining what hosts/roles there are).<br>- The test-vars have been put in the testing-repository and moved out of the generic role.<br>- An override file has been created for each project and included using "-e" (the highest precedence) but at present, of the 4 projects converted the maximum number of overrides used is 2, so these overrides are minimal.<br>- Adjustments to tox.ini and var files references have been made to use the new repository.</p><p class=""><br></p><p class=""><span class="">Further work to look into:<br></span><b>- </b>It may be worth looking into making the tox.ini more generic, if we were to make a sweeping change that impacts on tox.ini we would still need to do changes to each repository. (I am not sure on how feasible this is though)</p>
<p class=""><span class=""><br></span></p><p class=""><span class="">Raised concerns:<br></span>- This creates a situation where a change may require me to make a change to the central testing repository before changing the role repository. For example, in order to get the generic testing for a keystone change I would have to change the testing repository in advance, and then change the keystone repository. Or override the var, adjust the testing repo and then remove the keystone override.<br>- Changes to the testing-repo can cause all other repo tests (aside from the overarching openstack-ansible repository) from breaking.</p>
<p class=""><span class=""></span><br></p>
<p class=""><span class="">Where to find the PoC, what next?</span></p>
<p class=""><span class="">The repository can be found here: <a href="https://github.com/andymcc/openstack-ansible-testing-core"><span class="">https://github.com/andymcc/openstack-ansible-testing-core</span></a></span></p>
<p class="">This is a proof of concept so in no way is it considered complete or perfect, we are asking for more eyes on this; test it, let us know what you like/do not like/want changed/additional ideas to improve.<br><span class=""></span></p>
<p class="">Thanks!<br><span class=""></span></p>
<p class=""><span class="">Andy<br>irc: andymccr</span></p></div></div>