Skip to content

Commit faee02f

Browse files
committed
test: add matrix strategy to run integration tests across multiple Next.js versions
- Add matrix strategy to CI workflow to test against Next.js 15.0.3, 15.3.2, and 15.4.7 - Make test app selection dynamic via NEXT_TEST_APP environment variable - Update integration test paths to use matrix variable instead of hardcoded version
1 parent 06839e8 commit faee02f

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
runs-on: ubuntu-latest
2424
permissions:
2525
pull-requests: write # Grant write access to pull request comments
26+
strategy:
27+
matrix:
28+
next-test-app:
29+
- next-app-15-0-3
30+
- next-app-15-3-2
31+
- next-app-15-4-7
2632

2733
steps:
2834
- name: Checkout code
@@ -59,15 +65,16 @@ jobs:
5965
run: redis-cli config set notify-keyspace-events Exe
6066

6167
- name: Install Integration Test Project
62-
run: cd test/integration/next-app-15-3-2 && pnpm install
68+
run: cd test/integration/${{ matrix.next-test-app }} && pnpm install
6369

6470
- name: Build Integration Test Project
65-
run: cd test/integration/next-app-15-3-2 && pnpm build
71+
run: cd test/integration/${{ matrix.next-test-app }} && pnpm build
6672

6773
- name: Run tests
6874
run: pnpm test
6975
env:
7076
SKIP_BUILD: true
77+
NEXT_TEST_APP: ${{ matrix.next-test-app }}
7178

7279
- name: Code Coverage Comments
7380
if: github.event_name == 'pull_request'

test/integration/nextjs-cache-handler.integration.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import { join } from 'path';
66
import { CacheEntry } from '../../src/RedisStringsHandler';
77
import { revalidate as next1503_revalidatedFetch_route } from './next-app-15-0-3/src/app/api/revalidated-fetch/route';
88

9-
// const NEXT_APP_DIR = join(__dirname, 'next-app-15-0-3');
10-
const NEXT_APP_DIR = join(__dirname, 'next-app-15-4-7');
9+
// Select which Next.js test app to use. Can be overridden via NEXT_TEST_APP env var
10+
// Examples: next-app-15-0-3, next-app-15-3-2, next-app-15-4-7
11+
const NEXT_TEST_APP = process.env.NEXT_TEST_APP || 'next-app-15-4-7';
12+
const NEXT_APP_DIR = join(__dirname, NEXT_TEST_APP);
1113
console.log('NEXT_APP_DIR', NEXT_APP_DIR);
1214
const NEXT_START_PORT = 3055;
1315
const NEXT_START_URL = `http://localhost:${NEXT_START_PORT}`;

0 commit comments

Comments
 (0)