aws-cloudformation / cloudformation-cli

The CloudFormation Provider Development Toolkit allows you to author your own resource providers and modules that can be used by CloudFormation.
Apache License 2.0
316 stars 158 forks source link

Improve logging output #947

Open ericzbeard opened 1 year ago

ericzbeard commented 1 year ago

Logging needs to be improved in a few ways.

  1. It would be nice if you didn't have to flip back and forth between the direct CLI output and the SAM output in the other terminal when running cfn test.
  2. When running cfn test in CodeBuild, the logs are difficult to read because they are designed for an interactive session. It's very hard to figure out which contract test failed, and why.
mmaeng commented 1 year ago

Also associated https://github.com/aws-cloudformation/cloudformation-cli/issues/948

mmaeng commented 1 year ago

This command may help to reduce the verbosity to STDOUT

cfn test -- -o log_cli=True -o log_cli_level=WARN -o console_output_style=count

The options after -- are passed along to pytest when it is running the contract tests. The -o are overrides for the pytest options defined in src/rpdk/core/data/pytest-contract.ini

Will work to further clarify logs and output