aws-cloudformation / aws-cloudformation-samples

Apache License 2.0
134 stars 55 forks source link

Additional strategy choice: resource- and stack-level tag key/values … #64

Closed mrinaudo-aws closed 1 year ago

mrinaudo-aws commented 1 year ago

…validation.

Issue #, if available:

62

Description of changes: Additional strategy choice: resource- and stack-level tag key/values validation.

Unit tests excerpts

[...] test session starts [...]
plugins: hypothesis-6.57.1, random-order-1.0.4, typeguard-2.13.3, cov-4.0.0, localserver-0.7.0
collected 87 items                                                                                                         

src/awssamples_resourcetags_hook/tests/test_handlers.py ............................................................ [ 68%]
...........................                                                                                          [100%]

[...] warnings summary [...]
[...]site-packages/botocore/utils.py:15: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    import cgi
[...]
[...] coverage [...]
Name                                           Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------------------------
src/awssamples_resourcetags_hook/handlers.py     317      0    170      0   100%
------------------------------------------------------------------------------------------
TOTAL                                            317      0    170      0   100%

Required test coverage of 85.0% reached. Total coverage: 100.00%
[...] 87 passed, 1 warning in 1.28s [...]

Contract tests excerpts

Starting Docker build. This may take several minutes if the image 'public.ecr.aws/lambda/python:3.7' needs to be pulled first.
[...]
[...] test session starts [...]
plugins: hypothesis-6.57.1, random-order-1.0.4, typeguard-2.13.3, cov-4.0.0, localserver-0.7.0
collected 24 items / 17 deselected / 7 selected                                                                            

[...] hook/handler_pre_create.py::contract_pre_create_success PASSED [ 14%]
[...] hook/handler_pre_create.py::contract_pre_create_failed PASSED [ 28%]
[...] hook/handler_pre_create.py::contract_pre_create_failed_unsupported_target SKIPPED [ 42%]
[...] hook/handler_pre_update.py::contract_pre_update_success PASSED [ 57%]
[...] hook/handler_pre_update.py::contract_pre_update_failed PASSED [ 71%]
[...] hook/handler_pre_update.py::contract_pre_update_failed_unsupported_target SKIPPED [ 85%]
[...] resource/handler_misc.py::contract_check_asserts_work PASSED [100%]

[...] 5 passed, 2 skipped, 17 deselected in 8212.76s (2:16:52) [...]

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.