Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
Make driver require molecule 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Oct 29, 2020
1 parent db1bde7 commit da8c06c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
33 changes: 20 additions & 13 deletions molecule_azure/test/functional/test_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

import pytest
import os
import sh

from molecule import logger
from molecule.test.conftest import run_command, change_dir_to
from molecule.util import run_command
from molecule.test.conftest import change_dir_to

# import change_dir_to, temp_dir

Expand All @@ -33,23 +33,30 @@

def test_command_init_scenario(temp_dir):
role_directory = os.path.join(temp_dir.strpath, "test-init")
options = {}
cmd = sh.molecule.bake("init", "role", "test-init", **options)
run_command(cmd)
cmd = ["molecule", "init", "role", "test-init"]
result = run_command(cmd)
assert result.returncode == 0

with change_dir_to(role_directory):
molecule_directory = pytest.helpers.molecule_directory()
scenario_directory = os.path.join(molecule_directory, "test-scenario")
options = {
"role_name": "test-init",
"driver-name": "azure",
}
cmd = sh.molecule.bake("init", "scenario", "test-scenario", **options)
run_command(cmd)
cmd = [
"molecule",
"init",
"scenario",
"test-scenario",
"--role-name",
"test-init",
"--driver-name",
"azure",
]
result = run_command(cmd)
assert result.returncodes == 0

assert os.path.isdir(scenario_directory)

# temporary trick to pass on CI/CD
if "AZURE_SECRET" in os.environ:
cmd = sh.molecule.bake("test", "-s", "test-scenario")
run_command(cmd)
cmd = ["molecule", "test", "-s", "test-scenario"]
result = run_command(cmd)
assert result.returncode == 0
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ setup_requires =
# These are required in actual runtime:
install_requires =
# molecule plugins are not allowed to mention Ansible as a direct dependency
molecule >= 3.1.3
molecule >= 3.2.0a0

[options.extras_require]
test =
Expand Down
19 changes: 15 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
minversion = 3.9.0
envlist = lint,packaging,py36,py37,py38,devel
skipsdist = True
skip_missing_interpreters = True
envlist =
lint
docs
packaging
py{36,37,38,39}
py{36,37,38,39}-{devel}

# do not enable skip missing to avoid CI false positives
skip_missing_interpreters = False
isolated_build = True

[testenv]
description =
Unit testing
usedevelop = True
extras = test
commands =
pytest --collect-only
pytest --color=yes {tty:-s}
Expand Down Expand Up @@ -48,6 +53,12 @@ passenv =
TRAVIS_*
TWINE_*
USER
deps =
py{36,37,38,39}: molecule[ansible,test]
py{36,37,38,39}-{devel}: git+https://github.com/ansible-community/molecule.git@master#egg=molecule[ansible,test]
extras =
ansible
test
whitelist_externals =
bash
twine
Expand Down

0 comments on commit da8c06c

Please sign in to comment.