Skip to content

Commit

Permalink
chore(cli-integ): add go init tests in preparation to adding them to …
Browse files Browse the repository at this point in the history
…our pipeline (#24229)

Based off https://github.com/aws/aws-cdk/blob/ca208058256703759ae5e35d04194edbdc6b1756/packages/aws-cdk/test/integ/init/test-go.sh.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
TheRealAmazonKendra committed Feb 20, 2023
1 parent 78ee005 commit ee36150
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib';

['app', 'sample-app'].forEach(template => {
integTest(`init go ${template}`, withTemporaryDirectory(withPackages(async (context) => {
context.packages.assertJsiiPackagesAvailable();

const shell = ShellHelper.fromContext(context);
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', 'tidy']);
await shell.shell(['go', 'test']);
await shell.shell(['cdk', 'synth']);
})));
});
6 changes: 6 additions & 0 deletions packages/aws-cdk/test/integ/init/test-go-app.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -eu
# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ'
# and should be called from there directly.

exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION init-go

0 comments on commit ee36150

Please sign in to comment.