/opt/homebrew/Cellar/cloudformation-cli/0.2.35_1/libexec/lib/python3.12/site-packages/rpdk/core/contract/resource_client.py:498: in compare_model
raise AssertionError(assertion_error_message) from exception
E AssertionError: All properties specified in the request MUST be present in the model returned, and they MUST match exactly, with the exception of properties defined as writeOnlyProperties in the resource schema
E Request Model : {'Profile': 'default', 'ProjectId': '65251446ae5f3f6ec7968b13', 'ClusterName': 'Cluster0', 'Specs': [{'InstanceSize': 'S30_HIGHCPU_NVME', 'NodeCount': 3}]}
E Returned Model : {'Profile': 'default', 'ClusterName': 'Cluster0', 'ProjectId': '65251446ae5f3f6ec7968b13', 'Specs': [{'InstanceSize': 'S30_HIGHCPU_NVME', 'NodeCount': '3'}]}
E , inputs: {"Profile": "default", "ProjectId": "65251446ae5f3f6ec7968b13", "ClusterName": "Cluster0", "Specs": [{"InstanceSize": "S30_HIGHCPU_NVME", "NodeCount": 3}]}, outputs: {"Profile": "default", "ClusterName": "Cluster0", "ProjectId": "65251446ae5f3f6ec7968b13", "Specs": [{"InstanceSize": "S30_HIGHCPU_NVME", "NodeCount": "3"}]}
As a workaround, if the input file defines the integer property as a string the compare logic does not fail and contract tests are successful:
Command being run
cfn test --function-name TestEntrypoint --verbose
Version
cfn 0.2.35
Resource type schema
Contract test input file
Unexpected error output
As a workaround, if the input file defines the integer property as a string the compare logic does not fail and contract tests are successful: