Skip to content

Commit

Permalink
chore: make toolkit tests not break Lerna links (#914)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rix0rrr authored Oct 12, 2018
1 parent 2dc324e commit e802575
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/aws-cdk/integ-tests/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ function cleanup() {

function setup() {
cleanup
cd app
rm -rf /tmp/cdk-integ-test
mkdir -p /tmp/cdk-integ-test
cp -R app/* /tmp/cdk-integ-test
cd /tmp/cdk-integ-test

npm i --no-save @aws-cdk/cdk @aws-cdk/aws-sns
}
Expand Down

0 comments on commit e802575

Please sign in to comment.