diff --git a/misc/test/examples_test.go b/misc/test/examples_test.go index 816a6fec0..7c8b4de31 100644 --- a/misc/test/examples_test.go +++ b/misc/test/examples_test.go @@ -148,6 +148,53 @@ func TestExamples(t *testing.T) { }) }, }), + base.With(integration.ProgramTestOptions{ + Dir: path.Join(cwd, "..", "..", "cloud-js-containers"), + SkipBuild: true, + Config: map[string]string{ + // Use us-west-2 to assure fargate is availablecd + "aws:region": "us-west-2", + "cloud-aws:useFargate": "true", + }, + ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) { + assertHTTPResult(t, stack.Outputs["hostname"], func(body string) bool { + return assert.Contains(t, body, "

Hello, containers!

") + }) + }, + }), + base.With(integration.ProgramTestOptions{ + Dir: path.Join(cwd, "..", "..", "cloud-js-httpserver"), + SkipBuild: true, + Config: map[string]string{ + "cloud:provider": "aws", + "aws:region": awsRegion, + }, + ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) { + assertHTTPResult(t, stack.Outputs["endpoint"].(string)+"/hello", func(body string) bool { + return assert.Contains(t, body, "{\"route\":\"/hello\",\"count\":1}") + }) + }, + }), + base.With(integration.ProgramTestOptions{ + Dir: path.Join(cwd, "..", "..", "cloud-ts-url-shortener-cache-http"), + Verbose: true, + DebugLogLevel: 8, + DebugUpdates: true, + SkipBuild: true, + Config: map[string]string{ + "url-shortener-cache:redisPassword": "s3cr7Password", + "cloud:provider": "aws", + // Use us-west-2 to assure fargate availability + "aws:region": "us-west-2", + "cloud-aws:useFargate": "true", + "cloud-aws:functionIncludePaths": "", + }, + ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) { + assertHTTPResult(t, stack.Outputs["endpointUrl"], func(body string) bool { + return assert.Contains(t, body, "Short URL Manager") + }) + }, + }), // TODO: This test fails due to a bug in the Terraform Azure provider in which the // service principal is not available when attempting to create the K8s cluster. // See the azure-ts-aks-example readme for more detail. @@ -233,6 +280,7 @@ func assertHTTPResultWithRetry(t *testing.T, output interface{}, maxWait time.Du count, sleep := 0, 0 for true { now := time.Now() + fmt.Println("Getting hostname: " + hostname) resp, err = http.Get(hostname) if err == nil { break