Skip to content

test: Use valid enum values in graphqlapi_api_cache test - #4001

Merged
licjun merged 1 commit into
aws:developfrom
licjun:fix/graphqlapi-cache-cfn-lint
Oct 1, 2026
Merged

licjun merged 1 commit into
aws:developfrom
licjun:fix/graphqlapi-cache-cfn-lint

Conversation

@licjun

@licjun licjun commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available

N/A

Description of changes

bin/run_cfn_lint.sh runs cfn-lint -u before linting, which pulls the latest CloudFormation schema. That schema now restricts AWS::AppSync::ApiCache ApiCachingBehavior and Type to enum values, so the placeholder values in the graphqlapi_api_cache test fail lint with E3030 on every PR, regardless of what the PR changes:

tests/translator/output/graphqlapi_api_cache.json:36:9:36:29:E3030:'somebehaviour' is not one of ['FULL_REQUEST_CACHING', 'OPERATION_LEVEL_CACHING', 'PER_RESOLVER_CACHING']
tests/translator/output/graphqlapi_api_cache.json:46:9:46:15:E3030:'mytype' is not one of ['LARGE', ..., 'SMALL', ...]

(plus the same two errors in the aws-cn and aws-us-gov outputs).

SAM passes both properties through unchanged (passthrough_value in sam_resources.py, PassThroughProp in the schema source), so the test only needs some value to verify the passthrough. This replaces the placeholders with valid values (FULL_REQUEST_CACHING, SMALL) in the input and the three partition outputs. No samtranslator code changes.

Description of how you validated changes

  • pytest tests/translator/test_translator.py -k graphqlapi_api_cache: 3 passed (all partitions).
  • bin/run_cfn_lint.sh (cfn-lint 1.55.0, schema updated in the run): exit 0, no errors. Before this change it reported the 6 E3030 errors above.

Checklist

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

The latest CloudFormation schema pulled by cfn-lint now restricts
AWS::AppSync::ApiCache ApiCachingBehavior and Type to enum values, so
the placeholder values "somebehaviour" and "mytype" fail
bin/run_cfn_lint.sh (E3030) on every PR.

SAM passes both properties through unchanged, so the test only needs
some value to verify the passthrough. Replace the placeholders with
valid values (FULL_REQUEST_CACHING, SMALL).
@licjun
licjun requested a review from a team as a code owner October 1, 2026 18:33
@licjun licjun closed this Oct 1, 2026
@licjun licjun reopened this Oct 1, 2026
@licjun
licjun merged commit d58ccac into aws:develop Oct 1, 2026
16 checks passed
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