forked from localstack/localstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Add test for Serverlesspresso AWS sample application #24
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
Open
lizard-boy
wants to merge
24
commits into
master
Choose a base branch
from
test_serverlesspresso
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
28c528c
initial wip
dominikschubert 285c603
cleanup
dominikschubert dedda48
update code and make stack deployable
pinzon 9544228
greenify test open store
pinzon ca3f4f1
order completion workflow test is complete
pinzon d1509ac
extra configs
pinzon 38e2328
config service and order service fixes
pinzon 4a06adc
rest api services deployments
pinzon d78b88d
fix validator service deployments
pinzon d45a959
register user test
pinzon fdec759
fix verify code
pinzon c6c1aab
waiting on deployment event trigger
pinzon c241d2b
fix waiting fn
pinzon fdf9960
fix final state value
pinzon 4e4be46
fix test state assertion
pinzon 8ee5981
publisher functions renamed
pinzon 8ea005b
trigger publisher functions
pinzon dc04d88
resolve role attachments for cognito users
pinzon 4fcc8f5
fix state issue with casing and event name
pinzon 65cddf9
wip: e2e test
pinzon bf11467
e2e
pinzon 370042e
format and lint
pinzon b8cd1f3
wip: iot test
pinzon 0dbbd43
iot test complete
pinzon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3,663 changes: 3,663 additions & 0 deletions
3,663
tests/aws/cdk_templates/serverlesspresso/ServerlesspressoStack.json
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
237 changes: 237 additions & 0 deletions
237
tests/aws/scenario/serverlesspresso/artifacts/api/config_service_api.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,237 @@ | ||
| openapi: "3.0.1" | ||
| info: | ||
| title: "ConfigServiceRESTAPI" | ||
| version: "2021-12-21T15:32:58Z" | ||
| paths: | ||
| /config: | ||
| get: | ||
| responses: | ||
| "200": | ||
| description: "200 response" | ||
| headers: | ||
| Access-Control-Allow-Origin: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Methods: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Headers: | ||
| schema: | ||
| type: "string" | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/Empty" | ||
|
|
||
| x-amazon-apigateway-integration: | ||
| credentials: | ||
| Fn::GetAtt: [ConfigRESTApiRole, Arn] | ||
| httpMethod: "POST" | ||
| uri: | ||
| Fn::Sub: arn:aws:apigateway:${AWS::Region}:dynamodb:action/Scan | ||
| responses: | ||
| default: | ||
| statusCode: "200" | ||
| responseParameters: | ||
| method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" | ||
| method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" | ||
| method.response.header.Access-Control-Allow-Origin: "'*'" | ||
| responseTemplates: | ||
| application/json: "#set($Items = $input.path('$.Items'))\n$Items\n" | ||
| requestTemplates: | ||
| application/json: "{\n \"TableName\": \"serverlesspresso-config-table\"\ | ||
| \n}" | ||
| passthroughBehavior: "when_no_templates" | ||
| type: "aws" | ||
| options: | ||
| responses: | ||
| "200": | ||
| description: "200 response" | ||
| headers: | ||
| Access-Control-Allow-Origin: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Methods: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Headers: | ||
| schema: | ||
| type: "string" | ||
| content: {} | ||
| x-amazon-apigateway-integration: | ||
| responses: | ||
| default: | ||
| statusCode: "200" | ||
| responseParameters: | ||
| method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" | ||
| method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" | ||
| method.response.header.Access-Control-Allow-Origin: "'*'" | ||
| responseTemplates: | ||
| application/json: "{}\n" | ||
| requestTemplates: | ||
| application/json: "{\n \"statusCode\" : 200\n}\n" | ||
| passthroughBehavior: "when_no_match" | ||
| type: "mock" | ||
| /admin-config: | ||
| get: | ||
| responses: | ||
| "200": | ||
| description: "200 response" | ||
| headers: | ||
| Access-Control-Allow-Origin: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Methods: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Headers: | ||
| schema: | ||
| type: "string" | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/Empty" | ||
| security: [ | ||
| { | ||
| "ServerlespressoAuth" : ["openid", "aws.cognito.signin.user.admin"] | ||
| } | ||
| ] | ||
| x-amazon-apigateway-integration: | ||
| credentials: | ||
| Fn::GetAtt: [ConfigRESTApiRole, Arn] | ||
| httpMethod: "POST" | ||
| uri: | ||
| Fn::Sub: arn:aws:apigateway:${AWS::Region}:dynamodb:action/Scan | ||
| responses: | ||
| default: | ||
| statusCode: "200" | ||
| responseParameters: | ||
| method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" | ||
| method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" | ||
| method.response.header.Access-Control-Allow-Origin: "'*'" | ||
| responseTemplates: | ||
| application/json: "#set($Items = $input.path('$.Items'))\n$Items\n" | ||
| requestTemplates: | ||
| application/json: "{\n \"TableName\": \"serverlesspresso-config-table\"\ | ||
| \n}" | ||
| passthroughBehavior: "when_no_templates" | ||
| type: "aws" | ||
| options: | ||
| responses: | ||
| "200": | ||
| description: "200 response" | ||
| headers: | ||
| Access-Control-Allow-Origin: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Methods: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Headers: | ||
| schema: | ||
| type: "string" | ||
| content: {} | ||
| x-amazon-apigateway-integration: | ||
| responses: | ||
| default: | ||
| statusCode: "200" | ||
| responseParameters: | ||
| method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" | ||
| method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" | ||
| method.response.header.Access-Control-Allow-Origin: "'*'" | ||
| responseTemplates: | ||
| application/json: "{}\n" | ||
| requestTemplates: | ||
| application/json: "{\n \"statusCode\" : 200\n}\n" | ||
| passthroughBehavior: "when_no_match" | ||
| type: "mock" | ||
| /store: | ||
| put: | ||
| responses: | ||
| "200": | ||
| description: "200 response" | ||
| headers: | ||
| Access-Control-Allow-Origin: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Methods: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Headers: | ||
| schema: | ||
| type: "string" | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/Empty" | ||
| security: [ | ||
| { | ||
| "ServerlespressoAuth" : ["openid", "aws.cognito.signin.user.admin"] | ||
| } | ||
| ] | ||
| x-amazon-apigateway-integration: | ||
| credentials: | ||
| Fn::GetAtt: [ConfigRESTApiRole, Arn] | ||
| httpMethod: "POST" | ||
| uri: "arn:aws:apigateway:${AWS::Region}:dynamodb:action/UpdateItem" | ||
| responses: | ||
| default: | ||
| statusCode: "200" | ||
| responseParameters: | ||
| method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" | ||
| method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" | ||
| method.response.header.Access-Control-Allow-Origin: "'*'" | ||
| requestTemplates: | ||
| application/json: "#set($state = $input.params('state'))\n\n#if( $state\ | ||
| \ == 'open' )\n #set($stateBool = true)\n#else\n #set($stateBool = false)\n\ | ||
| #end\n\n{\n \"TableName\": \"serverlesspresso-config-table\",\n \ | ||
| \ \"Key\": {\n \"PK\": {\n \"S\":\"config\"\n }\n \ | ||
| \ },\n \"UpdateExpression\": \"set storeOpen = :openState\",\n \ | ||
| \ \"ExpressionAttributeValues\": {\n \":openState\": {\n \"BOOL\"\ | ||
| : $stateBool\n }\n },\n \"ReturnValues\":\"ALL_NEW\"\n}" | ||
| passthroughBehavior: "when_no_templates" | ||
| type: "aws" | ||
| options: | ||
| responses: | ||
| "200": | ||
| description: "200 response" | ||
| headers: | ||
| Access-Control-Allow-Origin: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Methods: | ||
| schema: | ||
| type: "string" | ||
| Access-Control-Allow-Headers: | ||
| schema: | ||
| type: "string" | ||
| content: {} | ||
| x-amazon-apigateway-integration: | ||
| responses: | ||
| default: | ||
| statusCode: "200" | ||
| responseParameters: | ||
| method.response.header.Access-Control-Allow-Methods: "'PUT,OPTIONS'" | ||
| method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" | ||
| method.response.header.Access-Control-Allow-Origin: "'*'" | ||
| responseTemplates: | ||
| application/json: "{}\n" | ||
| requestTemplates: | ||
| application/json: "{\n \"statusCode\" : 200\n}\n" | ||
| passthroughBehavior: "when_no_match" | ||
| type: "mock" | ||
| components: | ||
| schemas: | ||
| Empty: | ||
| title: "Empty Schema" | ||
| type: "object" | ||
| securitySchemes: | ||
| ServerlespressoAuth: | ||
| type: "apiKey" | ||
| name: "Authorization" | ||
| in: "header" | ||
| x-amazon-apigateway-authtype: "cognito_user_pools" | ||
| x-amazon-apigateway-authorizer: | ||
| providerARNs: | ||
| - Fn::GetAtt: [UserPool, Arn] | ||
| type: "cognito_user_pools" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Access-Control-Allow-Methods should include 'PUT' instead of 'GET' for the store endpoint