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

Community package requirements: sanity tests #347

Closed
gotmax23 opened this issue Jan 23, 2024 · 13 comments · Fixed by #349
Closed

Community package requirements: sanity tests #347

gotmax23 opened this issue Jan 23, 2024 · 13 comments · Fixed by #349

Comments

@gotmax23
Copy link
Contributor

(Note: This issue was filed in a semi-automated fashion. Let me know if you see errors in this issue.)

As per the Ansible community package inclusion requirements, collections must pass ansible-test sanity tests. Version 1.24.0 of community.digitalocean, corresponding to the 1.24.0 tag in this repo, fails one or more of the required sanity tests.

Please see the errors below and address them. If these issues aren't addressed within a reasonable time period, the collection may be subject to removal from Ansible.

Thank you for your efforts and for being part of the Ansible package! We appreciate it.


Sanity tests

The following tests were run using ansible-test version 2.16.1:

  • ansible-doc
  • compile
  • validate-modules
  • yamllint

Note that this is only a subset of the required sanity tests. Please make sure you run them in all in your CI.

Results

💡 NOTE:

Check the [explain] links below for more information about each test and how to fix failures.
See Sanity Tests: Ignores in the dev guide if, after reading the test-specific documentation, you still believe an error is a false positive.

The test ansible-test sanity --test compile --python 2.7 [explain] failed with 2 errors:

plugins/modules/digital_ocean_spaces.py:121:67: SyntaxError: endpoint_url=f"https://{region}.digitaloceanspaces.com",
plugins/modules/digital_ocean_spaces_info.py:104:71: SyntaxError: endpoint_url=f"https://{region}.digitaloceanspaces.com",

The test ansible-test sanity --test validate-modules [explain] failed with 4 errors:

plugins/modules/digital_ocean_cdn_endpoints.py:0:0: doc-default-does-not-match-spec: Argument 'certificate_id' in argument_spec defines default as ('') but documentation defines default as (None)
plugins/modules/digital_ocean_cdn_endpoints.py:0:0: doc-default-does-not-match-spec: Argument 'custom_domain' in argument_spec defines default as ('') but documentation defines default as (None)
plugins/modules/digital_ocean_domain_record.py:0:0: doc-default-does-not-match-spec: Argument 'data' in argument_spec defines default as (None) but documentation defines default as ('')
plugins/modules/digital_ocean_snapshot.py:0:0: doc-default-does-not-match-spec: Argument 'snapshot_tags' in argument_spec defines default as ([]) but documentation defines default as (None)
@mamercad
Copy link
Collaborator

mamercad commented Jan 23, 2024

I believe that even today, Ansible requires Python 2.x support (even though that version has been EOL since 1 January 2020). On the other hand, this collection doesn't. I can't imagine a scenario where an Ansible controller cannot support Python 3 (presumably most folks use this Collection either on their laptops or in CI/CD where there's Python 3).

I can't reproduce this locally on Python 3.10.13:

❯ python3 -V
Python 3.10.13

❯ ansible-test --version
ansible-test version 2.16.2

❯ ansible-test sanity --test validate-modules --python 3.10
Running sanity test "validate-modules"

@mamercad
Copy link
Collaborator

If this is only reproducible on Python 2.x ... I'm personally not going to waste effort getting it to work. With that in mind, how do you want to proceed with this issue?

@gotmax23
Copy link
Contributor Author

Yes, we do not require collections to support Python 2.x anymore. See https://docs.ansible.com/ansible-core/2.16/dev_guide/testing/sanity/compile.html for how to configure the minimum Python version ansible-test uses. Other than that, please make sure that you're running ansible-test sanity in CI to catch any future issues. Thanks!

@mamercad
Copy link
Collaborator

Yes, we do not require collections to support Python 2.x anymore. See https://docs.ansible.com/ansible-core/2.16/dev_guide/testing/sanity/compile.html for how to configure the minimum Python version ansible-test uses. Other than that, please make sure that you're running ansible-test sanity in CI to catch any future issues. Thanks!

Code which runs on targets (modules and module_utils) must support all control node supported Python versions, as well as the additional Python versions supported only on targets:

  • 3.8
  • 3.7
  • 3.6
  • 3.5
  • 2.7

@mamercad
Copy link
Collaborator

for how to configure the minimum Python version ansible-test uses

I don't see anything on that page pertaining to the mechanism to "configure the minimum Python version".

@mamercad
Copy link
Collaborator

Other than that, please make sure that you're running ansible-test sanity in CI to catch any future issues.

Currently, this collection has this.

@mamercad
Copy link
Collaborator

Yes, we do not require collections to support Python 2.x anymore. See https://docs.ansible.com/ansible-core/2.16/dev_guide/testing/sanity/compile.html for how to configure the minimum Python version ansible-test uses. Other than that, please make sure that you're running ansible-test sanity in CI to catch any future issues. Thanks!

Code which runs on targets (modules and module_utils) must support all control node supported Python versions, as well as the additional Python versions supported only on targets:

  • 3.8
  • 3.7
  • 3.6
  • 3.5
  • 2.7

Ah, I see ... Python 2.7 still supported on targets.

@mamercad
Copy link
Collaborator

mamercad commented Jan 23, 2024

If there's something else that needs to be done, please reopen with additional information. To close the loops, here's last week's sanity run for good measure.

@gotmax23
Copy link
Contributor Author

See

Ansible Collections can be configured to support a subset of the target-only Python versions.

at the bottom of the test's page in the documentation. You add a tests/config.yml file that sets a python_requires key for ansible-test.

@mamercad
Copy link
Collaborator

See

Ansible Collections can be configured to support a subset of the target-only Python versions.

at the bottom of the test's page in the documentation. You add a tests/config.yml file that sets a python_requires key for ansible-test.

Ah, thank you.

@mamercad
Copy link
Collaborator

I'm going to re-open to work on this.

@mamercad
Copy link
Collaborator

@gotmax23 thoughts on the PR?

@mamercad
Copy link
Collaborator

@gotmax23 thoughts on #349?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants