-
Notifications
You must be signed in to change notification settings - Fork 397
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
aws_acm - check mode #477
aws_acm - check mode #477
Conversation
9a5b9d8
to
32baad6
Compare
32baad6
to
6d92748
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"msg": "The conditional check '(list_tag.certificates | length) == 0' failed. The error was: error while evaluating conditional ((list_tag.certificates | length) == 0): 'dict object' has no attribute 'certificates'"
Looks like the tests need a tweak
I cannot figure out how to fix the failing tests, because I cannot figure out how to run integration tests locally. The only documentation I found was for community.general. When I ran the tests like that it told me I needed to specify my AWS credentials in a config file. I did that, but this error won't go away. How do I resolve this?
|
Two changes needed:
I use the following (credentials redacted):
|
The README.md for this collection also includes some resources around getting the environment setup: @jillr's blog post: https://www.ansible.com/blog/getting-started-with-aws-ansible-module-development includes a walk through. |
Ah I see. There's a bug in |
My integration tests are failing locally with a different error to CI. It seems the Why do I get a different error locally vs in CI? If I'm running tests in docker, shouldn't the dependencies be the same?
|
Some of the tests need additional modules (including the acm tests) the quickest way is to clone the community.crypto repo next to the community.aws repo. There are some extra wrappers in the main CI account which ensure the dependencies are pulled in from galaxy: https://github.com/ansible-collections/community.aws/blob/main/tests/requirements.yml these haven't been built into ansible-test yet. |
Ok, now I'm getting this error:
When running from Note that @jillr 's blog post contains instructions which don't work for me. The instructions say:
So I tried with:
which gives:
|
That looks like it failed to find the amazon.aws collection. (community.aws depends on amazon.aws) |
Isn't |
It is, however the "module_utils" code that it relies on (the core.py and AnsibleAwsModule it referred to) lives in amazon.aws |
@mdavis-xyz Thanks for working on this, I'm sorry it's been a bit of a battle to get the test-suite up and running. The test failures look like they were flakes, re-running them they pass, and the tests are still flagged as 'unstable'. We've seen some APIs return inconsistent results and I suspect that's what we saw here. |
I actually had a few bug fixes I hadn't pushed yet. I think the module itself is fine, but there were bugs in the test. (e.g. I actually ended up testing check mode in aws_acm_info, which doesn't seem to work as expected.) And the rest can be fixed with retry backoff logic. Should I open another pull request once I've got them working? |
More bug fixes would always be appreciated. Since this PR has been merged,
yes a new PR would be the best bet.
Thanks for your contribution,
Mark
|
* add integration tests for acm with check mode * add check mode to acm module
* add integration tests for acm with check mode * add check mode to acm module
* add integration tests for acm with check mode * add check mode to acm module
* add integration tests for acm with check mode * add check mode to acm module
…-collections#601) ec2_vpc_route_table: Add IPv6 support in ec2_vpc_route_table SUMMARY Allow usage of IPv6 CIDR in ec2_vpc_route_table for creating routes. Fixes ansible-collections#477 ISSUE TYPE Feature Pull Request COMPONENT NAME ec2_vpc_route_table Reviewed-by: Jill R <None> Reviewed-by: None <None>
SUMMARY
Fixes #451
ISSUE TYPE
COMPONENT NAME
aws_acm
ADDITIONAL INFORMATION
I've hard-coded the domain and ARN to return for some check_mode tasks.
I don't know if I need to bother dynamically extracting the domain from the local cert file.
I also don't know if ARNs are predictable for ACM certs.
I have not tried running these integration tests locally because the tests won't run.
ansible-test
tells me I need to configure stuff. I did, butansible-test
still won't run.So I'm just hoping that the CI bots can run the tests for me.