Skip to content

Commit

Permalink
Merge pull request pulumi#145 from pulumi/daveremy/azure-ts-aks-mean
Browse files Browse the repository at this point in the history
azure-ts-aks-mean example test
  • Loading branch information
daveremy committed Oct 2, 2018
2 parents af1ff83 + 3b47106 commit 5bb8982
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
5 changes: 5 additions & 0 deletions azure-ts-aks-mean/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ npm install

1. Perform the deployment:

> **Note**: Due to an issue in the Azure Terraform Provider (https://github.com/terraform-providers/terraform-provider-azurerm/issues/1635) the
> creation of an Azure Service Principal, which is needed to create the Kubernetes cluster (see cluster.ts), is delayed and may not
> be available when the cluster is created. If you get a Service Principal not found error, as a work around, you should be able to run `pulumi up`
> again, at which time the Service Principal should have been created.
```sh
$ pulumi up
Updating stack 'azure-mean'
Expand Down
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
25 changes: 22 additions & 3 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,23 @@ func TestExamples(t *testing.T) {
})
},
}),
// 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.
// 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 All @@ -114,7 +133,7 @@ func TestExamples(t *testing.T) {
// "aws:region": awsRegion,
// },
// ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) {
// expectHelloWorld(t, stack.Outputs["public_dns"])
// assertHTTPHelloWorld(t, stack.Outputs["public_dns"])
// },
// }),
}
Expand Down

0 comments on commit 5bb8982

Please sign in to comment.