Skip to content

Commit e802575

Browse files
authored
chore: make toolkit tests not break Lerna links (#914)
If the integ tests are run in the source directroy, the "npm install" command will go up to find package.json and replace its node_modules directory, thereby breaking the Lerna symlinks and making subsequent toolkit executions fail because it can't find '@aws-cdk/cx-api'. Copy out the app directory to a temporary directory and run the test there, so that the source tree remains undisturbed. It's a fixed directory name, seems simpler than generating a temporary directory on each run and then also having to install a cleanup hook.
1 parent 2dc324e commit e802575

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: packages/aws-cdk/integ-tests/common.bash

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ function cleanup() {
1313

1414
function setup() {
1515
cleanup
16-
cd app
16+
rm -rf /tmp/cdk-integ-test
17+
mkdir -p /tmp/cdk-integ-test
18+
cp -R app/* /tmp/cdk-integ-test
19+
cd /tmp/cdk-integ-test
1720

1821
npm i --no-save @aws-cdk/cdk @aws-cdk/aws-sns
1922
}

0 commit comments

Comments
 (0)