From b9b3561653ca79822298b5be0cb87e313ad3b3cf Mon Sep 17 00:00:00 2001 From: Jiri Kucera Date: Mon, 19 Aug 2019 12:48:30 +0200 Subject: [PATCH] Support multiple Molecule scenarios Other changes: - run linters before tests - return [pylint] and [pycodestyle] back on the list (some IDE's rely on this) --- .travis/runtox | 7 +++++++ tox.ini | 15 +++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.travis/runtox b/.travis/runtox index 068e559..5dc1849 100755 --- a/.travis/runtox +++ b/.travis/runtox @@ -10,3 +10,10 @@ if [[ -f ${CONFIG} ]]; then fi tox "$@" +if [[ "x${LSR_MSCENARIOS}" != "x" ]]; then + for X in ${LSR_MSCENARIOS}; do + LSR_MSCENARIO=${X} tox -e molecule_lint + LSR_MSCENARIO=${X} tox -e molecule_syntax + LSR_MSCENARIO=${X} tox -e molecule_test + done +fi diff --git a/tox.ini b/tox.ini index 97f8312..3c7cfe4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = - py{26,27,36,37,38}, black, pylint, flake8, + py{26,27,36,37,38}, molecule_{lint,syntax,test}, extra skipsdist = true @@ -167,21 +167,21 @@ commands_pre = molecule --version ansible --version commands = - molecule {posargs} lint + molecule lint -s {env:LSR_MSCENARIO:default} {posargs} [testenv:molecule_syntax] envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:molecule} deps = {[molecule]deps} commands = - molecule {posargs} syntax + molecule syntax -s {env:LSR_MSCENARIO:default} {posargs} [testenv:molecule_test] envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:molecule} deps = {[molecule]deps} commands = - molecule {posargs} test + molecule test -s {env:LSR_MSCENARIO:default} {posargs} # Here we provide a way how a role can add its custom command to be run. Such # extra command is run at the end of each testenv run and is driven by @@ -225,6 +225,13 @@ show_source = true max-line-length = 88 ignore = E402,W503 +[pylint] +max-line-length = 88 +disable = wrong-import-position + +[pycodestyle] +max-line-length = 88 + [travis] python = 2.6: py26,extra