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 #19

Closed
gotmax23 opened this issue Jan 22, 2024 · 4 comments
Closed

Community package requirements: sanity tests #19

gotmax23 opened this issue Jan 22, 2024 · 4 comments

Comments

@gotmax23
Copy link

(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.3.12 of infinidat.infinibox, corresponding to the v1.3.12 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

The test ansible-test sanity --test compile --python 2.7 [explain] failed with 1 error:

plugins/modules/infini_vol.py:524:155: SyntaxError: msg = f"An error has occurred handling volume_type '{module.params['volume_type']}' or write_protected '{module.params['write_protected']}' values"

The test ansible-test sanity --test compile --python 3.10 [explain] failed with 3 errors:

bin/check_collection_files.sh:3:8: SyntaxError: set -o nounset
bin/install_modules_for_hacking.sh:11:8: SyntaxError: set -o nounset
bin/test_summarize.sh:3:8: SyntaxError: set -o nounset

The test ansible-test sanity --test compile --python 3.11 [explain] failed with 3 errors:

bin/check_collection_files.sh:3:8: SyntaxError: set -o nounset
bin/install_modules_for_hacking.sh:11:8: SyntaxError: set -o nounset
bin/test_summarize.sh:3:8: SyntaxError: set -o nounset

The test ansible-test sanity --test compile --python 3.12 [explain] failed with 3 errors:

bin/check_collection_files.sh:3:8: SyntaxError: set -o nounset
bin/install_modules_for_hacking.sh:11:8: SyntaxError: set -o nounset
bin/test_summarize.sh:3:8: SyntaxError: set -o nounset

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

plugins/modules/infini_fs.py:0:0: doc-type-does-not-match-spec: Argument 'thin_provision' in argument_spec defines type as <class 'bool'> but documentation defines type as 'bool'
plugins/modules/infini_host.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, 'No module named 'infi''
plugins/modules/infini_map.py:0:0: doc-default-does-not-match-spec: Argument 'cluster' in argument_spec defines default as ('') but documentation defines default as (None)
plugins/modules/infini_map.py:0:0: doc-default-does-not-match-spec: Argument 'host' in argument_spec defines default as ('') but documentation defines default as (None)
plugins/modules/infini_map.py:0:0: doc-missing-type: Argument 'cluster' in argument_spec uses default type ('str') but documentation doesn't define type
plugins/modules/infini_map.py:0:0: doc-missing-type: Argument 'host' in argument_spec uses default type ('str') but documentation doesn't define type
plugins/modules/infini_map.py:0:0: doc-missing-type: Argument 'volume' in argument_spec uses default type ('str') but documentation doesn't define type
plugins/modules/infini_map.py:0:0: parameter-type-not-in-doc: Argument 'lun' in argument_spec defines type as <class 'int'> but documentation doesn't define type
plugins/modules/infini_network_space.py:0:0: doc-choices-do-not-match-spec: Argument 'service' in argument_spec defines choices as (['replication', 'NAS_SERVICE', 'ISCSI_SERVICE']) but documentation defines choices as (['replication', 'NAS', 'iSCSI'])
plugins/modules/infini_network_space.py:0:0: doc-default-does-not-match-spec: Argument 'interfaces' in argument_spec defines default as ([]) but documentation defines default as (None)
plugins/modules/infini_network_space.py:0:0: doc-default-does-not-match-spec: Argument 'network_config' in argument_spec defines default as ({}) but documentation defines default as (None)
plugins/modules/infini_network_space.py:0:0: doc-elements-mismatch: Argument 'interfaces' in argument_spec specifies elements as int,but elements is documented as being str
plugins/modules/infini_network_space.py:0:0: doc-missing-type: Argument 'default_gateway' in argument_spec uses default type ('str') but documentation doesn't define type
plugins/modules/infini_network_space.py:0:0: doc-missing-type: Argument 'name' in argument_spec uses default type ('str') but documentation doesn't define type
plugins/modules/infini_network_space.py:0:0: doc-missing-type: Argument 'service' in argument_spec uses default type ('str') but documentation doesn't define type
plugins/modules/infini_network_space.py:0:0: doc-missing-type: Argument 'state' in argument_spec uses default type ('str') but documentation doesn't define type
plugins/modules/infini_network_space.py:0:0: doc-type-does-not-match-spec: Argument 'mtu' in argument_spec defines type as <class 'int'> but documentation defines type as 'int'
plugins/modules/infini_network_space.py:0:0: doc-type-does-not-match-spec: Argument 'netmask' in argument_spec defines type as <class 'int'> but documentation defines type as 'int'
plugins/modules/infini_network_space.py:0:0: doc-type-does-not-match-spec: Argument 'rate_limit' in argument_spec defines type as <class 'int'> but documentation defines type as 'int'
plugins/modules/infini_network_space.py:0:0: parameter-type-not-in-doc: Argument 'network_config' in argument_spec defines type as <class 'dict'> but documentation doesn't define type
plugins/modules/infini_network_space.py:0:0: undocumented-parameter: Argument 'default_gateway' is listed in the argument_spec, but not documented in the module documentation
plugins/modules/infini_network_space.py:0:0: undocumented-parameter: Argument 'network_config' is listed in the argument_spec, but not documented in the module documentation
plugins/modules/infini_port.py:0:0: parameter-type-not-in-doc: Argument 'host' in argument_spec defines type as <class 'str'> but documentation doesn't define type
plugins/modules/infini_vol.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, 'cannot import name 'ObjectNotFound' from 'ansible_collections.infinidat.infinibox.plugins.module_utils.infinibox' (/root/ansible_collections/infinidat/infinibox/plugins/module_utils/infinibox.py)'
@sqqqrly
Copy link
Collaborator

sqqqrly commented Feb 7, 2024

Working on this. When I ran sanity, Ansible was silently skipping the tests.

Silently skipping:

╭─stack@psus-rhel85 ~/workspace/ansible_collections/infinidat/infinibox  ‹develop*›
╰─➤  ansible-test sanity --requirements requirements.txt --test validate-modules                                                                                  <--normal
Running sanity test "validate-modules"

Adding verbosity:

╭─stack@psus-rhel85 ~/workspace/ansible_collections/infinidat/infinibox  ‹develop*›
╰─➤  ansible-test sanity --requirements requirements.txt --test validate-modules -vvv
Configured locale: en_US.UTF-8
RLIMIT_NOFILE: (1024, 262144)
Creating container database.
>>> Container Database
{}
Read 0 sanity test ignore line(s) for Ansible 2.16 from: tests/sanity/ignore-2.16.txt
Running sanity test "validate-modules"
No tests applicable.

@sqqqrly
Copy link
Collaborator

sqqqrly commented Feb 13, 2024

Added tests/config.yml to project:

modules:
  python_requires: ">=3.6"

@sqqqrly
Copy link
Collaborator

sqqqrly commented Feb 13, 2024

Sanity passes.
Used python:

$  python --version
Python 3.11.5

@sqqqrly
Copy link
Collaborator

sqqqrly commented Feb 13, 2024

The shell scripts previously flagged as not passing compile tests have been moved from bin/ to scripts/ and should be ignored.

@sqqqrly sqqqrly closed this as completed Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants