Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cli-integ): add go init tests in preparation to adding them to our pipeline #24229

Merged
merged 2 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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