aws-cloudformation / community-registry-extensions

MIT No Attribution
85 stars 27 forks source link

Declare TypeConfigurationModel as nullable. #239

Closed mrinaudo-aws closed 9 months ago

mrinaudo-aws commented 9 months ago

Issue #, if available:

Description of changes: Declare TypeConfigurationModel as nullable: useful when running contract tests without a ~/.cfn-cli/typeConfiguration.json file. I ran contract tests (see excerpts below) without the ~/.cfn-cli/typeConfiguration.json file on my workstation this time, to verify this specific use case.

Unit tests excerpts

[INFO] Running com.awscommunity.s3.accesscontrol.PreUpdateHookHandlerTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.844 s -- in com.awscommunity.s3.accesscontrol.PreUpdateHookHandlerTest
[INFO] Running com.awscommunity.s3.accesscontrol.PreCreateHookHandlerTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.023 s -- in com.awscommunity.s3.accesscontrol.PreCreateHookHandlerTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0
[...]
[INFO] --- jacoco:0.8.10:check (jacoco-check) @ awscommunity-s3-accesscontrol-handler ---
[...]
[INFO] Analyzed bundle 'awscommunity-s3-accesscontrol-handler' with 5 classes
[INFO] All coverage checks have been met.

Contract tests excerpts

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 (No wildcard hook targets. ...) [ 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 (No wildcard hook targets. ...) [ 85%]
[...]/resource/handler_misc.py::contract_check_asserts_work PASSED                                                      [100%]
[...]
5 passed, 2 skipped, 17 deselected [...]

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