From d2f2f539e80b1dce89e08fdcaf2d893d8d6141e1 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 27 Oct 2021 12:40:33 -0400 Subject: [PATCH 1/2] test(nextjs): Add Next 12 to integration test matrix --- packages/nextjs/test/run-integration-tests.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/nextjs/test/run-integration-tests.sh b/packages/nextjs/test/run-integration-tests.sh index b44a617e1ed6..e6a82bd71fd3 100755 --- a/packages/nextjs/test/run-integration-tests.sh +++ b/packages/nextjs/test/run-integration-tests.sh @@ -14,7 +14,7 @@ function cleanup { # Delete yarn's cached versions of sentry packages added during this test run, since every test run installs multiple # copies of each package. Without this, the cache can balloon in size quickly if integration tests are being run # multiple times in a row. - find $(yarn cache dir) -iname "npm-@sentry*" -newermt "$START_TIME" -mindepth 1 -maxdepth 1 -exec rm -rf {} \; + find "$(yarn cache dir)" -iname "npm-@sentry*" -newermt "$START_TIME" -mindepth 1 -maxdepth 1 -exec rm -rf {} \; echo "[nextjs] Test run complete" } @@ -30,7 +30,7 @@ echo "Running integration tests on Node $NODE_VERSION" # make a backup of our config file so we can restore it when we're done mv next.config.js next.config.js.bak -for NEXTJS_VERSION in 10 11; do +for NEXTJS_VERSION in 10 11 12; do # Next 10 requires at least Node v10 if [ "$NODE_MAJOR" -lt "10" ]; then @@ -62,7 +62,13 @@ for NEXTJS_VERSION in 10 11; do linkcli && linkplugin mv -f package.json.bak package.json 2>/dev/null || true - for RUN_WEBPACK_5 in false true; do + WEBPACK_VAR=(true) + # Only run Webpack 4 tests for Next 10 and Next 11 + if [ "$NEXTJS_VERSION" -eq "10" ] || [ "$NEXTJS_VERSION" -eq "11" ]; then + WEBPACK_VAR+=(false) + fi + + for RUN_WEBPACK_5 in ${WEBPACK_VAR[*]}; do [ "$RUN_WEBPACK_5" == true ] && WEBPACK_VERSION=5 || WEBPACK_VERSION=4 @@ -75,7 +81,7 @@ for NEXTJS_VERSION in 10 11; do fi echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Building..." - yarn build | grep "Using webpack" + yarn build # if the user hasn't passed any args, use the default one, which restricts each test to only outputting success and # failure messages From a12bdf25bfc645b79e485dc1b0d24c03551bf411 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 27 Oct 2021 13:25:11 -0400 Subject: [PATCH 2/2] rename to SHOULD_RUN_WEBPACK_5 --- packages/nextjs/test/run-integration-tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nextjs/test/run-integration-tests.sh b/packages/nextjs/test/run-integration-tests.sh index e6a82bd71fd3..e45bad879d6a 100755 --- a/packages/nextjs/test/run-integration-tests.sh +++ b/packages/nextjs/test/run-integration-tests.sh @@ -62,13 +62,13 @@ for NEXTJS_VERSION in 10 11 12; do linkcli && linkplugin mv -f package.json.bak package.json 2>/dev/null || true - WEBPACK_VAR=(true) + SHOULD_RUN_WEBPACK_5=(true) # Only run Webpack 4 tests for Next 10 and Next 11 if [ "$NEXTJS_VERSION" -eq "10" ] || [ "$NEXTJS_VERSION" -eq "11" ]; then - WEBPACK_VAR+=(false) + SHOULD_RUN_WEBPACK_5+=(false) fi - for RUN_WEBPACK_5 in ${WEBPACK_VAR[*]}; do + for RUN_WEBPACK_5 in ${SHOULD_RUN_WEBPACK_5[*]}; do [ "$RUN_WEBPACK_5" == true ] && WEBPACK_VERSION=5 || WEBPACK_VERSION=4