mirror of https://github.com/ansible/ansible.git
runtime-metadata sanity test: do not fail deprecation version checks if galaxy.yml has empty `version` (#83831)
* Do not create invalid SemanticVersion objects. * Fix SemanticVersion.parse(). * Add basic runtime-metadata tests.pull/83865/head
parent
bed9a9597a
commit
faf446a895
@ -0,0 +1,3 @@
|
||||
bugfixes:
|
||||
- "runtime-metadata sanity test - do not crash on deprecations if ``galaxy.yml`` contains an empty ``version`` field (https://github.com/ansible/ansible/pull/83831)."
|
||||
- "Fix ``SemanticVersion.parse()`` to store the version string so that ``__repr__`` reports it instead of ``None`` (https://github.com/ansible/ansible/pull/83831)."
|
@ -0,0 +1,4 @@
|
||||
shippable/posix/group3 # runs in the distro test containers
|
||||
shippable/generic/group1 # runs in the default test container
|
||||
context/controller
|
||||
needs/target/collection
|
@ -0,0 +1,5 @@
|
||||
namespace: ns
|
||||
name: no_version
|
||||
version: null
|
||||
authors:
|
||||
- Ansible
|
@ -0,0 +1,11 @@
|
||||
extra_key: true
|
||||
plugin_routing:
|
||||
modules:
|
||||
deprecated_module:
|
||||
deprecation:
|
||||
removal_version: 2.0.0
|
||||
warning_text: Will no longer be there.
|
||||
tombstoned_module:
|
||||
tombstone:
|
||||
removal_version: 1.0.0
|
||||
warning_text: Is no longer there.
|
@ -0,0 +1,5 @@
|
||||
namespace: ns
|
||||
name: version
|
||||
version: 2.3.4
|
||||
authors:
|
||||
- Ansible
|
@ -0,0 +1,18 @@
|
||||
plugin_routing:
|
||||
modules:
|
||||
deprecated_module:
|
||||
deprecation:
|
||||
removal_version: 3.0.0
|
||||
warning_text: Will no longer be there.
|
||||
tombstoned_module:
|
||||
tombstone:
|
||||
removal_version: 2.0.0
|
||||
warning_text: Is no longer there.
|
||||
deprecated_module_wrong_version:
|
||||
deprecation:
|
||||
removal_version: 2.0.0
|
||||
warning_text: Will no longer be there.
|
||||
tombstoned_module_wrong_version:
|
||||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
warning_text: Is no longer there.
|
@ -0,0 +1 @@
|
||||
meta/runtime.yml:0:0: extra keys not allowed @ data['extra_key']. Got True
|
@ -0,0 +1,2 @@
|
||||
meta/runtime.yml:0:0: The deprecation removal_version ('2.0.0') must be after the current version (SemanticVersion('2.3.4')) for dictionary value @ data['plugin_routing']['modules']['deprecated_module_wrong_version']['deprecation']['removal_version']. Got '2.0.0'
|
||||
meta/runtime.yml:0:0: The tombstone removal_version ('3.0.0') must not be after the current version (SemanticVersion('2.3.4')) for dictionary value @ data['plugin_routing']['modules']['tombstoned_module_wrong_version']['tombstone']['removal_version']. Got '3.0.0'
|
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
COLLECTION_NAME=version source ../collection/setup.sh
|
||||
|
||||
set -eux
|
||||
|
||||
cd ../version
|
||||
ansible-test sanity --test runtime-metadata --color --truncate 0 --failure-ok --lint "${@}" 1> actual-stdout.txt 2> actual-stderr.txt
|
||||
diff -u "${TEST_DIR}/expected-version.txt" actual-stdout.txt
|
||||
grep -F -f "${TEST_DIR}/expected-version.txt" actual-stderr.txt
|
||||
|
||||
cd ../no_version
|
||||
ansible-test sanity --test runtime-metadata --color --truncate 0 --failure-ok --lint "${@}" 1> actual-stdout.txt 2> actual-stderr.txt
|
||||
diff -u "${TEST_DIR}/expected-no_version.txt" actual-stdout.txt
|
||||
grep -F -f "${TEST_DIR}/expected-no_version.txt" actual-stderr.txt
|
Loading…
Reference in New Issue