devops-coop / ansible-minecraft

Ansible role for provisioning a vanilla Minecraft server
https://galaxy.ansible.com/devops-coop/minecraft/
Apache License 2.0
57 stars 38 forks source link

Add linting to CI tests #20

Open brahmlower opened 6 years ago

brahmlower commented 6 years ago

From conversation in #19, add playbook and python linting to the CI checks. Ben suggested using tox and flake8, providing this example tox config:

[tox]
envlist = py27,py35,py36

[testenv]
deps =
  flake8
command = flake8 library/
brahmlower commented 6 years ago

I'll get started on this later today.

joshuacherry commented 6 years ago

On the topic of CI, have you given any thought to Molecule? It does linting on python and ansible, supports tox, and is fairly straightforward.

I use it on a number of private repos and enjoy it. Here is an example ansible role with molecule. https://github.com/joshuacherry/example-ansible-role

brahmlower commented 6 years ago

I personally haven't, but it sounds pretty convenient. I'm totally down to give it a shot though! @benwebber do you have any thoughts on using Molecule?

benwebber commented 6 years ago

I really like the integration with testinfra. pytest is a joy to use and testinfra's Docker fixture is brilliant.

I don't really like the boilerplate it requires, but in the past year or so it's become the standard Docker test harness.

Overall I'm in favour if we can replicate the current test matrix using Molecule.

brahmlower commented 6 years ago

I got molecule all set for vanilla minecraft yesterday, but it's looking like it'll take a bit more to get it working with tox (granted, this is my first time working with molecule).

Personally, I'd prefer the path of least resistance since the goal is just to validate the library files. I think we should stick with the tox+flake8 plan since it's quick and easy, and we can reconsider molecule in the future if needed.