Skip to content

test(nextjs): Add Next 12 to integration test matrix #4096

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

Merged
merged 2 commits into from
Oct 27, 2021
Merged
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
14 changes: 10 additions & 4 deletions packages/nextjs/test/run-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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
Expand Down Expand Up @@ -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
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
SHOULD_RUN_WEBPACK_5+=(false)
fi

for RUN_WEBPACK_5 in ${SHOULD_RUN_WEBPACK_5[*]}; do
[ "$RUN_WEBPACK_5" == true ] &&
WEBPACK_VERSION=5 ||
WEBPACK_VERSION=4
Expand All @@ -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
Expand Down