Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Role testing #8

Closed
wants to merge 6 commits into from
Closed

Role testing #8

wants to merge 6 commits into from

Conversation

aignas
Copy link
Collaborator

@aignas aignas commented Oct 14, 2017

Since in one of the other PRs @jasonroyle mentioned that in order to merge PRs he needs to thoroughly test everything, I thought, that this could be done easier and have tried to use https://github.com/metacloud/molecule for making the testing easier. This will allow support for multiple linux distros easier and give more confidence when making changes and supporting various configurations.

This is an initial proof of concept thing that more or less works for testing Ubuntu 16.04, but for others I'l need to add a few config parameters. @jasonroyle let me know what distros and what versions you want to support so that I can finish the config of the molecule framework. Most of the stuff in the molecule directory was automatically generated by executing

$ molecule init scenario --scenario-name default --role-name ansible-role-rabbitmq

when run in the root of the repository.

After this gets merged, it would be possible to add Travis CI support afterwards.

@jasonroyle
Copy link
Owner

Sounds like a plan, I’m out at the moment so I’ll get back to you on the distros that I need support for.

@aignas
Copy link
Collaborator Author

aignas commented Oct 15, 2017

So I added the following distros to the deault task:

  • Ubuntu 14.04
  • Ubuntu 16.04 (this sometimes gives weird errors on my machine)
  • CentOS 6
  • Debian 8
  • Debian 9

The following I tried and they did not work:

  • Ubuntu 17.04, 17.10 (various failures, which need more investigation)
  • CentOS 7 (The Erlang version which we try to install is older than the one in default repos)
  • Alpine 3.6 (Molecule does not support this)

@aignas
Copy link
Collaborator Author

aignas commented Feb 19, 2018

@jasonroyle, What do you think about this. I would be inclined to merge this if everything looks fine.

@Raffaello
Copy link
Collaborator

Raffaello commented Feb 19, 2018

@aignas in my perspective is pointless making working for Alpine is not neither a full OS, i mean at that point someone will use directly docker.

Also testing with in a Docker i do not think is very useful for general purpose provisioning script.

Also I guess @jasonroyle was referring to test manually not in a sort of automated CI.
Anyway for that it would be enough to provision against some Oses and after that check simple things like rabbitmq version is the expected one, erlang version etc...

the basic ones are just Debian and RedHat families to be validated in my opinion:
so Ubuntu >=16
and Debian>=8?
Centos>=7,

[if more are required will be extra PRs.]

please also note the ansible version and python requirement that now it would be pointless testing this in a OS that doesn't provide a minimum of python 2.7 as default.
ansible version i will say >=2.3 or even 2.4

Actually you can consider the versioning system within the role itself (with git tags), the new version can just be not supporting anymore the older operating systems. so you can just consider to make it working for the latests oses mainly....


please keep in mind that ansible 2.4 as module to deal with rabbit mq: http://docs.ansible.com/ansible/latest/list_of_messaging_modules.html

@Raffaello
Copy link
Collaborator

@aignas anyway is a very good proposal! 💯 :)

@aignas
Copy link
Collaborator Author

aignas commented Feb 20, 2018

Here is my thinking:

  • Alpine may indeed be unnecessary, but Ubuntu and CentOS should be there in the list of tested distributions.
  • The Docker images are a really good way to get a known clean and reproducible environment. I think it is much better than having nothing and it can be used in CI.
  • There may still be a need for manual testing, but I think that such need would be minimized when using this framework.
  • Since rabbitmq* modules are not available in Ansible 2.3, I would say that the bare minimum for the control machine is to have Ansible 2.4.

@Raffaello, I don't think I understood you on the following points:

  • Can you elaborate on what you mean by minimum python version? As far as I understand the target machine does not need to have Python installed, so it's only the control machine that needs it, so that machine is the machine that is running CI tests or the machine that a developer uses to run the role.
  • I am not sure I understand what you mean by versioning system. I think that this is unrelated to what the PR is trying to achieve.

@Raffaello
Copy link
Collaborator

@aignas agree on your point. yes

