Skip to content

Commit

Permalink
To make it a bit better to run a test directly default the two required
Browse files Browse the repository at this point in the history
environment variables (AWS_REGION, ARM_ENVIRONMENT).

Implement the azure-ts-aks-mean test.  Had to reduce the size of the DNS
Prefix because the derived name was larger than 45 chars.
  • Loading branch information
daveremy committed Sep 30, 2018
1 parent af1ff83 commit 466f4ea
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion azure-ts-aks-mean/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const k8sCluster = new azure.containerservice.KubernetesCluster("aksClust
count: config.nodeCount,
vmSize: config.nodeSize,
},
dnsPrefix: `${pulumi.getStack()}-kubernetes`,
dnsPrefix: `${pulumi.getStack()}-kube`,
linuxProfile: {
adminUsername: "aksuser",
sshKeys: [{
Expand Down
20 changes: 18 additions & 2 deletions misc/test/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ import (
func TestExamples(t *testing.T) {
awsRegion := os.Getenv("AWS_REGION")
if awsRegion == "" {
t.Skipf("Skipping test due to missing AWS_REGION environment variable")
awsRegion = "us-west-1"
t.Logf("Defaulting AWS_REGION to 'us-west-1'. You can override using the AWS_REGION environment variable")
}
azureEnviron := os.Getenv("ARM_ENVIRONMENT")
if azureEnviron == "" {
t.Skipf("Skipping test due to missing ARM_ENVIRONMENT variable")
azureEnviron = "public"
t.Logf("Defaulting ARM_ENVIRONMENT to 'public'. You can override using the ARM_ENVIRONMENT variable")
}
cwd, err := os.Getwd()
if !assert.NoError(t, err, "expected a valid working directory: %v", err) {
Expand Down Expand Up @@ -103,6 +105,20 @@ func TestExamples(t *testing.T) {
})
},
}),
base.With(integration.ProgramTestOptions{
Dir: path.Join(cwd, "..", "..", "azure-ts-aks-mean"),
SkipBuild: true,
Config: map[string]string{
"azure:environment": azureEnviron,
"password": "testTEST1234+_^$",
"sshPublicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDeREOgHTUgPT00PTr7iQF9JwZQ4QF1VeaLk2nHKRvWYOCiky6hDtzhmLM0k0Ib9Y7cwFbhObR+8yZpCgfSX3Hc3w2I1n6lXFpMfzr+wdbpx97N4fc1EHGUr9qT3UM1COqN6e/BEosQcMVaXSCpjqL1jeNaRDAnAS2Y3q1MFeXAvj9rwq8EHTqqAc1hW9Lq4SjSiA98STil5dGw6DWRhNtf6zs4UBy8UipKsmuXtclR0gKnoEP83ahMJOpCIjuknPZhb+HsiNjFWf+Os9U6kaS5vGrbXC8nggrVE57ow88pLCBL+3mBk1vBg6bJuLBCp2WTqRzDMhSDQ3AcWqkucGqf dremy@remthinkpad",
},
ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) {
assertHTTPResult(t, stack.Outputs["endpoint"], func(body string) bool {
return assert.Contains(t, body, "<title>Node/Angular Todo App</title>>")
})
},
}),
// TODO[pulumi/pulumi#1606] This test is failing in CI, disabling until this issue is resolved.
// base.With(integration.ProgramTestOptions{
// Dir: path.Join(cwd, "..", "..", "aws-py-webserver"),
Expand Down

0 comments on commit 466f4ea

Please sign in to comment.