Unverified Commit 033bc32c authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[ci] Remove the broken Test examples workflow and its test suite (#98517)

Removes the `Test examples` workflow and its orphaned test suite. The
workflow fails every scheduled run: its pinned Playwright docker image
(v1.35.1) is incompatible with the Playwright version the repo now
requires (v1.61.0), so the browser cannot launch. It also no longer runs
what it was created for: since the `run-tests.js` glob root moved from
`test/` to the repository root, the `--type examples` string-prefix
filter `examples/` matches test files inside example apps instead of
`test/examples/examples.test.ts`, leaving that suite without any runner.

This deletes `.github/workflows/test_examples.yml`, the `test/examples/`
suite, and the `--type examples` filter in `run-tests.js`. The
`examples/` prefix stays in the default-run exclusion list so test files
inside example apps (which run with each example's own jest/vitest
setup) are still not picked up by bare `run-tests.js` invocations.
Co-authored-by: 's avatarClaude Code <noreply@anthropic.com>
parent 1a295a63
# This file duplicates bunch of things from build_test_deploy
on:
workflow_dispatch:
inputs:
is_dispatched:
description: 'Leave this option enabled'
required: true
default: true
type: boolean
schedule:
- cron: '0 */4 * * *'
name: Test examples
jobs:
testExamples:
# Don't execute using cron on forks
if: (github.repository == 'vercel/next.js') || (inputs.is_dispatched == true)
name: Test Examples
runs-on: ubuntu-latest
timeout-minutes: 120
env:
NEXT_TELEMETRY_DISABLED: 1
# This job runs `pnpm build` (JS only) and runs the example apps, so it
# needs the published next-swc binary. Opt back into the download since CI
# skips it by default (see scripts/install-native.mjs).
NEXT_SKIP_NATIVE_POSTINSTALL: 0
strategy:
fail-fast: false
matrix:
node: [20, 22]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 25
persist-credentials: false
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .node-version
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- run: pnpm install
- run: pnpm build
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.35.1-focal /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && corepack enable > /dev/null && NEXT_TEST_JOB=1 NEXT_TEST_MODE=start xvfb-run node run-tests.js --type examples >> /proc/1/fd/1"
name: Run test/examples
...@@ -244,7 +244,6 @@ const testFilters = { ...@@ -244,7 +244,6 @@ const testFilters = {
development: new RegExp('^(test/(development|e2e))'), development: new RegExp('^(test/(development|e2e))'),
production: new RegExp('^(test/(production|e2e))'), production: new RegExp('^(test/(production|e2e))'),
unit: new RegExp('^(test/unit|packages/.*/src|packages/next-codemod)'), unit: new RegExp('^(test/unit|packages/.*/src|packages/next-codemod)'),
examples: 'examples/',
e2e: 'test/e2e/', e2e: 'test/e2e/',
} }
...@@ -255,7 +254,9 @@ const mockTrace = () => ({ ...@@ -255,7 +254,9 @@ const mockTrace = () => ({
}) })
// which types we have configured to run separate // which types we have configured to run separate
const configuredTestTypes = Object.values(testFilters) // `examples/` additionally excludes test files inside example apps, which run
// with each example's own jest/vitest setup instead of this runner.
const configuredTestTypes = [...Object.values(testFilters), 'examples/']
/** @type {Map<string, { output: string, failedCases: string[] }>} */ /** @type {Map<string, { output: string, failedCases: string[] }>} */
const errorsPerTests = new Map() const errorsPerTests = new Map()
......
import { nextTestSetup } from 'e2e-utils'
import path from 'path'
import fs from 'fs-extra'
const testedExamples = [
// Internal features
'active-class-name',
'api-routes-cors',
'api-routes-middleware',
'api-routes-rest',
'basic-css',
'blog',
'blog-starter',
'custom-server',
'hello-world',
'i18n-routing',
'i18n-routing-pages',
'image-component',
'mdx',
'next-forms',
'remove-console',
'reproduction-template',
'with-absolute-imports',
'with-context-api',
'with-shallow-routing',
'with-sitemap',
'with-typescript',
'with-typescript-types',
'with-web-worker',
'with-webassembly',
// Library integrations that we can't break
'mdx-pages',
'mdx-remote',
'with-jest',
'with-jest-babel',
'with-turbopack',
]
describe.each(testedExamples)(`example '%s'`, (example) => {
// If there is an issue during a build, jest won't tell us which example caused it
// we need to log it ourselfs
beforeAll(() => {
require('console').log(`Running example '${example}'`)
})
const exampleFiles = path.join(__dirname, '..', '..', 'examples', example)
const packageJson = fs.readJsonSync(path.join(exampleFiles, 'package.json'))
describe(`example '${example}'`, () => {
nextTestSetup({
files: exampleFiles,
dependencies: {
// We need to make sure that these default dependencies are not installed by default
// for our examples to ensure that they have all their dependencies in package.json
'@types/node': undefined,
'@types/react': undefined,
next: undefined,
react: undefined,
'react-dom': undefined,
typescript: undefined,
...packageJson.dependencies,
...packageJson.devDependencies,
},
})
it('builds', () => {})
})
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment