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: Add integration test for Python stack #307

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

lym953
Copy link
Contributor

@lym953 lym953 commented Oct 9, 2024

What does this PR do?

Add a Python stack to integration tests, so that the test will compare the snapshots generated after vs before, to check if a PR causes unexpected changes on the stack to be deployed.

The stack was copied from examples/python-stack. I had to copy it because I was unable to find a way to just reference the existing stack.

Motivation

Adding more tests to make it safer to deploy changes.

Testing Guidelines

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 16:08
@lym953 lym953 changed the title chore: Add integration test for Python chore: Add integration test for Python stack Oct 9, 2024
Comment on lines +82 to +84
' dotnet tool install -g Amazon.Lambda.Tools' +
' && dotnet build' +
' && dotnet lambda package --output-package /asset-output/function.zip'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Code Quality Violation

use f-string or .format to format strings (...read more)

Concatenation of multiple strings is not efficient and make the code hard to read and understand.

Instead of concatenating multiple strings, use an f-string or a format string.

Learn More

View in Datadog  Leave us feedback  Documentation

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file suppose to be empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file suppose to be empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, tests are failing. Let me normalize DD_TAGS in the json.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@lym953 lym953 force-pushed the yiming.luo/python-stack-test-3 branch 3 times, most recently from 35b6f5e to 6557fe3 Compare October 9, 2024 20:54
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it seem weird to you that these integration_tests/snapshots/test-* files are committed to git? Seems like they're overwritten by the test runner anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'm already working on that. Coming soon in the next PR!

Copy link
Contributor

@purple4reina purple4reina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still an integration test failure, but other than that this looks great!

@lym953 lym953 force-pushed the yiming.luo/python-stack-test-3 branch from 6557fe3 to 2f9c536 Compare October 9, 2024 21:18
@lym953 lym953 merged commit a8891ee into main Oct 10, 2024
10 checks passed
@lym953 lym953 deleted the yiming.luo/python-stack-test-3 branch October 10, 2024 15:40
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