Skip to content

test: address site root warning #3020

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
305 changes: 155 additions & 150 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,84 +41,84 @@ jobs:
echo "matrix=[\"latest\"]" >> $GITHUB_OUTPUT
fi

e2e:
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.setup.outputs.matrix) }}
shard: [1, 2, 3, 4, 5]
# e2e:
# needs: setup
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# version: ${{ fromJson(needs.setup.outputs.matrix) }}
# shard: [1, 2, 3, 4, 5]

steps:
- uses: actions/checkout@v4
- name: 'Install Node'
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- uses: oven-sh/setup-bun@v2
- name: setup pnpm/yarn
run: |
npm install -g corepack
corepack enable
shell: bash
- name: Install Deno
uses: denoland/setup-deno@v1
with:
# Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
deno-version: v1.46.3
- name: 'Install dependencies'
run: npm ci
- name: 'Prepare Netlify CLI'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
# Control netlify-cli as a regular dev dep but expose it globally for test fixtures to use
npm install -g "netlify-cli@$(npm list --json --depth=0 netlify-cli | jq -r ".dependencies[\"netlify-cli\"].version")"
npx netlify login
- name: Get installed Playwright version
id: playwright-version
run: echo "version=$(npm view @playwright/test version)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: playwright-cache
with:
path: '~/.cache/ms-playwright'
key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}'
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Resolve Next.js version
id: resolve-next-version
shell: bash
run: |
RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
- name: Run Playwright tests
run: npm run test:ci:e2e -- --shard=${{ matrix.shard }}/5
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NEXT_VERSION: ${{ matrix.version }}
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
- name: Upload blob report to GitHub Actions Artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: blob-report-${{matrix.version}}-${{ matrix.shard }}
path: blob-report
retention-days: 1
# steps:
# - uses: actions/checkout@v4
# - name: 'Install Node'
# uses: actions/setup-node@v4
# with:
# node-version: '18.x'
# cache: 'npm'
# cache-dependency-path: '**/package-lock.json'
# - uses: oven-sh/setup-bun@v2
# - name: setup pnpm/yarn
# run: |
# npm install -g corepack
# corepack enable
# shell: bash
# - name: Install Deno
# uses: denoland/setup-deno@v1
# with:
# # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
# deno-version: v1.46.3
# - name: 'Install dependencies'
# run: npm ci
# - name: 'Prepare Netlify CLI'
# env:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# run: |
# # Control netlify-cli as a regular dev dep but expose it globally for test fixtures to use
# npm install -g "netlify-cli@$(npm list --json --depth=0 netlify-cli | jq -r ".dependencies[\"netlify-cli\"].version")"
# npx netlify login
# - name: Get installed Playwright version
# id: playwright-version
# run: echo "version=$(npm view @playwright/test version)" >> $GITHUB_OUTPUT
# - uses: actions/cache@v4
# id: playwright-cache
# with:
# path: '~/.cache/ms-playwright'
# key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}'
# restore-keys: |
# ${{ runner.os }}-playwright-
# - name: Install Playwright Browsers
# if: steps.playwright-cache.outputs.cache-hit != 'true'
# run: npx playwright install --with-deps
# - name: Resolve Next.js version
# id: resolve-next-version
# shell: bash
# run: |
# RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
# echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
# echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
# - name: Run Playwright tests
# run: npm run test:ci:e2e -- --shard=${{ matrix.shard }}/5
# env:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# NEXT_VERSION: ${{ matrix.version }}
# NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
# - name: Upload blob report to GitHub Actions Artifacts
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: blob-report-${{matrix.version}}-${{ matrix.shard }}
# path: blob-report
# retention-days: 1

test:
needs: setup
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8]
os: [ubuntu-latest, windows-2025]
shard: [2]
os: [ubuntu-latest]
version: ${{ fromJson(needs.setup.outputs.matrix) }}
exclude:
- os: windows-2025
Expand All @@ -128,6 +128,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
limit-access-to-actor: true
- name: 'Install Node'
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -195,87 +200,87 @@ jobs:
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
TEMP: ${{ github.workspace }}/..

