1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 13:19:13 +00:00
community.general/tests/unit/plugins/modules
Adam R. ed7ccbe3d4
maven_artifact: resolve SNAPSHOT to latest using snapshot metadata block (#11501)
* fix(maven_artifact): resolve SNAPSHOT to latest using snapshot metadata block

Prefer the <snapshot> block (timestamp + buildNumber) from maven-metadata.xml
which always points to the latest build, instead of scanning <snapshotVersions>
and returning on the first match. Repositories like GitHub Packages keep all
historical entries in <snapshotVersions> (oldest first), causing the module to
resolve to the oldest snapshot instead of the latest.

Fixes #5117
Fixes #11489

* fix(maven_artifact): address review feedback

- Check both timestamp and buildNumber before using snapshot block,
  preventing IndexError when buildNumber is missing
- Remove unreliable snapshotVersions scanning fallback; use literal
  -SNAPSHOT version for non-unique snapshot repos instead
- Add tests for incomplete snapshot block and non-SNAPSHOT versions

* fix(maven_artifact): restore snapshotVersions scanning with last-match

Restore <snapshotVersions> scanning as primary resolution (needed for
per-extension accuracy per MNG-5459), but collect the last match instead
of returning on the first. Fall back to <snapshot> block when no
<snapshotVersions> match is found, then to literal -SNAPSHOT version.

* docs: update changelog fragment to match final implementation

* fix(maven_artifact): use updated timestamp for snapshot resolution

Use the <updated> attribute to select the newest snapshotVersion entry
instead of relying on list order. This works independently of how the
repository manager sorts entries in maven-metadata.xml.

Also fix test docstring and update changelog fragment per reviewer
feedback.

* test(maven_artifact): shuffle entries to verify updated timestamp sorting

Reorder snapshotVersion entries so the newest JAR is in the middle,
not at the end. This ensures the test actually validates that resolution
uses the <updated> timestamp rather than relying on list position.
2026-02-14 21:03:00 +01:00
..
interfaces_file Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
conftest.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
FakeAnsibleModule.py Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
FakeXenAPI.py Reformat everything. 2025-11-01 13:46:53 +01:00
gitlab.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
hpe_test_utils.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
linode_conftest.py Reformat everything. 2025-11-01 13:46:53 +01:00
oneview_conftest.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
oneview_module_loader.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_alerta_customer.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_apache2_module.py Reformat everything. 2025-11-01 13:46:53 +01:00
test_apk.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_archive.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_bitbucket_access_key.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_bitbucket_pipeline_key_pair.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_bitbucket_pipeline_known_host.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_bitbucket_pipeline_variable.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_bootc_manage.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_campfire.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_circonus_annotation.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_composer.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_composer.yaml tests/unit/plugins/modules/test_composer.yaml: remove redundant lines (#10910) 2025-10-12 17:36:50 +13:00
test_cpanm.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_cpanm.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_datadog_downtime.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_dconf.py Reformat everything. 2025-11-01 13:46:53 +01:00
test_discord.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_django_check.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_django_check.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_django_command.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_django_command.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_django_createcachetable.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_django_createcachetable.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_django_dumpdata.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_django_dumpdata.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_django_loaddata.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_django_loaddata.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_dnf_config_manager.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_dnsimple.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_dnsimple_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_facter_facts.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_facter_facts.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_gconftool2.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gconftool2.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_gconftool2_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gconftool2_info.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_gem.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gio_mime.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gio_mime.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_github_repo.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gitlab_deploy_key.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gitlab_group.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gitlab_group_access_token.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gitlab_hook.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gitlab_project.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gitlab_project_access_token.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gitlab_protected_branch.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gitlab_runner.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_gitlab_user.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_homebrew.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_homebrew_cask.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_icinga2_feature.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_ini_file.py Reformat everything. 2025-11-01 13:46:53 +01:00
test_ip2location_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_ipa_getkeytab.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_ipa_otpconfig.py Remove unittest.main() calls (#11304) 2025-12-22 15:47:42 +01:00
test_ipa_otptoken.py Remove unittest.main() calls (#11304) 2025-12-22 15:47:42 +01:00
test_ipa_pwpolicy.py Remove unittest.main() calls (#11304) 2025-12-22 15:47:42 +01:00
test_ipbase.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_java_keystore.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_jenkins_build.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_jenkins_build_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_jenkins_credential.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_jenkins_node.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_jenkins_plugin.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_authentication.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_authentication_required_actions.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_client.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_client_rolemapping.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_clientscope.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_component.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_identity_provider.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_realm.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_realm_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_realm_keys.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_realm_keys_metadata_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_role.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_user.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_user_execute_actions_email.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_user_federation.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_keycloak_userprofile.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_krb_ticket.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_krb_ticket.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_linode.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_linode_v4.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_lvg_rename.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_lxca_cmms.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_lxca_nodes.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_lxd_storage_pool_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_lxd_storage_volume_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_macports.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_maven_artifact.py maven_artifact: resolve SNAPSHOT to latest using snapshot metadata block (#11501) 2026-02-14 21:03:00 +01:00
test_modprobe.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_monit.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_nmcli.py feat(nmcli): Add support for IPv6 routing rules (#11413) 2026-01-16 21:05:43 +01:00
test_nomad_token.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_npm.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_ocapi_command.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_ocapi_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_one_vm.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_datacenter_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_enclosure_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_ethernet_network.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_ethernet_network_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_fc_network.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_fc_network_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_fcoe_network.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_fcoe_network_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_logical_interconnect_group.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_logical_interconnect_group_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_network_set.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_network_set_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_san_manager.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_oneview_san_manager_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_opkg.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_opkg.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_pacemaker_cluster.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pacemaker_cluster.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_pacemaker_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pacemaker_info.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_pacemaker_resource.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pacemaker_resource.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_pacemaker_stonith.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pacemaker_stonith.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_pacman.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pacman_key.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pagerduty.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pagerduty_alert.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pagerduty_change.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pamd.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_parted.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pkgin.py Reformat everything. 2025-11-01 13:46:53 +01:00
test_pmem.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pritunl_org.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pritunl_org_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pritunl_user.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_pritunl_user_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_puppet.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_puppet.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_redhat_subscription.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_redis_data.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_redis_data_incr.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_redis_data_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_redis_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_rhsm_release.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_rhsm_repository.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_rpm_ostree_pkg.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_rundeck_acl_policy.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_scaleway_compute_private_network.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_scaleway_private_network.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_simpleinit_msb.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_slack.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_snap.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_solaris_zone.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_ss_3par_cpg.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_sssd_info.py add sssd_info module (#11120) 2025-12-22 15:55:28 +01:00
test_statsd.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_sysupgrade.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_terraform.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_ufw.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_usb_facts.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_wdc_redfish_command.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_wdc_redfish_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_xcc_redfish_command.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_xdg_mime.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_xdg_mime.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
test_xenserver_guest_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_xenserver_guest_powerstate.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_xfconf.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_xfconf.yaml xfconf: fix existing empty array case (#11026) 2025-11-02 20:20:31 +01:00
test_xfconf_info.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
test_xfconf_info.yaml Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886) 2025-10-10 19:52:04 +02:00
uthelper.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
utils.py Reformat everything. 2025-11-01 13:46:53 +01:00
xenserver_common.py unit tests (modules): use f-strings (#10992) 2025-10-27 11:08:33 +13:00
xenserver_conftest.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00