Three cloud example tests:  cloud-js-containers, clouse-js-httpserver, and cloud-ts-url-shortener-cache-http.  Cloud-ts-url-shortener-cache-http is currently failing on the assert for reasons I am not sure of so I am going ahead and committing and pushing up to PR to get some feedback.
MODIFY
misc/test/examples_test.go
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, "<p>Hello, containers!</p>")
+ })
+ },
+ }),
+ 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, "<title>Short URL Manager</title>")
+ })
+ },
+ }),
// 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

Three cloud example tests:  cloud-js-containers, clouse-js-httpserver, and cloud-ts-url-shortener-cache-http.  Cloud-ts-url-shortener-cache-http is currently failing on the assert for reasons I am not sure of so I am going ahead and committing and pushing up to PR to get some feedback.