diff options
author | Felix Fontein <felix@fontein.de> | 2024-08-26 19:59:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-26 19:59:34 +0200 |
commit | faf446a895590344e1563455edba05809401f9c8 (patch) | |
tree | dc6014162c1faac880e3c3c6954e9ab4ac64f5b8 /test/lib | |
parent | galaxy-cli tasking polling interval from environment variable (#83803) (diff) | |
download | ansible-faf446a895590344e1563455edba05809401f9c8.tar.xz ansible-faf446a895590344e1563455edba05809401f9c8.zip |
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.
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/ansible_test/_util/controller/sanity/code-smell/runtime-metadata.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/lib/ansible_test/_util/controller/sanity/code-smell/runtime-metadata.py b/test/lib/ansible_test/_util/controller/sanity/code-smell/runtime-metadata.py index 188d50fef5..ad7d017767 100644 --- a/test/lib/ansible_test/_util/controller/sanity/code-smell/runtime-metadata.py +++ b/test/lib/ansible_test/_util/controller/sanity/code-smell/runtime-metadata.py @@ -123,7 +123,9 @@ def get_collection_version(): # noinspection PyBroadException try: result = collection_detail.read_manifest_json('.') or collection_detail.read_galaxy_yml('.') - return SemanticVersion(result['version']) + version = SemanticVersion() + version.parse(result['version']) + return version except Exception: # pylint: disable=broad-except # We do not care why it fails, in case we cannot get the version # just return None to indicate "we don't know". |