Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible-test fails to check 'requires_ansible' field in meta/runtime.yml of collection #75353

Closed
1 task done
sshnaidm opened this issue Jul 29, 2021 · 5 comments · Fixed by #75356
Closed
1 task done
Labels
affects_2.11 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@sshnaidm
Copy link
Contributor

Summary

Because Ansible Galaxy requires now to have requires_ansible field[1][2] in meta/runtime.yml file, when adding it and running ansible-test with --venv option, it fails (requiring packaging module):

Run command: ansible-doc -t inventory openstack.cloud.openstack
2021-07-29 12:01:40.224903 | ubuntu-bionic | ERROR: Output on stderr from ansible-doc is considered an error.
2021-07-29 12:01:40.225013 | ubuntu-bionic |
2021-07-29 12:01:40.225045 | ubuntu-bionic | Command "ansible-doc -t inventory openstack.cloud.openstack" returned exit status 0.
2021-07-29 12:01:40.225073 | ubuntu-bionic | >>> Standard Error
2021-07-29 12:01:40.225101 | ubuntu-bionic | [WARNING]: packaging Python module unavailable; unable to validate collection
2021-07-29 12:01:40.225128 | ubuntu-bionic | Ansible version requirements�[0m

[1] ansible/galaxy-importer#122
[2] ansible/galaxy-importer#124

Issue Type

Bug Report

Component Name

ansible-test

Ansible Version

$ ansible --version

 ansible [core 2.11.3.post0]
2021-07-29 12:01:27.874064 | ubuntu-bionic |   config file = None
2021-07-29 12:01:27.874079 | ubuntu-bionic |   configured module search path = ['/home/zuul/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
2021-07-29 12:01:27.874093 | ubuntu-bionic |   ansible python module location = /home/zuul/src/opendev.org/openstack/ansible-collections-openstack/.tox/linters/lib/python3.6/site-packages/ansible
2021-07-29 12:01:27.874107 | ubuntu-bionic |   ansible collection location = /home/zuul/.ansible/collections:/usr/share/ansible/collections
2021-07-29 12:01:27.874124 | ubuntu-bionic |   executable location = /home/zuul/src/opendev.org/openstack/ansible-collections-openstack/.tox/linters/bin/ansible
2021-07-29 12:01:27.874137 | ubuntu-bionic |   python version = 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
2021-07-29 12:01:27.874149 | ubuntu-bionic |   jinja version = 3.0.1
2021-07-29 12:01:27.874160 | ubuntu-bionic |   libyaml = True

Configuration

$ ansible-config dump --only-changed

OS / Environment

any

Steps to Reproduce

ansible-test sanity -v \
    --venv \
    --python 3.6 \
    --skip-test metaclass-boilerplate \
    --skip-test future-import-boilerplate \
    plugins/ docs/ meta/ scripts/ tests/

Expected Results

ansible-test to run without failing on missing requirements with --venv option

Actual Results

ansible-test fails

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@sshnaidm
Copy link
Contributor Author

@mattclay please take a look

@ansibot ansibot added affects_2.11 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jul 29, 2021
@felixfontein
Copy link
Contributor

I think you need to pass --requirements to make ansible-test install the requirements it needs in the venv. Unfortunately packaging does seem to be missing (probably because ansible doesn't declare it as a dependency, but some code still relies on it - see

# TODO: take the packaging dep, or vendor SpecifierSet?
try:
from packaging.specifiers import SpecifierSet
from packaging.version import Version
except ImportError:
SpecifierSet = None
Version = None
).

@sshnaidm
Copy link
Contributor Author

@felixfontein unfortunately it doesn't help, still missing packaging

@sivel
Copy link
Member

sivel commented Jul 29, 2021

I think this should be as easy as adding packaging to test/lib/ansible_test/_data/requirements/sanity.ansible-doc.txt

sshnaidm added a commit to sshnaidm/ansible that referenced this issue Jul 29, 2021
Fix ansible#75353
After requires_ansible field was added as mandatory to runtime.yml
file, ansible-test fails to check this field if it doesn't have
packaging module.

[1] ansible/galaxy-importer#124
@sshnaidm
Copy link
Contributor Author

if this is it, I prepared #75356

@ansibot ansibot added the has_pr This issue has an associated PR. label Jul 29, 2021
@mattclay mattclay removed the needs_triage Needs a first human triage before being processed. label Jul 29, 2021
mattclay pushed a commit that referenced this issue Jul 29, 2021
* Add packaging to requirement of ansible-test

Fix #75353

After requires_ansible field was added as mandatory to runtime.yml
file, ansible-test fails to check this field if it doesn't have
packaging module.

[1] ansible/galaxy-importer#124
mattclay pushed a commit to mattclay/ansible that referenced this issue Jul 29, 2021
…5356)

* Add packaging to requirement of ansible-test

Fix ansible#75353

After requires_ansible field was added as mandatory to runtime.yml
file, ansible-test fails to check this field if it doesn't have
packaging module.

[1] ansible/galaxy-importer#124
(cherry picked from commit 40ca87a)

Co-authored-by: Sergey <sshnaidm@users.noreply.github.com>
openstack-mirroring pushed a commit to openstack/ansible-collections-openstack that referenced this issue Jul 29, 2021
Disable ansible-test since it's broken in 2.11[1]

[1] ansible/ansible#75353
Change-Id: Idd2f99ddfe507b5b02de206c1f8c75692d6a84a2
mattclay pushed a commit that referenced this issue Jul 30, 2021
* Add packaging to requirement of ansible-test

Fix #75353

After requires_ansible field was added as mandatory to runtime.yml
file, ansible-test fails to check this field if it doesn't have
packaging module.

[1] ansible/galaxy-importer#124
(cherry picked from commit 40ca87a)

Co-authored-by: Sergey <sshnaidm@users.noreply.github.com>
meffie added a commit to openafs-contrib/buildbot that referenced this issue Jul 31, 2021
Add the meta/runtime.yml to appease galaxy imports.

See ansible-collections/overview#45

<quote>
Ansible Galaxy unexpectedly made a change to require mandatory
requires_ansible in meta/runtime.yml file for uploading
collection[1][2].  And after you add it you'll probably will hit
ansible-test failure in sanity checks if you use it with --venv option,
since it can't check this field because of failing requirement[3].
Worth to mention you must have meta/runtime.yml now for your collection
to be uploaded.

[1] ansible/galaxy-importer#122
[2] ansible/galaxy-importer#124
[3] ansible/ansible#75353
</quote>
meffie added a commit to openafs-contrib/ansible-openafs that referenced this issue Aug 2, 2021
Add the meta/runtime.yml to appease galaxy imports.

See ansible-collections/overview#45

<quote>
Ansible Galaxy unexpectedly made a change to require mandatory
requires_ansible in meta/runtime.yml file for uploading
collection[1][2].  And after you add it you'll probably will hit
ansible-test failure in sanity checks if you use it with --venv option,
since it can't check this field because of failing requirement[3].
Worth to mention you must have meta/runtime.yml now for your collection
to be uploaded.

[1] ansible/galaxy-importer#122
[2] ansible/galaxy-importer#124
[3] ansible/ansible#75353
</quote>
@ansible ansible locked and limited conversation to collaborators Aug 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.11 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants