Skip to content

test(capacity-provider): add integration test for ManagedResourceTags - #3983

Merged
vicheey merged 4 commits into
developfrom
add-managed-resource-tags-integ-test
Aug 24, 2026
Merged

vicheey merged 4 commits into
developfrom
add-managed-resource-tags-integ-test

Conversation

@vicheey

@vicheey vicheey commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available

N/A — test coverage improvement for ManagedResourceTags on AWS::Serverless::CapacityProvider.

Description of changes

  1. Add integration test for ManagedResourceTags.Tags on CapacityProvider:

    • Adds ManagedResourceTags: { Tags: { Environment: Production, Team: Lambda-Tooling } } to the existing AdvancedCapacityProvider in function_lmi_default.yaml
    • Asserts GetCapacityProvider returns PropagateTags.Mode: Explicit and ExplicitTags map with correct key-value pairs
  2. Simplify ManagedResourceTags to Tags-only interface:

    • Remove unused Propagate sub-property from schema source
    • Remove unused validation rule and generator path
    • Regenerate schema
    • Update unit test fixtures to reflect Tags-only interface

Description of how you validated changes

  • Unit tests: 789 passing (pytest with AWS_DEFAULT_REGION=us-east-1)
  • Schema tests: 728 passing (test_validate_schema.py)
  • Integration test: Deployed to personal account (us-east-1), verified GetCapacityProvider returns expected PropagateTags configuration:
    • Mode: Explicit
    • ExplicitTags: { Environment: Production, Team: Lambda-Tooling }
  • Pipeline: Existing CI passes on SamTranslatorLambda pipeline

Checklist

Testing

Integration test

dev-dsk-vichym % AWS_DEFAULT_REGION=us-east-1 pytest --no-cov integration/combination/test_function_with_capacity_provider.py::TestFunctionWithCapacityProvider::test_function_with_capacity_provider_default_role -v
===================== test session starts =====================

platform linux -- Python 3.12.13, pytest-7.4.4, pluggy-1.6.0 -- /local/home/vichym/.local/share/mise/installs/python/3.12.13/bin/python3.12
cachedir: .pytest_cache
hypothesis profile 'default'
Test order randomisation NOT enabled. Enable with --random-order or --random-order-bucket=<bucket_type>
rootdir: /local/home/vichym/.meshclaw/workspace/Projects/lmi-capacity-provider-tags-propagation/code/sam-t
configfile: pytest.ini
plugins: xdist-3.8.0, rerunfailures-11.1.2, env-0.8.2, cov-4.1.0, hypothesis-6.156.6, random-order-1.2.0, localserver-0.10.0
collected 1 item

integration/combination/test_function_with_capacity_provider.py::TestFunctionWithCapacityProvider::test_function_with_capacity_provider_default_role
---------------------------- live log setup ----------------------------
INFO     botocore.credentials:credentials.py:1392 Found credentials in shared credentials file: ~/.aws/credentials
PASSED                                                                                                                                                                                                                                                         [100%]

===================== 1 passed in 159.33s (0:02:39) =====================

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Add integration test verifying ManagedResourceTags with explicit tags
and Globals inheritance. Simplify ManagedResourceTags to Tags-only
interface (Mode: Explicit + ExplicitTags).

@aws-sam-tooling-bot aws-sam-tooling-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review Results

Reviewed: bbc6a9a..5bb8346
Files: 16
Comments: 2

Comment thread integration/combination/test_function_with_capacity_provider.py
…d override assertions

- Add Globals.CapacityProvider.ManagedResourceTags.Tags with GlobalTag in template
- Assert SimpleCapacityProvider inherits GlobalTag from Globals
- Assert AdvancedCapacityProvider overrides GlobalTag at resource level
- Validates PRUNE_AND_MERGE behavior end-to-end via Lambda API

@aws-sam-tooling-bot aws-sam-tooling-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review Results

Reviewed: bbc6a9a..7797cde
Files: 16
Comments: 2

Comment thread integration/combination/test_function_with_capacity_provider.py
@aws aws deleted a comment from aws-sam-tooling-bot Bot Aug 24, 2026
aws-sam-tooling-bot[bot]

This comment was marked as outdated.

@vicheey

vicheey commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

I removed CpNoManagedResourceTags

CpNoManagedResourceTags was functionally identical to CpInheritsGlobal —
both inherit from Globals with no resource-level override. Removed from
input template and all partition outputs (aws, aws-cn, aws-us-gov).
Clean up orphaned doc entry in sam-docs.json.
aws-sam-tooling-bot[bot]

This comment was marked as duplicate.

@vicheey
vicheey marked this pull request as ready for review August 24, 2026 18:51
@vicheey
vicheey requested a review from a team as a code owner August 24, 2026 18:51
@vicheey
vicheey merged commit b794d0a into develop Aug 24, 2026
9 checks passed
@vicheey
vicheey deleted the add-managed-resource-tags-integ-test branch August 24, 2026 22:37
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.

3 participants