for the python version as you wrote.

versioning system is to have a role with version going forward we can have BC introduced for eg.

(sorry it was late night for me yesterday.)

@aignas
Copy link
Collaborator Author

aignas commented Feb 20, 2018

Hi @Raffaello, thanks for the clarification. I agree with the versioning such that we can promise the users some backwards compatibility. Let's discuss this as a separate PR/Issue. :)

@Raffaello
Copy link
Collaborator

here with molecule version

molecule, version 2.12.1

and ansible 2.4.4

i have this lint error output:

--> Executing Yamllint on files found in /home/ansible-role-rabbitmq/...
    /home/ansible-role-rabbitmq/tasks/rabbitmq.yml
      13:14     warning  truthy value is not quoted  (truthy)
    
    /home/ansible-role-rabbitmq/tasks/plugins.yml
      16:81     error    line too long (94 > 80 characters)  (line-length)
    
    /home/ansible-role-rabbitmq/tasks/cluster.yml
      8:18      warning  truthy value is not quoted  (truthy)
      12:81     error    line too long (86 > 80 characters)  (line-length)
    
    /home/ansible-role-rabbitmq/tasks/configure-cluster.yml
      5:81      error    line too long (153 > 80 characters)  (line-length)
    
    /home/ansible-role-rabbitmq/tasks/RedHat/install.yml
      9:81      error    line too long (88 > 80 characters)  (line-length)
      10:81     error    line too long (83 > 80 characters)  (line-length)
      11:15     warning  truthy value is not quoted  (truthy)
      22:81     error    line too long (99 > 80 characters)  (line-length)
      23:15     warning  truthy value is not quoted  (truthy)
      25:81     error    line too long (109 > 80 characters)  (line-length)
      33:81     error    line too long (260 > 80 characters)  (line-length)
    
    /home/ansible-role-rabbitmq/tasks/Debian/install.yml
      13:81     error    line too long (139 > 80 characters)  (line-length)
      25:81     error    line too long (214 > 80 characters)  (line-length)
    
    /home/ansible-role-rabbitmq/molecule/default/create.yml
      5:17      warning  truthy value is not quoted  (truthy)
      9:81      error    line too long (87 > 80 characters)  (line-length)
      10:81     error    line too long (85 > 80 characters)  (line-length)
      16:81     error    line too long (116 > 80 characters)  (line-length)
      30:81     error    line too long (92 > 80 characters)  (line-length)
      33:81     error    line too long (124 > 80 characters)  (line-length)
      41:19     warning  truthy value is not quoted  (truthy)
    
    /home/ansible-role-rabbitmq/molecule/default/prepare.yml
      4:17      warning  truthy value is not quoted  (truthy)
    
    /home/ansible-role-rabbitmq/molecule/default/destroy.yml
      5:17      warning  truthy value is not quoted  (truthy)
    
    /home/ansible-role-rabbitmq/meta/main.yml
      8:3       error    wrong indentation: expected 4 but found 2  (indentation)
      10:5      error    wrong indentation: expected 6 but found 4  (indentation)
      15:5      error    wrong indentation: expected 6 but found 4  (indentation)
      17:3      error    wrong indentation: expected 4 but found 2  (indentation)
    
    /home/ansible-role-rabbitmq/defaults/main.yml
      2:19      warning  truthy value is not quoted  (truthy)
      4:81      error    line too long (87 > 80 characters)  (line-length)
      8:81      error    line too long (104 > 80 characters)  (line-length)
      11:1      error    wrong indentation: expected 2 but found 0  (indentation)
      16:1      error    wrong indentation: expected 2 but found 0  (indentation)
      21:1      error    wrong indentation: expected 2 but found 0  (indentation)
    
    ......

so need to be updated, also i notice this one is stil using other embedded dependency that i solve in mine PR: #5, i would like to say that one should be merged first, rebase this one on that one and than merge it after molecule test is working properly

@aignas
Copy link
Collaborator Author

aignas commented May 3, 2018

OK, I'll try to fix this before the merge, but I am slightly busy these days.

@aignas aignas closed this Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants