ansible-collections / kubernetes.core

The collection includes a variety of Ansible content to help automate the management of applications in Kubernetes and OpenShift clusters, as well as the provisioning and maintenance of clusters themselves.
Other
214 stars 133 forks source link

Community package requirements: sanity tests #672

Open gotmax23 opened 8 months ago

gotmax23 commented 8 months ago

(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 2.4.0 of kubernetes.core, corresponding to the 2.4.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:

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 validate-modules [explain] failed with 25 errors:

plugins/modules/helm_info.py:0:0: doc-default-does-not-match-spec: Argument 'release_state' in argument_spec defines default as ([]) but documentation defines default as (None)
plugins/modules/helm_template.py:0:0: doc-default-does-not-match-spec: Argument 'show_only' in argument_spec defines default as ([]) but documentation defines default as (None)
plugins/modules/k8s.py:0:0: parameter-type-not-in-doc: Argument 'resource_definition' in argument_spec defines type as <function list_dict_str at 0x7f25ee49c180> but documentation doesn't define type
plugins/modules/k8s.py:0:0: return-syntax-error: RETURN.result.contains.error.contains: required key not provided @ data['result']['contains']['error']['contains']. Got None
plugins/modules/k8s.py:0:0: return-syntax-error: RETURN.result.contains.metadata.contains: required key not provided @ data['result']['contains']['metadata']['contains']. Got None
plugins/modules/k8s.py:0:0: return-syntax-error: RETURN.result.contains.spec.contains: required key not provided @ data['result']['contains']['spec']['contains']. Got None
plugins/modules/k8s.py:0:0: return-syntax-error: RETURN.result.contains.status.contains: required key not provided @ data['result']['contains']['status']['contains']. Got None
plugins/modules/k8s_drain.py:0:0: doc-default-does-not-match-spec: Argument 'delete_options' in argument_spec defines default as ({}) but documentation defines default as (None)
plugins/modules/k8s_info.py:0:0: doc-default-does-not-match-spec: Argument 'field_selectors' in argument_spec defines default as ([]) but documentation defines default as (None)
plugins/modules/k8s_info.py:0:0: doc-default-does-not-match-spec: Argument 'label_selectors' in argument_spec defines default as ([]) but documentation defines default as (None)
plugins/modules/k8s_log.py:0:0: doc-default-does-not-match-spec: Argument 'label_selectors' in argument_spec defines default as ([]) but documentation defines default as (None)
plugins/modules/k8s_rollback.py:0:0: doc-default-does-not-match-spec: Argument 'field_selectors' in argument_spec defines default as ([]) but documentation defines default as (None)
plugins/modules/k8s_rollback.py:0:0: doc-default-does-not-match-spec: Argument 'label_selectors' in argument_spec defines default as ([]) but documentation defines default as (None)
plugins/modules/k8s_scale.py:0:0: doc-default-does-not-match-spec: Argument 'label_selectors' in argument_spec defines default as ([]) but documentation defines default as (None)
plugins/modules/k8s_scale.py:0:0: parameter-type-not-in-doc: Argument 'resource_definition' in argument_spec defines type as <function list_dict_str at 0x7f25ee49c180> but documentation doesn't define type
plugins/modules/k8s_scale.py:0:0: return-syntax-error: RETURN.result.contains.metadata.contains: required key not provided @ data['result']['contains']['metadata']['contains']. Got None
plugins/modules/k8s_scale.py:0:0: return-syntax-error: RETURN.result.contains.spec.contains: required key not provided @ data['result']['contains']['spec']['contains']. Got None
plugins/modules/k8s_scale.py:0:0: return-syntax-error: RETURN.result.contains.status.contains: required key not provided @ data['result']['contains']['status']['contains']. Got None
plugins/modules/k8s_service.py:0:0: parameter-type-not-in-doc: Argument 'resource_definition' in argument_spec defines type as <function list_dict_str at 0x7f25ee49c180> but documentation doesn't define type
plugins/modules/k8s_service.py:0:0: return-syntax-error: RETURN.result.contains.metadata.contains: required key not provided @ data['result']['contains']['metadata']['contains']. Got None
plugins/modules/k8s_service.py:0:0: return-syntax-error: RETURN.result.contains.spec.contains: required key not provided @ data['result']['contains']['spec']['contains']. Got None
plugins/modules/k8s_service.py:0:0: return-syntax-error: RETURN.result.contains.status.contains: required key not provided @ data['result']['contains']['status']['contains']. Got None
plugins/modules/k8s_taint.py:0:0: return-syntax-error: RETURN.result.contains.metadata.contains: required key not provided @ data['result']['contains']['metadata']['contains']. Got None
plugins/modules/k8s_taint.py:0:0: return-syntax-error: RETURN.result.contains.spec.contains: required key not provided @ data['result']['contains']['spec']['contains']. Got None
plugins/modules/k8s_taint.py:0:0: return-syntax-error: RETURN.result.contains.status.contains: required key not provided @ data['result']['contains']['status']['contains']. Got None

The test ansible-test sanity --test yamllint [explain] failed with 9 errors:

tests/integration/targets/helm/files/appversionless-chart-v2/templates/configmap.yaml:6:13: unparsable-with-libyaml: while constructing a mapping - found unhashable key
tests/integration/targets/helm/files/appversionless-chart/templates/configmap.yaml:6:13: unparsable-with-libyaml: while constructing a mapping - found unhashable key
tests/integration/targets/helm/files/test-chart-v2/templates/configmap.yaml:6:13: unparsable-with-libyaml: while constructing a mapping - found unhashable key
tests/integration/targets/helm/files/test-chart/templates/configmap.yaml:6:13: unparsable-with-libyaml: while constructing a mapping - found unhashable key
tests/integration/targets/helm_diff/files/test-chart/templates/configmap.yaml:6:13: unparsable-with-libyaml: while constructing a mapping - found unhashable key
tests/integration/targets/k8s_scale/files/deployment.yaml:26:1: unparsable-with-libyaml: expected a single document in the stream - but found another document
tests/unit/module_utils/fixtures/definitions.yml:6:1: unparsable-with-libyaml: expected a single document in the stream - but found another document
tests/unit/module_utils/fixtures/deployments.yml:25:1: unparsable-with-libyaml: expected a single document in the stream - but found another document
tests/unit/module_utils/fixtures/pods.yml:18:1: unparsable-with-libyaml: expected a single document in the stream - but found another document
gotmax23 commented 1 month ago

Thanks for quickly fixing the issues! We have rerun tests for this collection against the latest version of ansible and found that tests/sanity/ignore-2.17.txt contain ignores that are forbidden by the CI testing requirements. See https://github.com/ansible-community/package-test-results/blob/main/rendered/10.3.0/kubernetes.core.md#invalid-test-ignores for a list. Other than that, this looks good to go. Thanks again for your work on kubernetes.core.