Skip to content

Commit

Permalink
Fix tests (pulumi#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehoban committed Dec 22, 2020
1 parent ac325b0 commit b0f3fbb
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 13 deletions.
2 changes: 1 addition & 1 deletion aws-ts-pulumi-webhooks/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IncomingWebhookSendArguments } from "@slack/webhook";
// See the Pulumi and Slack webhook documentation for details.
// https://www.pulumi.com/docs/intro/console/extensions/webhooks/
// https://api.slack.com/docs/message-attachments
export function formatSlackMessage(kind: string, payload: object, messageArgs: IncomingWebhookSendArguments): IncomingWebhookSendArguments {
export function formatSlackMessage(kind: string | undefined, payload: object, messageArgs: IncomingWebhookSendArguments): IncomingWebhookSendArguments {
const cloned: IncomingWebhookSendArguments = Object.assign({}, messageArgs) as IncomingWebhookSendArguments;

switch (kind) {
Expand Down
24 changes: 12 additions & 12 deletions kubernetes-ts-sock-shop/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const carts = new k8s.apps.v1.Deployment("carts", {
selector: {
matchLabels: {
name: "carts",
}
},
},
template: {
metadata: {
Expand Down Expand Up @@ -209,7 +209,7 @@ const catalogDb = new k8s.apps.v1.Deployment("catalog-db", {
selector: {
matchLabels: {
name: "catalogue-db",
}
},
},
template: {
metadata: {
Expand Down Expand Up @@ -280,7 +280,7 @@ const catalog = new k8s.apps.v1.Deployment("catalog", {
selector: {
matchLabels: {
name: "catalogue",
}
},
},
template: {
metadata: {
Expand Down Expand Up @@ -350,7 +350,7 @@ const frontend = new k8s.apps.v1.Deployment("front-end", {
selector: {
matchLabels: {
name: "front-end",
}
},
},
template: {
metadata: {
Expand Down Expand Up @@ -430,7 +430,7 @@ const ordersDb = new k8s.apps.v1.Deployment("orders-db", {
selector: {
matchLabels: {
name: "orders-db",
}
},
},
template: {
metadata: {
Expand Down Expand Up @@ -512,7 +512,7 @@ const orders = new k8s.apps.v1.Deployment("orders", {
selector: {
matchLabels: {
name: "orders",
}
},
},
template: {
metadata: {
Expand Down Expand Up @@ -610,7 +610,7 @@ const payment = new k8s.apps.v1.Deployment("payment", {
selector: {
matchLabels: {
name: "payment",
}
},
},
template: {
metadata: {
Expand Down Expand Up @@ -683,7 +683,7 @@ const queueMaster = new k8s.apps.v1.Deployment("queue-master", {
selector: {
matchLabels: {
name: "queue-master",
}
},
},
template: {
metadata: {
Expand Down Expand Up @@ -746,7 +746,7 @@ const rabbitmq = new k8s.apps.v1.Deployment("rabbitmq", {
selector: {
matchLabels: {
name: "rabbitmq",
}
},
},
template: {
metadata: {
Expand Down Expand Up @@ -817,7 +817,7 @@ const shipping = new k8s.apps.v1.Deployment("shipping", {
selector: {
matchLabels: {
name: "shipping",
}
},
},
template: {
metadata: {
Expand Down Expand Up @@ -915,7 +915,7 @@ const userDb = new k8s.apps.v1.Deployment("user-db", {
selector: {
matchLabels: {
name: "user-db",
}
},
},
template: {
metadata: {
Expand Down Expand Up @@ -997,7 +997,7 @@ const user = new k8s.apps.v1.Deployment("user", {
selector: {
matchLabels: {
name: "user",
}
},
},
template: {
metadata: {
Expand Down
43 changes: 43 additions & 0 deletions misc/test/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,20 @@ func TestAccAwsTsPulumiWebhooks(t *testing.T) {
"aws-ts-pulumi-webhooks:slackChannel": "general",
"aws-ts-pulumi-webhooks:slackWebhook": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
},
// TODO[pulumi/examples#859]: Currently this examples leads to a no-op preview diff of:
// ~ aws:apigateway:RestApi pulumi-webhook-handler update [diff: ~binaryMediaTypes]
// ++ aws:apigateway:Deployment pulumi-webhook-handler create replacement [diff: ~variables]
// +- aws:apigateway:Deployment pulumi-webhook-handler replace [diff: ~variables]
// ++ aws:lambda:Permission pulumi-webhook-handler-fa520765 create replacement [diff: ~sourceArn]
// +- aws:lambda:Permission pulumi-webhook-handler-fa520765 replace [diff: ~sourceArn]
// ++ aws:lambda:Permission pulumi-webhook-handler-c171fd88 create replacement [diff: ~sourceArn]
// +- aws:lambda:Permission pulumi-webhook-handler-c171fd88 replace [diff: ~sourceArn]
// ~ aws:apigateway:Stage pulumi-webhook-handler update [diff: ~deployment]
// -- aws:lambda:Permission pulumi-webhook-handler-fa520765 delete original [diff: ~sourceArn]
// -- aws:lambda:Permission pulumi-webhook-handler-c171fd88 delete original [diff: ~sourceArn]
// -- aws:apigateway:Deployment pulumi-webhook-handler delete original [diff: ~variables]
AllowEmptyPreviewChanges: true,
AllowEmptyUpdateChanges: true,
})

integration.ProgramTest(t, &test)
Expand Down Expand Up @@ -564,6 +578,10 @@ func TestAccAwsTsThumbnailer(t *testing.T) {
test := getAWSBase(t).
With(integration.ProgramTestOptions{
Dir: path.Join(getCwd(t), "..", "..", "aws-ts-thumbnailer"),
// TODO[pulumi/examples#859]: Currently this examples leads to a no-op preview diff of:
// ~ aws:lambda:Function onNewVideo update [diff: ~code]
AllowEmptyPreviewChanges: true,
AllowEmptyUpdateChanges: true,
})

integration.ProgramTest(t, &test)
Expand All @@ -589,6 +607,13 @@ func TestAccAwsTsLambdaEfs(t *testing.T) {
test := getAWSBase(t).
With(integration.ProgramTestOptions{
Dir: path.Join(getCwd(t), "..", "..", "aws-ts-lambda-efs"),
// TODO[pulumi/examples#859]: Currently this examples leads to a no-op preview diff of:
// ++ aws:ecs:TaskDefinition nginx create replacement [diff: ~volumes]
// +- aws:ecs:TaskDefinition nginx replace [diff: ~volumes]
// ~ aws:ecs:Service nginx update [diff: ~taskDefinition]
// -- aws:ecs:TaskDefinition nginx delete original [diff: ~volumes]
AllowEmptyPreviewChanges: true,
AllowEmptyUpdateChanges: true,
})

integration.ProgramTest(t, &test)
Expand Down Expand Up @@ -1065,6 +1090,14 @@ func TestAccCloudJsThumbnailer(t *testing.T) {
Config: map[string]string{
"cloud-aws:useFargate": "true",
},
// TODO[pulumi/examples#859]: Currently this examples leads to a no-op preview diff of:
// ++ aws:ecs:TaskDefinition ffmpegThumbTask create replacement [diff: ~containerDefinitions]
// +- aws:ecs:TaskDefinition ffmpegThumbTask replace [diff: ~containerDefinitions]
// ~ aws:lambda:Function onNewVideo update [diff: ~code]
// ~ aws:s3:BucketNotification onNewVideo update [diff: ~lambdaFunctions]
// -- aws:ecs:TaskDefinition ffmpegThumbTask delete original [diff: ~containerDefinitions]
AllowEmptyPreviewChanges: true,
AllowEmptyUpdateChanges: true,
})

integration.ProgramTest(t, &test)
Expand All @@ -1080,6 +1113,16 @@ func TestAccCloudJsThumbnailerMachineLearning(t *testing.T) {
"cloud-aws:computeIAMRolePolicyARNs": "arn:aws:iam::aws:policy/AWSLambdaFullAccess,arn:aws:iam::aws:" +
"policy/AmazonEC2ContainerServiceFullAccess,arn:aws:iam::aws:policy/AmazonRekognitionFullAccess",
},
// TODO[pulumi/examples#859]: Currently this examples leads to a no-op preview diff of:
// ++ aws:ecs:TaskDefinition ffmpegThumbTask create replacement [diff: ~containerDefinitions]
// +- aws:ecs:TaskDefinition ffmpegThumbTask replace [diff: ~containerDefinitions]
// ~ aws:lambda:Function AmazonRekognitionTopic_labelResults update [diff: ~code]
// ++ aws:sns:TopicSubscription AmazonRekognitionTopic_labelResults create replacement [diff: ~endpoint]
// +- aws:sns:TopicSubscription AmazonRekognitionTopic_labelResults replace [diff: ~endpoint]
// -- aws:sns:TopicSubscription AmazonRekognitionTopic_labelResults delete original [diff: ~endpoint]
// -- aws:ecs:TaskDefinition ffmpegThumbTask delete original [diff: ~containerDefinitions]
AllowEmptyPreviewChanges: true,
AllowEmptyUpdateChanges: true,
})

integration.ProgramTest(t, &test)
Expand Down

0 comments on commit b0f3fbb

Please sign in to comment.