From 8e565a9524af9de6cb934b4ff8d0d450871c97a3 Mon Sep 17 00:00:00 2001 From: Jamie Kinkead <41454626+jkisk@users.noreply.github.com> Date: Sat, 12 Mar 2022 08:22:40 -0800 Subject: [PATCH] Add apigateway-routes tests (#1175) --- misc/test/aws_test.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/misc/test/aws_test.go b/misc/test/aws_test.go index e0016af90..068ec7082 100644 --- a/misc/test/aws_test.go +++ b/misc/test/aws_test.go @@ -167,6 +167,38 @@ func TestAccAwsJsWebserverComponent(t *testing.T) { integration.ProgramTest(t, &test) } +func TestAccAwsApiGatewayPyRoutes(t *testing.T) { + test := getAWSBase(t). + With(integration.ProgramTestOptions{ + Dir: path.Join(getCwd(t), "..", "..", "aws-apigateway-py-routes"), + ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) { + maxWait := 10 * time.Minute + endpoint := stack.Outputs["url"].(string) + assertHTTPResultWithRetry(t, endpoint+"lambda", nil, maxWait, func(body string) bool { + return assert.Contains(t, body, "Hello, API Gateway!") + }) + }, + }) + + integration.ProgramTest(t, &test) +} + +func TestAccAwsApiGatewayTsRoutes(t *testing.T) { + test := getAWSBase(t). + With(integration.ProgramTestOptions{ + Dir: path.Join(getCwd(t), "..", "..", "aws-apigateway-ts-routes"), + ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) { + maxWait := 10 * time.Minute + endpoint := stack.Outputs["url"].(string) + assertHTTPResultWithRetry(t, endpoint+"lambda", nil, maxWait, func(body string) bool { + return assert.Contains(t, body, "Hello, API Gateway!") + }) + }, + }) + + integration.ProgramTest(t, &test) +} + func TestAccAwsPyAppSync(t *testing.T) { test := getAWSBase(t). With(integration.ProgramTestOptions{