From 925161070a8ca943432fdd0c228105313569b257 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Mon, 6 Mar 2023 20:34:10 +0000 Subject: [PATCH] chore: fix go init template test to unblock v2 pipeline (#24472) The v2 pipeline is currently blocked due to the new go integ test failing. This change adds the correct go replacement and fixes a failing test in the sample app. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../cli-integ/tests/init-go/init-go.integtest.ts | 2 +- .../lib/init-templates/sample-app/go/%name%_test.template.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk-testing/cli-integ/tests/init-go/init-go.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/init-go/init-go.integtest.ts index f9772a7d80460..779078ac68739 100644 --- a/packages/@aws-cdk-testing/cli-integ/tests/init-go/init-go.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/init-go/init-go.integtest.ts @@ -8,7 +8,7 @@ import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '.. await context.packages.makeCliAvailable(); await shell.shell(['cdk', 'init', '-l', 'go', template]); - await shell.shell(['go', 'mod', 'edit', '-replace', 'github.com/aws/aws-cdk-go/awscdk=$dist_root/go/awscdk']); + await shell.shell(['go', 'mod', 'edit', '-replace', 'github.com/aws/aws-cdk-go/awscdk/v2=$CODEBUILD_SRC_DIR/go/awscdk']); await shell.shell(['go', 'mod', 'tidy']); await shell.shell(['go', 'test']); await shell.shell(['cdk', 'synth']); diff --git a/packages/aws-cdk/lib/init-templates/sample-app/go/%name%_test.template.go b/packages/aws-cdk/lib/init-templates/sample-app/go/%name%_test.template.go index 56181ebe4b377..d7d6ce936326d 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/go/%name%_test.template.go +++ b/packages/aws-cdk/lib/init-templates/sample-app/go/%name%_test.template.go @@ -16,7 +16,7 @@ func Test%name.PascalCased%Stack(t *testing.T) { stack := New%name.PascalCased%Stack(app, "MyStack", nil) // THEN - template := assertions.Template_FromStack(stack) + template := assertions.Template_FromStack(stack, nil) template.HasResourceProperties(jsii.String("AWS::SQS::Queue"), map[string]interface{}{ "VisibilityTimeout": 300,