From 357a80d9acaf97d68d9404f2f5ca856b568620a0 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 16 Nov 2019 08:05:43 +0700 Subject: [PATCH 1/5] Use correct module path for new plugin import --- molecule_hetznercloud/test/unit/driver/test_hetznercloud.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/molecule_hetznercloud/test/unit/driver/test_hetznercloud.py b/molecule_hetznercloud/test/unit/driver/test_hetznercloud.py index 4ea2968..310a971 100644 --- a/molecule_hetznercloud/test/unit/driver/test_hetznercloud.py +++ b/molecule_hetznercloud/test/unit/driver/test_hetznercloud.py @@ -22,7 +22,7 @@ import os import pytest from molecule import config -from molecule.driver import hetznercloud +from molecule_hetznercloud import hetznercloud @pytest.fixture @@ -96,7 +96,7 @@ def test_hetznercloud_default_ssh_connection_options_property(hetznercloud_insta def test_hetznercloud_login_options(hetznercloud_instance, mocker): - target = "molecule.driver.hetznercloud.HetznerCloud._get_instance_config" + target = "molecule_hetznercloud.hetznercloud.HetznerCloud._get_instance_config" get_instance_config_patch = mocker.patch(target) get_instance_config_patch.return_value = { @@ -119,7 +119,7 @@ def test_hetznercloud_login_options(hetznercloud_instance, mocker): def test_hetznercloud_ansible_connection_opts(hetznercloud_instance, mocker): - target = "molecule.driver.hetznercloud.HetznerCloud._get_instance_config" + target = "molecule_hetznercloud.hetznercloud.HetznerCloud._get_instance_config" get_instance_config_patch = mocker.patch(target) get_instance_config_patch.return_value = { From 010b0a609c8a449dc9a15f98ddbd9c3c93a4e656 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 16 Nov 2019 08:05:55 +0700 Subject: [PATCH 2/5] Ignore those warnings --- pytest.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pytest.ini b/pytest.ini index bc0f916..bb54d2d 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,3 +3,8 @@ addopts = -v -rxXs --doctest-modules --durations 10 --cov=molecule_hetznercloud doctest_optionflags = ALLOW_UNICODE ELLIPSIS junit_suite_name = molecule_test_suite norecursedirs = dist doc build .tox .eggs +filterwarnings = + # remove once https://github.com/cookiecutter/cookiecutter/pull/1127 is released + ignore::DeprecationWarning:cookiecutter + # remove once https://github.com/pytest-dev/pytest-cov/issues/327 is released + ignore::pytest.PytestWarning:pytest_cov From 20441611fec1dd292b12352879f9618a14619bc1 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 16 Nov 2019 08:06:05 +0700 Subject: [PATCH 3/5] Properly bound experimental Molecule 3.0 dependency --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index ea53b17..b5de9ff 100644 --- a/setup.cfg +++ b/setup.cfg @@ -64,7 +64,7 @@ setup_requires = setuptools_scm >= 1.15.0 setuptools_scm_git_archive >= 1.0 install_requires = - molecule >= 3.0a3 + molecule >= 3.0a3, <= 3.0 pyyaml >= 5.1, < 6 backports.shutil_which ; python_version<"3.3" From becb3a81e4f3e87a770756725c0ca02f1df43d20 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 16 Nov 2019 08:06:17 +0700 Subject: [PATCH 4/5] Use correct path for coverage --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 978be59..5d02068 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ passenv = * setenv = ANSIBLE_CALLABLE_WHITELIST={env:ANSIBLE_CALLABLE_WHITELIST:timer,profile_roles} PYTHONDONTWRITEBYTECODE=1 - PYTEST_ADDOPTS=molecule_hetznercloud/test/unit/ --cov={toxinidir}/molecule/ --no-cov-on-fail {env:PYTEST_ADDOPTS:-n auto} + PYTEST_ADDOPTS=molecule_hetznercloud/test/unit/ --cov={toxinidir}/molecule_hetznercloud/ --no-cov-on-fail {env:PYTEST_ADDOPTS:-n auto} deps = ansible28: ansible>=2.8,<2.9 extras = From 3f14b693f6b17eec1d373e73ff7da9845f4f67c0 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 16 Nov 2019 08:25:08 +0700 Subject: [PATCH 5/5] Mark skipped tests for now --- .../test/unit/model/v2/test_platforms_section.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/molecule_hetznercloud/test/unit/model/v2/test_platforms_section.py b/molecule_hetznercloud/test/unit/model/v2/test_platforms_section.py index b2d0876..4e7ae3d 100644 --- a/molecule_hetznercloud/test/unit/model/v2/test_platforms_section.py +++ b/molecule_hetznercloud/test/unit/model/v2/test_platforms_section.py @@ -66,6 +66,7 @@ def _model_platforms_hetznercloud_errors_section_data(): } +@pytest.mark.skip(reason="https://github.com/ansible/molecule/issues/2442") @pytest.mark.parametrize( "_config", ["_model_platforms_hetznercloud_errors_section_data"], indirect=True ) @@ -91,6 +92,7 @@ def test_platforms_hetznercloud_has_errors(_config): assert expected_config == schema_v2.validate(_config) +@pytest.mark.skip(reason="https://github.com/ansible/molecule/issues/2442") @pytest.mark.parametrize( "_config", ["_model_platform_hetznercloud_section_data"], indirect=True )