ansible-minecraft icon indicating copy to clipboard operation
ansible-minecraft copied to clipboard

Add linting to CI tests

Open brahmlower opened this issue 7 years ago • 5 comments

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 avatar Dec 12 '17 16:12 brahmlower

I'll get started on this later today.

brahmlower avatar Dec 12 '17 16:12 brahmlower

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

joshuacherry avatar Dec 12 '17 18:12 joshuacherry

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?

brahmlower avatar Dec 13 '17 02:12 brahmlower

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.

benwebber avatar Dec 14 '17 06:12 benwebber

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.

brahmlower avatar Dec 14 '17 09:12 brahmlower