Package: src:python-ansible-compat
Version: 4.1.10-1
Severity: important
Tags: sid trixie ftbfs
User: [email protected]
Usertags: python3.12
With python3-defaults from experimental, the package fails its autopkg
tests:
[...]
612s autopkgtest [13:52:09]: test command1: python3 -m pytest -v -k 'not
test_runtime_scan_path.py'
612s autopkgtest [13:52:09]: test command1: [-----------------------
613s ============================= test session starts
==============================
613s platform linux -- Python 3.12.1, pytest-7.4.4, pluggy-1.3.0 --
/usr/bin/python3
613s cachedir: .pytest_cache
613s rootdir: /tmp/autopkgtest.VZ2G8F/build.rBd/src
613s configfile: pyproject.toml
613s testpaths: test
613s plugins: mock-3.12.0
613s collecting ... collected 93 items / 4 deselected / 89 selected
613s
613s test/test_api.py::test_placeholder PASSED
[ 1%]
614s test/test_config.py::test_config PASSED
[ 2%]
614s test/test_config.py::test_config_with_dump PASSED
[ 3%]
614s test/test_config.py::test_config_copy PASSED
[ 4%]
614s test/test_config.py::test_parse_ansible_version_fail PASSED
[ 5%]
614s test/test_config.py::test_ansible_version_missing PASSED
[ 6%]
615s test/test_config.py::test_ansible_version PASSED
[ 7%]
615s test/test_config.py::test_ansible_version_arg PASSED
[ 8%]
615s test/test_configuration_example.py::test_example_config PASSED
[ 10%]
615s test/test_loaders.py::test_colpath_from_path PASSED
[ 11%]
615s test/test_prerun.py::test_get_cache_dir_relative PASSED
[ 12%]
616s test/test_runtime.py::test_runtime_version PASSED
[ 13%]
617s
test/test_runtime.py::test_runtime_version_outdated[module-required]
PASSED [ 14%]
618s
test/test_runtime.py::test_runtime_version_outdated[module-unrequired]
PASSED [ 15%]
619s test/test_runtime.py::test_runtime_missing_ansible_module PASSED
[ 16%]
620s test/test_runtime.py::test_runtime_mismatch_ansible_module PASSED
[ 17%]
621s test/test_runtime.py::test_runtime_require_module PASSED
[ 19%]
622s test/test_runtime.py::test_runtime_version_fail_module PASSED
[ 20%]
623s test/test_runtime.py::test_runtime_version_fail_cli PASSED
[ 21%]
623s test/test_runtime.py::test_runtime_prepare_ansible_paths_validation
PASSED [ 22%]
624s test/test_runtime.py::test_runtime_install_role[1] PASSED
[ 23%]
626s test/test_runtime.py::test_runtime_install_role[2] PASSED
[ 24%]
627s test/test_runtime.py::test_runtime_install_role[3] PASSED
[ 25%]
629s test/test_runtime.py::test_runtime_install_role[4] PASSED
[ 26%]
629s test/test_runtime.py::test_prepare_environment_with_collections
PASSED [ 28%]
630s
test/test_runtime.py::test_runtime_install_requirements_missing_file
PASSED [ 29%]
630s
test/test_runtime.py::test_runtime_install_requirements_invalid_file[empty]
PASSED [ 30%]
631s
test/test_runtime.py::test_runtime_install_requirements_invalid_file[invalid-collection]
PASSED [ 31%]
632s
test/test_runtime.py::test_runtime_install_requirements_invalid_file[invalid-role]
PASSED [ 32%]
632s test/test_runtime.py::test_prerun_reqs_v1 SKIPPED (function with
error) [ 33%]
632s test/test_runtime.py::test_prerun_reqs_v2 SKIPPED (function with
error) [ 34%]
632s test/test_runtime.py::test_prerun_reqs_broken PASSED
[ 35%]
633s
test/test_runtime.py::test__update_env_no_old_value_no_default_no_value
PASSED [ 37%]
633s test/test_runtime.py::test__update_env_no_old_value_no_value PASSED
[ 38%]
634s test/test_runtime.py::test__update_env_no_default_no_value PASSED
[ 39%]
634s
test/test_runtime.py::test__update_env_no_old_value_no_default[value0-a]
PASSED [ 40%]
635s
test/test_runtime.py::test__update_env_no_old_value_no_default[value1-a:b]
PASSED [ 41%]
635s
test/test_runtime.py::test__update_env_no_old_value_no_default[value2-a:b:c]
PASSED [ 42%]
636s
test/test_runtime.py::test__update_env_no_old_value[a:b-value0-c:a:b]
PASSED [ 43%]
636s
test/test_runtime.py::test__update_env_no_old_value[a:b-value1-c:d:a:b]
PASSED [ 44%]
637s test/test_runtime.py::test__update_env_no_default[a:b-value0-c:a:b]
PASSED [ 46%]
637s
test/test_runtime.py::test__update_env_no_default[a:b-value1-c:d:a:b]
PASSED [ 47%]
638s test/test_runtime.py::test__update_env[--value0-e] PASSED
[ 48%]
638s test/test_runtime.py::test__update_env[a--value1-e:a] PASSED
[ 49%]
638s test/test_runtime.py::test__update_env[-c-value2-e] PASSED
[ 50%]
639s test/test_runtime.py::test__update_env[a-c-value3-e:f:a] PASSED
[ 51%]
640s test/test_runtime.py::test_require_collection_wrong_version PASSED
[ 52%]
641s test/test_runtime.py::test_require_collection_invalid_name PASSED
[ 53%]
641s
test/test_runtime.py::test_require_collection_invalid_collections_path
PASSED [ 55%]
642s test/test_runtime.py::test_require_collection_preexisting_broken
PASSED [ 56%]
643s test/test_runtime.py::test_require_collection FAILED
[ 57%]
644s test/test_runtime.py::test_require_collection_missing[a] PASSED
[ 58%]
646s test/test_runtime.py::test_require_collection_missing[b] PASSED
[ 59%]
646s test/test_runtime.py::test_require_collection_missing[c] PASSED
[ 60%]
646s test/test_runtime.py::test_install_collection PASSED
[ 61%]
646s test/test_runtime.py::test_install_collection_git SKIPPED (function
...) [ 62%]
648s test/test_runtime.py::test_install_collection_dest PASSED
[ 64%]
649s test/test_runtime.py::test_install_collection_fail PASSED
[ 65%]
649s test/test_runtime.py::test_install_galaxy_role PASSED
[ 66%]
650s test/test_runtime.py::test_install_galaxy_role_unlink PASSED
[ 67%]
650s test/test_runtime.py::test_install_galaxy_role_bad_namespace PASSED
[ 68%]
650s
test/test_runtime.py::test_install_galaxy_role_name_role_name_check_equals_to_1[bad-name]
PASSED [ 69%]
651s
test/test_runtime.py::test_install_galaxy_role_name_role_name_check_equals_to_1[bad-name-without-namespace]
PASSED [ 70%]
652s test/test_runtime.py::test_install_galaxy_role_no_checks PASSED
[ 71%]
653s test/test_runtime.py::test_upgrade_collection PASSED
[ 73%]
653s test/test_runtime.py::test_require_collection_no_cache_dir PASSED
[ 74%]
653s test/test_runtime.py::test_runtime_env_ansible_library PASSED
[ 75%]
654s test/test_runtime.py::test_runtime_version_in_range[1] PASSED
[ 76%]
655s test/test_runtime.py::test_runtime_version_in_range[2] PASSED
[ 77%]
656s test/test_runtime.py::test_runtime_version_in_range[3] PASSED
[ 78%]
657s test/test_runtime.py::test_runtime_version_in_range[4] PASSED
[ 79%]
658s test/test_runtime.py::test_runtime_version_in_range[5] PASSED
[ 80%]
658s test/test_runtime.py::test_install_collection_from_disk[normal]
SKIPPED [ 82%]
658s test/test_runtime.py::test_install_collection_from_disk[deep]
SKIPPED [ 83%]
659s test/test_runtime.py::test_install_collection_from_disk_fail PASSED
[ 84%]
659s test/test_runtime.py::test_prepare_environment_offline_role PASSED
[ 85%]
659s test/test_runtime.py::test_runtime_run PASSED
[ 86%]
660s test/test_runtime.py::test_runtime_exec_cwd PASSED
[ 87%]
660s test/test_runtime.py::test_runtime_exec_env PASSED
[ 88%]
668s test/test_runtime.py::test_runtime_plugins PASSED
[ 89%]
668s test/test_runtime.py::test_galaxy_path[1] PASSED
[ 91%]
668s test/test_runtime.py::test_galaxy_path[2] PASSED
[ 92%]
668s test/test_runtime.py::test_galaxy_path[3] PASSED
[ 93%]
668s test/test_runtime.py::test_is_url[0] PASSED
[ 94%]
668s test/test_runtime.py::test_is_url[1] PASSED
[ 95%]
668s test/test_runtime.py::test_is_url[2] PASSED
[ 96%]
670s test/test_runtime_example.py::test_runtime_example PASSED
[ 97%]
670s test/test_schema.py::test_schema[0] PASSED
[ 98%]
670s test/test_schema.py::test_json_path PASSED
[100%]
670s
670s =================================== FAILURES
===================================
670s ___________________________ test_require_collection
____________________________
670s
670s runtime_tmp = <ansible_compat.runtime.Runtime object at 0x7cea335d7b30>
670s
670s def test_require_collection(runtime_tmp: Runtime) -> None:
670s """Check that require collection successful install case."""
670s > runtime_tmp.require_collection("community.molecule", "0.1.0")
670s
670s test/test_runtime.py:449:
670s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
670s /usr/lib/python3/dist-packages/ansible_compat/runtime.py:748: in
require_collection
670s self.install_collection(f"{name}:>={version}" if version else name)
670s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
670s
670s self = <ansible_compat.runtime.Runtime object at 0x7cea335d7b30>
670s collection = 'community.molecule:>=0.1.0'
670s
670s def install_collection(
670s self,
670s collection: str | Path,
670s *,
670s destination: Path | None = None,
670s force: bool = False,
670s ) -> None:
670s """Install an Ansible collection.
670s
670s Can accept arguments like:
670s 'foo.bar:>=1.2.3'
670s
'git+https://github.com/ansible-collections/ansible.posix.git,main'
670s """
670s cmd = [
670s "ansible-galaxy",
670s "collection",
670s "install",
670s "-vvv", # this is needed to make ansible display
important info in case of failures
670s ]
670s if force:
670s cmd.append("--force")
670s
670s if isinstance(collection, Path):
670s collection = str(collection)
670s # As ansible-galaxy install is not able to automatically
determine
670s # if the range requires a pre-release, we need to manuall
add the --pre
670s # flag when needed.
670s matches = version_re.search(collection)
670s
670s if (
670s not is_url(collection)
670s and matches
670s and CollectionVersion(matches[1]).is_prerelease
670s ):
670s cmd.append("--pre")
670s
670s cpaths: list[str] = self.config.collections_paths
670s if destination and str(destination) not in cpaths:
670s # we cannot use '-p' because it breaks galaxy ability
to ignore already installed collections, so
670s # we hack ansible_collections_path instead and inject
our own path there.
670s # pylint: disable=no-member
670s cpaths.insert(0, str(destination))
670s cmd.append(f"{collection}")
670s
670s _logger.info("Running from %s : %s", Path.cwd(), " ".join(cmd))
670s run = self.run(
670s cmd,
670s retry=True,
670s env={**self.environ, ansible_collections_path():
":".join(cpaths)},
670s )
670s if run.returncode != 0:
670s msg = f"Command returned {run.returncode}
code:\n{run.stdout}\n{run.stderr}"
670s _logger.error(msg)
670s > raise InvalidPrerequisiteError(msg)
670s E ansible_compat.errors.InvalidPrerequisiteError: Command
returned 1 code:
670s E Starting galaxy collection install process
670s E Process install dependency map
670s E
670s E ansible-galaxy [core 2.14.13]
670s E config file =
/tmp/autopkgtest.VZ2G8F/build.rBd/src/ansible.cfg
670s E configured module search path =
['/home/ubuntu/.ansible/plugins/modules',
'/usr/share/ansible/plugins/modules']
670s E ansible python module location =
/usr/lib/python3/dist-packages/ansible
670s E ansible collection location =
/home/ubuntu/.cache/ansible-compat/74eca2/collections:/tmp/autopkgtest.VZ2G8F/build.rBd/src
670s E executable location = /usr/bin/ansible-galaxy
670s E python version = 3.12.1 (main, Dec 8 2023, 16:20:54)
[GCC 13.2.0] (/usr/bin/python3)
670s E jinja version = 3.1.2
670s E libyaml = True
670s E Using /tmp/autopkgtest.VZ2G8F/build.rBd/src/ansible.cfg
as config file
670s E Opened /home/ubuntu/.ansible/galaxy_token
670s E [WARNING]: Skipping Galaxy server
https://galaxy.ansible.com. Got an unexpected
670s E error when getting available versions of collection
community.molecule: Unknown
670s E error when attempting to call Galaxy at
'https://galaxy.ansible.com/api/':
670s E HTTPSConnection.__init__() got an unexpected keyword
argument 'cert_file'.
670s E HTTPSConnection.__init__() got an unexpected keyword
argument 'cert_file'
670s E ERROR! Unknown error when attempting to call Galaxy at
'https://galaxy.ansible.com/api/': HTTPSConnection.__init__() got an
unexpected keyword argument 'cert_file'. HTTPSConnection.__init__() got
an unexpected keyword argument 'cert_file'
670s
670s /usr/lib/python3/dist-packages/ansible_compat/runtime.py:467:
InvalidPrerequisiteError
670s ------------------------------ Captured log call
-------------------------------
670s WARNING ansible_compat.runtime:runtime.py:373 Retrying execution
failure 1 of: ansible-galaxy collection install -vvv
community.molecule:>=0.1.0
670s ERROR ansible_compat.runtime:runtime.py:466 Command returned 1 code:
670s Starting galaxy collection install process
670s Process install dependency map
670s
670s ansible-galaxy [core 2.14.13]
670s config file = /tmp/autopkgtest.VZ2G8F/build.rBd/src/ansible.cfg
670s configured module search path =
['/home/ubuntu/.ansible/plugins/modules',
'/usr/share/ansible/plugins/modules']
670s ansible python module location =
/usr/lib/python3/dist-packages/ansible
670s ansible collection location =
/home/ubuntu/.cache/ansible-compat/74eca2/collections:/tmp/autopkgtest.VZ2G8F/build.rBd/src
670s executable location = /usr/bin/ansible-galaxy
670s python version = 3.12.1 (main, Dec 8 2023, 16:20:54) [GCC
13.2.0] (/usr/bin/python3)
670s jinja version = 3.1.2
670s libyaml = True
670s Using /tmp/autopkgtest.VZ2G8F/build.rBd/src/ansible.cfg as config file
670s Opened /home/ubuntu/.ansible/galaxy_token
670s [WARNING]: Skipping Galaxy server https://galaxy.ansible.com. Got
an unexpected
670s error when getting available versions of collection
community.molecule: Unknown
670s error when attempting to call Galaxy at
'https://galaxy.ansible.com/api/':
670s HTTPSConnection.__init__() got an unexpected keyword argument
'cert_file'.
670s HTTPSConnection.__init__() got an unexpected keyword argument
'cert_file'
670s ERROR! Unknown error when attempting to call Galaxy at
'https://galaxy.ansible.com/api/': HTTPSConnection.__init__() got an
unexpected keyword argument 'cert_file'. HTTPSConnection.__init__() got
an unexpected keyword argument 'cert_file'
670s =========================== short test summary info
============================
670s FAILED test/test_runtime.py::test_require_collection -
ansible_compat.errors....
670s ============ 1 failed, 83 passed, 5 skipped, 4 deselected in 58.28s
============