Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refresh sqs snapshots and fix exceptions in serializer #9627

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

Merged
merged 7 commits into from
Nov 14, 2023

Conversation

bentsku
Copy link
Contributor

@bentsku bentsku commented Nov 14, 2023

Motivation

Following botocore update regarding exception handling of SQS (introduced in boto/botocore#3054, released with 1.31.85), we needed to refresh snapshots for the newly added field.
It put into light some changes regarding error codes, so I've adapted the exceptions raised and their mapping in the serializer.
It also showed that the error message is different for QueueDoesNotExist depending on query or json protocol, put into light with a new snapshot test.

Changes

  • refresh all SQS snapshots
  • modify the exception classes to match their new names
  • add those new exceptions to the map for their old names (different between Error and QueryErrorCode)
  • added some snapshot tests to validate behavior
  • added a quick fix in the provider to have a different message depending on the service name. Might need to think of a better handling of this, but historically error message were the responsibility of providers, not serializer.
  • reverted the change in the CloudFormation models regarding using the boto client exceptions.
  • edit: I forgot, but I also fixed the marker detection for only_localstack so that we don't run those tests against AWS. I believe one nice step also would be to not create a snapshot entry in the json file if the test does not have the snapshot fixture, I'm sure we could detect that? @dominikschubert
  • update the call to connect_to in the query API to use sqs_query client

@bentsku bentsku added aws:sqs Amazon Simple Queue Service area: asf semver: patch Non-breaking changes which can be included in patch releases labels Nov 14, 2023
@bentsku bentsku self-assigned this Nov 14, 2023
Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks for tackling this! Hopefully this is the last iteration related to #8268 and #8267, and associated with the recent changes in botocore! 🦸🏽 🧹

@localstack localstack deleted a comment from bentsku Nov 14, 2023
@dominikschubert
Copy link
Member

I believe one nice step also would be to not create a snapshot entry in the json file if the test does not have the snapshot fixture, I'm sure we could detect that?

@bentsku
Sure but it's a bit hacky and potentially confusing since technically those tests do actually use the snapshot fixture (because of the autouse). What you could do is split them into classes and only autoimport in the non-"only_localstack" classes. 🤔

@dominikschubert dominikschubert added this to the 3.0 milestone Nov 14, 2023
@bentsku
Copy link
Contributor Author

bentsku commented Nov 14, 2023

@dominikschubert good point, I didn't think about the auto-use, it makes a lot of sense! Or maybe something at the "save" time, if there are no keys and the dict is empty, we could maybe not create an entry in the file? That might be simpler. Let's see after v3, this is extremely minor 😄 thanks for the response!

@coveralls
Copy link

Coverage Status

coverage: 84.017% (-0.003%) from 84.02%
when pulling 74025ab on refresh-sqs-snapshots
into 218e855 on master.

Copy link

LocalStack Community integration with Pro

       2 files  ±0         2 suites  ±0   1h 10m 26s ⏱️ + 6m 41s
2 313 tests +1  2 014 ✔️ +1  299 💤 ±0  0 ±0 
2 314 runs  +1  2 014 ✔️ +1  300 💤 ±0  0 ±0 

Results for commit 74025ab. ± Comparison against base commit 218e855.

@bentsku bentsku merged commit dce1d91 into master Nov 14, 2023
@bentsku bentsku deleted the refresh-sqs-snapshots branch November 14, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: asf aws:sqs Amazon Simple Queue Service semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants