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

Re-enable and update integration tests for aws_ssm_parameter_store #1241

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Jun 19, 2022

SUMMARY
  • Fixes exception when description was updated within passing value.
  • Rewrite and enable integration tests for module
  • Add some return values

While the integration tests don't include coverage for the more complex options for aws_ssm_parameter_store these have never existed. Having something enabled gives future module developers something to build upon.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

aws_ssm_parameter_store

ADDITIONAL INFORMATION

Exception:

TASK [aws_ssm_parameter_store : Update description] ****************************
task path: /root/ansible_collections/community/aws/tests/output/.tmp/integration/aws_ssm_parameter_store-071mpr89-ÅÑŚÌβŁÈ/tests/integration/targets/aws_ssm_parameter_store/tasks/main.yml:64
Using module file /root/ansible_collections/community/aws/plugins/modules/aws_ssm_parameter_store.py
Pipelining is enabled.
<testhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /usr/bin/python3.10 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_aws_ssm_parameter_store_payload_13s3_ao3/ansible_aws_ssm_parameter_store_payload.zip/ansible_collections/community/aws/plugins/modules/aws_ssm_parameter_store.py", line 160, in update_parameter
  File "/usr/local/lib/python3.10/dist-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.10/dist-packages/botocore/client.py", line 648, in _make_api_call
    request_dict = self._convert_to_request_dict(
  File "/usr/local/lib/python3.10/dist-packages/botocore/client.py", line 696, in _convert_to_request_dict
    request_dict = self._serializer.serialize_to_request(
  File "/usr/local/lib/python3.10/dist-packages/botocore/validate.py", line 293, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Value, value: None, type: <class 'NoneType'>, valid types: <class 'str'>
fatal: [testhost]: FAILED! => {
    "boto3_version": "1.17.0",
    "botocore_version": "1.20.0",
    "changed": false,
    "invocation": {
        "module_args": {
            "aws_access_key": "ASIA6CCDWXDOM4BEFFL4",
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "debug_botocore_endpoint_logs": true,
            "decryption": true,
            "description": "This is an updated example",
            "ec2_url": null,
            "key_id": "alias/aws/ssm",
            "name": "/ansible-test-12184966-mchappel/Simple",
            "overwrite_value": "changed",
            "profile": null,
            "region": "us-east-1",
            "security_token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "state": "present",
            "string_type": "String",
            "tier": "Standard",
            "validate_certs": true,
            "value": null
        }
    },
    "msg": "setting parameter: Parameter validation failed:\nInvalid type for parameter Value, value: None, type: <class 'NoneType'>, valid types: <class 'str'>",
    "resource_actions": [
        "ssm:GetParameter"
    ]
}

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review integration tests/integration module module needs_triage plugins plugin (any type) tests tests labels Jun 19, 2022
@softwarefactory-project-zuul

This comment was marked as resolved.

@tremble tremble force-pushed the tests/enable/aws_ssm_parameter_store branch from 3eb77d3 to 298341d Compare June 19, 2022 17:40
@softwarefactory-project-zuul

This comment was marked as resolved.

@softwarefactory-project-zuul

This comment was marked as resolved.

@tremble tremble changed the title Re-enable and update integration tests for aws_ssm_parameter_store [WIP] Re-enable and update integration tests for aws_ssm_parameter_store Jun 20, 2022
@tremble
Copy link
Contributor Author

tremble commented Jun 20, 2022

Moving to WIP, something weird with idempotency when running in CI that I'm not hitting when I run it locally...

@ansibullbot ansibullbot added the WIP Work in progress label Jun 20, 2022
@alinabuzachis
Copy link
Contributor

2022-06-20 07:02:24.736910 \| controller \| TASK [aws_ssm_parameter_store : Lookup a single key] ***************************
--
2671 | 2022-06-20 07:02:24.737004 \| controller \| task path: /home/zuul/.ansible/collections/ansible_collections/community/aws/tests/integration/targets/aws_ssm_parameter_store/tasks/main.yml:166
2672 | 2022-06-20 07:02:24.887246 \| controller \| AWS_ssm name lookup term: ['/ansible-test-63611552-node-0002705301/Simple']
2673 | 2022-06-20 07:02:25.324840 \| controller \| AWS_ssm path lookup returning: ['A simple VALue']
2674 | 2022-06-20 07:02:25.368591 \| controller \| ok: [testhost] => {
2675 | 2022-06-20 07:02:25.368606 \| controller \|     "ansible_facts": {
2676 | 2022-06-20 07:02:25.368609 \| controller \|         "lookup_value": "A simple VALue"
2677 | 2022-06-20 07:02:25.368616 \| controller \|     },
2678 | 2022-06-20 07:02:25.368621 \| controller \|     "changed": false
2679 | 2022-06-20 07:02:25.368624 \| controller \| }
2680 | 2022-06-20 07:02:25.412051 \| controller \|
2681 | 2022-06-20 07:02:25.412075 \| controller \| TASK [aws_ssm_parameter_store : assert] ****************************************
2682 | 2022-06-20 07:02:25.412149 \| controller \| task path: /home/zuul/.ansible/collections/ansible_collections/community/aws/tests/integration/targets/aws_ssm_parameter_store/tasks/main.yml:169
2683 | 2022-06-20 07:02:25.473091 \| controller \| fatal: [testhost]: FAILED! => {
2684 | 2022-06-20 07:02:25.473135 \| controller \|     "assertion": "result is not changed",
2685 | 2022-06-20 07:02:25.473144 \| controller \|     "changed": false,
2686 | 2022-06-20 07:02:25.473151 \| controller \|     "evaluated_to": false,
2687 | 2022-06-20 07:02:25.473158 \| controller \|     "msg": "Assertion failed"
2688 | 2022-06-20 07:02:25.473164 \| controller \| }


@tremble
Copy link
Contributor Author

tremble commented Jun 20, 2022

Yup, that's why I bumped it back to WIP

@tremble tremble force-pushed the tests/enable/aws_ssm_parameter_store branch from 2dec678 to fc74182 Compare June 20, 2022 10:59
@github-actions
Copy link

github-actions bot commented Jun 20, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@softwarefactory-project-zuul

This comment was marked as resolved.

@tremble tremble force-pushed the tests/enable/aws_ssm_parameter_store branch from fc74182 to 4950fba Compare June 20, 2022 11:30
@tremble tremble changed the title [WIP] Re-enable and update integration tests for aws_ssm_parameter_store Re-enable and update integration tests for aws_ssm_parameter_store Jun 20, 2022
@softwarefactory-project-zuul

This comment was marked as resolved.

@ansibullbot ansibullbot removed the WIP Work in progress label Jun 20, 2022
@tremble tremble force-pushed the tests/enable/aws_ssm_parameter_store branch from 4950fba to be3c320 Compare June 20, 2022 12:21
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

ansible-galaxy-importer FAILURE in 4m 56s (non-voting)
✔️ build-ansible-collection SUCCESS in 4m 54s
✔️ ansible-test-sanity-docker-devel SUCCESS in 9m 42s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 46s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 11m 00s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 57s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 12s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 6m 32s
✔️ ansible-test-splitter SUCCESS in 2m 39s
✔️ integration-community.aws-1 SUCCESS in 5m 38s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@tremble tremble requested a review from alinabuzachis June 20, 2022 12:39
@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Jun 21, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

ansible-galaxy-importer FAILURE in 3m 50s (non-voting)
✔️ build-ansible-collection SUCCESS in 4m 58s
✔️ ansible-test-sanity-docker-devel SUCCESS in 9m 40s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 12m 09s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 11m 17s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 10m 31s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 48s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 6m 16s
✔️ ansible-test-splitter SUCCESS in 2m 26s
✔️ integration-community.aws-1 SUCCESS in 6m 14s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit c5034b2 into ansible-collections:main Jun 21, 2022
@tremble tremble deleted the tests/enable/aws_ssm_parameter_store branch July 7, 2022 19:26
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
…ections#1241)

ec2_security_group - fix bug in handling of `ports: -1`

SUMMARY
Before we defined a schema for rules YAML would guess that -1 was an integer.  With ports is explicitly defined as a string it was trying to handle -1 as a range, rather than an integer
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_security_group
ADDITIONAL INFORMATION

Reviewed-by: Gonéri Le Bouder <[email protected]>
Reviewed-by: Mark Chappell <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review integration tests/integration mergeit Merge the PR (SoftwareFactory) module module needs_triage plugins plugin (any type) python3 tests tests traceback
Development

Successfully merging this pull request may close these issues.

3 participants