From 4443399459befb2c6792d553211a32a609d7d7c1 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 8 Jul 2020 22:47:33 +0200 Subject: [PATCH] Fixes --- .azure-pipelines/templates/jobs/packaging-jobs.yml | 6 ++---- certbot-ci/snap_integration_tests/conftest.py | 4 ++-- certbot-ci/snap_integration_tests/dns_tests/test_main.py | 7 ++++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.azure-pipelines/templates/jobs/packaging-jobs.yml b/.azure-pipelines/templates/jobs/packaging-jobs.yml index c9483095c..9742269e4 100644 --- a/.azure-pipelines/templates/jobs/packaging-jobs.yml +++ b/.azure-pipelines/templates/jobs/packaging-jobs.yml @@ -152,10 +152,8 @@ jobs: displayName: Retrieve Certbot DNS plugins snaps - script: | python3 -m venv venv - venv/Scripts/python tools/pip_install.py -e certbot-ci + venv/bin/python tools/pip_install.py -e certbot-ci displayName: Prepare Certbot-CI - script: | - python3 -m venv venv - venv/Scripts/python tools/pip_install.py -e certbot-ci - sudo -E venv/Scripts/python -m pytest certbot-ci/snap_integration_tests/dns_tests --allow-persistent-changes --snap-folder $(Build.SourcesDirectory)/snap + sudo -E venv/bin/pytest certbot-ci/snap_integration_tests/dns_tests --allow-persistent-changes --snap-folder $(Build.SourcesDirectory)/snap displayName: Test DNS plugins snaps diff --git a/certbot-ci/snap_integration_tests/conftest.py b/certbot-ci/snap_integration_tests/conftest.py index 054b8ea9b..751cd5b72 100644 --- a/certbot-ci/snap_integration_tests/conftest.py +++ b/certbot-ci/snap_integration_tests/conftest.py @@ -36,5 +36,5 @@ def pytest_generate_tests(metafunc): Generate (multiple) parametrized calls to a test function. """ if "dns_snap_path" in metafunc.fixturenames: - snap_dns_path_list = glob.glob(os.path.join(metafunc.config.snap_folder, 'certbot-dns-*_*.snap')) - metafunc.parametrize("snap_dns_path", snap_dns_path_list) + snap_dns_path_list = glob.glob(os.path.join(metafunc.config.getoption('snap_folder'), 'certbot-dns-*_*.snap')) + metafunc.parametrize("dns_snap_path", snap_dns_path_list) diff --git a/certbot-ci/snap_integration_tests/dns_tests/test_main.py b/certbot-ci/snap_integration_tests/dns_tests/test_main.py index 02323a20e..ef133dc59 100644 --- a/certbot-ci/snap_integration_tests/dns_tests/test_main.py +++ b/certbot-ci/snap_integration_tests/dns_tests/test_main.py @@ -11,7 +11,8 @@ def install_certbot_snap(request): with pytest.raises(Exception): subprocess.check_call(['certbot', '--version']) try: - snap_path = glob.glob(os.path.join(request.config.snap_folder, 'certbot_*.snap'))[0] + snap_path = glob.glob(os.path.join(request.config.getoption("snap_folder"), + 'certbot_*.snap'))[0] subprocess.check_call(['snap', 'install', '--classic', '--dangerous', snap_path]) subprocess.check_call(['certbot', '--version']) yield @@ -21,8 +22,8 @@ def install_certbot_snap(request): def test_dns_plugin_install(dns_snap_path): """ - Test that each DNS plugin Certbot snap available in SNAP_FOLDER - can be installed and is usable with the Certbot snap. + Test that each DNS plugin Certbot snap can be installed + and is usable with the Certbot snap. """ plugin_name = re.match(r'^certbot-(dns-\w+)_.*\.snap$', os.path.basename(dns_snap_path)).group(1)