Skip to content

Conversation

@ArthurAkh
Copy link
Contributor

Motivation

We expand coverage for API Keys and Usage Plans.

Changes

  • Add tests for:
    • get_api_keys / get_usage_plan_keys nameQuery (prefix/postfix/infix, case-insensitive) and pagination (limit + position)
    • API Key edge cases (name/value/description lengths, patch validation for immutable fields and enabled type)
    • E2E: create API Key → create Usage Plan → link via UsagePlanKey → list & query keys
  • Snapshot updates

@ArthurAkh ArthurAkh added this to the 4.9 milestone Sep 26, 2025
@ArthurAkh ArthurAkh self-assigned this Sep 26, 2025
@ArthurAkh ArthurAkh added semver: patch Non-breaking changes which can be included in patch releases docs: skip Pull request does not require documentation changes labels Sep 26, 2025
@github-actions
Copy link

github-actions bot commented Sep 26, 2025

LocalStack Community integration with Pro

    2 files  ±    0      2 suites  ±0   17m 50s ⏱️ - 1h 43m 38s
1 170 tests  - 3 701  1 102 ✅  - 3 414  68 💤  - 287  0 ❌ ±0 
1 172 runs   - 3 701  1 102 ✅  - 3 414  70 💤  - 287  0 ❌ ±0 

Results for commit f5684ac. ± Comparison against base commit 1913637.

This pull request removes 3708 and adds 7 tests. Note that renamed tests count towards both.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…
tests.aws.services.apigateway.test_apigateway_extended.TestApigatewayApiKeysCrud ‑ test_create_api_key_with_invalid_name
tests.aws.services.apigateway.test_apigateway_extended.TestApigatewayApiKeysCrud ‑ test_create_api_key_with_invalid_value
tests.aws.services.apigateway.test_apigateway_extended.TestApigatewayApiKeysCrud ‑ test_create_usage_plan_with_throttle
tests.aws.services.apigateway.test_apigateway_extended.TestApigatewayApiKeysCrud ‑ test_negative_get_usage_plan_api_keys
tests.aws.services.apigateway.test_apigateway_extended.TestApigatewayApiKeysCrud ‑ test_update_api_key_immutable_field
tests.aws.services.apigateway.test_apigateway_extended.TestApigatewayApiKeysCrud ‑ test_update_api_key_invalid_description_length
tests.aws.services.apigateway.test_apigateway_extended.TestApigatewayApiKeysCrud ‑ test_update_api_key_invalid_enabled_type

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Sep 26, 2025

Test Results - Preflight, Unit

22 337 tests  ±0   20 587 ✅ ±0   15m 54s ⏱️ +22s
     1 suites ±0    1 750 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit f5684ac. ± Comparison against base commit 1913637.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Sep 26, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 23s ⏱️ -2s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit f5684ac. ± Comparison against base commit 1913637.

♻️ This comment has been updated with latest results.

@ArthurAkh ArthurAkh added the notes: skip Pull request does not have to be mentioned in the release notes label Sep 26, 2025
@github-actions
Copy link

github-actions bot commented Sep 26, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files      5 suites   34m 19s ⏱️
1 194 tests 1 127 ✅ 67 💤 0 ❌
1 200 runs  1 127 ✅ 73 💤 0 ❌

Results for commit f5684ac.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@bentsku bentsku left a comment

Choose a reason for hiding this comment

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

Nice work! Great added validation 🚀

Just 2 comments: one test name looks like it should fail, so maybe this should be updated. The other one is the PR description mentioning pagination, I think we could remove it from the scope of this PR 👍

Once this is addressed, we're good to merge! 👌


create_api_key_2 = apigw_create_api_key(name=api_key_name_2)
snapshot.match("create-api-key-2", create_api_key)
snapshot.match("create-api-key-2", create_api_key_2)
Copy link
Contributor

Choose a reason for hiding this comment

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

great catch 🚀

Comment on lines +2405 to +2407
if limit is not None:
if limit < 1 or limit > 500:
limit = None
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think the PR description mentions pagination, but there are no tests for it, so I'd suggest to just drop this new code and merge it like that, the newly added validation is already really good 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

there was actually a test for the -1 value 👍 added it back

@alexrashed alexrashed modified the milestones: 4.9, 4.10 Sep 30, 2025
@bentsku bentsku force-pushed the apigw-api-key-and-usage-plan-tests branch from a665549 to 0b56bda Compare October 16, 2025 14:53
@bentsku bentsku marked this pull request as ready for review October 16, 2025 16:09
@bentsku bentsku requested a review from cloutierMat as a code owner October 16, 2025 16:09
Copy link
Contributor

@bentsku bentsku left a comment

Choose a reason for hiding this comment

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

LGTM, I've resolved my comments, renamed the test only and this is now good to merge 👍
I'll run a Pro pipeline just to be sure because we are un-validated tests there, but should be safe

Copy link
Member

@cloutierMat cloutierMat 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 the extra validation and added tests! 💪

@bentsku bentsku merged commit aa2a278 into main Oct 17, 2025
39 checks passed
@bentsku bentsku deleted the apigw-api-key-and-usage-plan-tests branch October 17, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes 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