Skip to content
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

chore: Make snapshot test fail when snapshot is empty #310

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

lym953
Copy link
Contributor

@lym953 lym953 commented Oct 9, 2024

Motivation

The snapshot test doesn't fail when a generated snapshot is empty. As a result, empty snapshots can be added for new stacks as "correct" snapshots, making the test unable to capture unexpected changes.

For example, #309 fixed an empty snapshot.

What does this PR do?

Make the snapshot fail if a snapshot is empty.

Testing Guidelines

Steps:

  1. In the stack lambda-function-stack-legacy-datadog-api.ts, change the stack name to something random, e.g.:
const stack = new ExampleStack(app, "lambda-function-stack-legacy-datadog-api-2", { env: env });

so lambda-function-stack-legacy-datadog-api.template.json won't be generated and will be initialized as an empty file by the script.
2. Run aws-vault exec sso-serverless-sandbox-account-admin -- scripts/run_integration_tests.sh

Result: The test failed.
image

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

@lym953 lym953 requested a review from a team as a code owner October 9, 2024 22:20
@lym953 lym953 force-pushed the yiming.luo/python-stack-test-5 branch from 960203d to b091be6 Compare October 10, 2024 15:42
Base automatically changed from yiming.luo/python-stack-test-5 to main October 10, 2024 15:42
@lym953 lym953 force-pushed the yiming.luo/python-stack-test-6 branch from 023aa51 to 58c82a4 Compare October 10, 2024 15:43
@lym953 lym953 merged commit 18b9985 into main Oct 10, 2024
10 checks passed
@lym953 lym953 deleted the yiming.luo/python-stack-test-6 branch October 10, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants