8000 Validate SQS dev endpoints by giograno · Pull Request #11620 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

Validate SQS dev endpoints #11620

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 5 commits into from
Oct 17, 2024
Merged

Validate SQS dev endpoints #11620

merged 5 commits into from
Oct 17, 2024

Conversation

giograno
Copy link
Member
@giograno giograno commented Oct 1, 2024

Motivation

As we introduced specs for the developer endpoints, we want to make sure they match the actual implementation.
For this purpose, we can activate request and response verification in our handler chain and test our endpoint against the OpenAPI spec.

This PR activates the validation for the SQS dev endpoints.

Changes

  • Enable the validation for the TestSqsDeveloperEndpoints suite;
  • Minor changes to the spec to let the suite pass;

🔈 I'd ask the service owners to check if this PR is already comprehensive and eventually, if not, please help me fill all possible gaps.

@giograno giograno added the semver: patch Non-breaking changes which can be included in patch releases label Oct 1, 2024
@giograno giograno added this to the Playground milestone Oct 1, 2024
Copy link
github-actions bot commented Oct 2, 2024

LocalStack Community integration with Pro

    2 files  ± 0      2 suites  ±0   1h 41m 40s ⏱️ -1s
3 508 tests +15  3 095 ✅ +16  413 💤  - 1  0 ❌ ±0 
3 510 runs  +15  3 095 ✅ +16  415 💤  - 1  0 ❌ ±0 

Results for commit 58a17f9. ± Comparison against base commit 601d5b6.

This pull request removes 1 and adds 16 tests. Note that renamed tests count towards both.
tests.aws.services.apigateway.test_apigateway_extended ‑ test_get_api_keys
tests.aws.services.apigateway.test_apigateway_custom_ids ‑ test_apigateway_custom_ids
tests.aws.services.apigateway.test_apigateway_extended.TestApigatewayApiKeysCrud ‑ test_get_api_keys
tests.aws.services.apigateway.test_apigateway_extended.TestApigatewayApiKeysCrud ‑ test_get_usage_plan_api_keys
tests.aws.services.cloudformation.api.test_stacks.TestStacksApi ‑ test_create_stack_with_custom_id
tests.aws.services.lambda_.event_source_mapping.test_lambda_integration_kinesis.TestKinesisSource ‑ test_kinesis_empty_provided
tests.aws.services.lambda_.event_source_mapping.test_lambda_integration_kinesis.TestKinesisSource ‑ test_kinesis_report_batch_item_success_scenarios[empty_string_success]
tests.aws.services.secretsmanager.test_secretsmanager.TestSecretsManager ‑ test_create_secret_with_custom_id
tests.aws.services.secretsmanager.test_secretsmanager.TestSecretsManager ‑ test_force_delete_deleted_secret
tests.aws.services.stepfunctions.v2.test_sfn_api_validation.TestSfnApiValidation ‑ test_validate_state_machine_definition_not_a_definition[EMPTY_DICT]
tests.aws.services.stepfunctions.v2.test_sfn_api_validation.TestSfnApiValidation ‑ test_validate_state_machine_definition_not_a_definition[EMPTY_STRING]
…

♻️ This comment has been updated with latest results.

@giograno giograno added the aws:sqs Amazon Simple Queue Service label Oct 2, 2024
@giograno giograno marked this pull request as ready for review October 2, 2024 19:53
Copy link
Member
@thrau thrau left a comment

Choose a reason for hiding this comment

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

i have a question about this: since this endpoint is compatible with the query protocol that SQS uses, the schema doesn't really cover that. a strict validation would therefore probably break this endpoint, right? or is the schema only validated if the content type is application/json?

@giograno
Copy link
Member Author

Thanks for the comment @thrau! I am not a SQS expert so please confirm the following.

I noticed in our tests that we can use the dev endpoint as boto client URL (only for ReceiveMessage). That results in a POST call to _aws/sqs/message. We missed this part in our spec (we only had the GET operations). Our validation, however, was not failing since we let OperationNotFound errors slip through.

I added the POST operation for _aws/sqs/message with both the x-www-form-urlencoded and json options.

@giograno giograno requested a review from thrau October 14, 2024 12:51
A correct version will be set at runtime when serving the spec via the endpoint
Copy link
Member
@thrau thrau left a comment

Choose a reason for hiding this comment

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

cool! if all tests pass then :shipit:

@thrau thrau merged commit 56f6a78 into master Oct 17, 2024
34 checks passed
@thrau thrau deleted the oas-sqs branch October 17, 2024 17:28
macnev2013 pushed a commit that referenced this pull request Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants
0