smoke:
if: always()
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.setup.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: 'Install Node'
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: setup pnpm/yarn
run: corepack enable
shell: bash
- name: Install Deno
uses: denoland/setup-deno@v1
with:
# Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
deno-version: v1.46.3
- name: 'Install dependencies'
run: npm ci
- name: 'Build'
run: npm run build
- name: 'Prepare Netlify CLI'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
# Control netlify-cli as a regular dev dep but expose it globally for test fixtures to use
npm install -g "netlify-cli@$(npm list --json --depth=0 netlify-cli | jq -r ".dependencies[\"netlify-cli\"].version")"
npx netlify login
- name: Resolve Next.js version
id: resolve-next-version
shell: bash
run: |
RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
- name: 'Smoke tests'
run: npm run test:ci:smoke
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NEXT_VERSION: ${{ matrix.version }}
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
# smoke:
# if: always()
# needs: setup
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# version: ${{ fromJson(needs.setup.outputs.matrix) }}
# steps:
# - uses: actions/checkout@v4
# - name: 'Install Node'
# uses: actions/setup-node@v4
# with:
# node-version: '18.x'
# cache: 'npm'
# cache-dependency-path: '**/package-lock.json'
# - name: setup pnpm/yarn
# run: corepack enable
# shell: bash
# - name: Install Deno
# uses: denoland/setup-deno@v1
# with:
# # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
# deno-version: v1.46.3
# - name: 'Install dependencies'
# run: npm ci
# - name: 'Build'
# run: npm run build
# - name: 'Prepare Netlify CLI'
# env:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# run: |
# # Control netlify-cli as a regular dev dep but expose it globally for test fixtures to use
# npm install -g "netlify-cli@$(npm list --json --depth=0 netlify-cli | jq -r ".dependencies[\"netlify-cli\"].version")"
# npx netlify login
# - name: Resolve Next.js version
# id: resolve-next-version
# shell: bash
# run: |
# RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
# echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
# echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
# - name: 'Smoke tests'
# run: npm run test:ci:smoke
# env:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# NEXT_VERSION: ${{ matrix.version }}
# NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}

merge-reports:
if: always()
needs: [setup,e2e]
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.setup.outputs.matrix) }}
# merge-reports:
# if: always()
# needs: [setup,e2e]
# strategy:
# fail-fast: false
# matrix:
# version: ${{ fromJson(needs.setup.outputs.matrix) }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm ci
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 18
# - name: Install dependencies
# run: npm ci

- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-${{ matrix.version }}-*
merge-multiple: true
# - name: Download blob reports from GitHub Actions Artifacts
# uses: actions/download-artifact@v4
# with:
# path: all-blob-reports
# pattern: blob-report-${{ matrix.version }}-*
# merge-multiple: true

- name: Merge reports
run: |
npx playwright merge-reports --reporter html ./all-blob-reports
npx playwright merge-reports --reporter json ./all-blob-reports > merged_reports.json
# - name: Merge reports
# run: |
# npx playwright merge-reports --reporter html ./all-blob-reports
# npx playwright merge-reports --reporter json ./all-blob-reports > merged_reports.json

- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report-${{ matrix.version }}-attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14
# - name: Upload HTML report
# uses: actions/upload-artifact@v4
# with:
# name: html-report-${{ matrix.version }}-attempt-${{ github.run_attempt }}
# path: playwright-report
# retention-days: 14
2 changes: 2 additions & 0 deletions tests/fixtures/advanced-api-routes/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const nextConfig = {
ignoreDuringBuilds: true,
},
generateBuildId: () => 'build-id',
// https://github.com/vercel/next.js/issues/81864
outputFileTracingRoot: __dirname,
}

module.exports = nextConfig
2 changes: 2 additions & 0 deletions tests/fixtures/after/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
// https://github.com/vercel/next.js/issues/81864
outputFileTracingRoot: __dirname,
}

module.exports = nextConfig
2 changes: 2 additions & 0 deletions tests/fixtures/base-path/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
// https://github.com/vercel/next.js/issues/81864
outputFileTracingRoot: __dirname,
}

module.exports = nextConfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
// https://github.com/vercel/next.js/issues/81864
outputFileTracingRoot: __dirname,
}

module.exports = nextConfig
2 changes: 2 additions & 0 deletions tests/fixtures/dist-dir/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
// https://github.com/vercel/next.js/issues/81864
outputFileTracingRoot: __dirname,
}

module.exports = nextConfig
2 changes: 2 additions & 0 deletions tests/fixtures/dynamic-cms/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const nextConfig = {
defaultLocale: 'en',
},
generateBuildId: () => 'build-id',
// https://github.com/vercel/next.js/issues/81864
outputFileTracingRoot: __dirname,
}

module.exports = nextConfig
Loading
Loading