-
Notifications
You must be signed in to change notification settings - Fork 157
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
Unclear about usage of cfn test
with hooks
#868
Comments
Hooks auto generates templete.yml for your local lambda to work. This file exists at project root. For example, if you run cfn init within ~/myhook, you will find that file in that directory. You need to run sam local start-lambda from that location. Please refer to Hooks Workshop documentation for detailed step by step instructions on testing your contract tests for Hooks locally. https://catalog.us-east-1.prod.workshops.aws/workshops/f09fd78b-ef8a-4a9d-9d2b-f31a3e6ca956/en-US/java/contracttesting |
Hey @jtaylor100. We are working on answering and cleaning up questions. If this is still an unanswered question for you, please feel free to reopen this issue so we can investigate it further. You can also ask questions in our AWS CloudFormation Discord channel for a more prompt response. |
I noticed that with #861 there were some test changes included for using
cfn test
with hooks.See especially https://github.com/aws-cloudformation/cloudformation-cli/pull/861/files#diff-5a3cc3352be9423f5244d82f1ea97434ab5e7621366e2a589b0165b661c082aeR242
When trying to test on a hooks project generated by
cfn init
, as described on Testing resources types I findsam lambda start-local
fails due to no template file being included. Without this command succeeding,cfn test
contract tests fail with:The contract tests that failed raised this exception:
I tried generating an empty template, just to check if having
sam local start-lambda
successfully running was enough, butcfn test
raised this exception instead with the same test failures:It looks like
cfn test
is expecting a template to be included in the project that contains a definition forTypeFunction
, but this is not included when generating a hooks project withcfn init
.Where am I going wrong in trying to use
cfn test
with my generated hooks project? There does not seem to be any docs written on this.Does it involve writing a
~/.cfn-cli/typeConfigiration.json
file as mentioned in the README.md? Are there also docs about the format of this file anywhere too or an example?The text was updated successfully, but these errors were encountered: