Unverified Commit 187d1bff authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

remove allowlist, only use denylist, enable newly passing tests (#50325)

### What?

* remove allowlist
* add script to print enabled test cases
* enable test suites that turbopack is newly passing
parent 25ce787d
......@@ -932,7 +932,7 @@ jobs:
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5]
group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
......@@ -954,7 +954,7 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_EXTERNAL_TESTS_FILTERS=${NEXT_EXTERNAL_TESTS_FILTERS} __INTERNAL_NEXT_DEV_TEST_TURBO_DEV=TRUE __INTERNAL_CUSTOM_TURBOPACK_BINDINGS=${NEXT_BINDINGS_BIN} __INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH=${NEXT_DEV_TEST_GLOB} NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_JOB=1 TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/5 >> /proc/1/fd/1"
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_EXTERNAL_TESTS_FILTERS=${NEXT_EXTERNAL_TESTS_FILTERS} __INTERNAL_NEXT_DEV_TEST_TURBO_DEV=TRUE __INTERNAL_CUSTOM_TURBOPACK_BINDINGS=${NEXT_BINDINGS_BIN} __INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH=${NEXT_DEV_TEST_GLOB} NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_JOB=1 TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/10 >> /proc/1/fd/1"
if: ${{needs.build.outputs.docsChange == 'nope'}}
- name: Upload test trace
......
/// A script that prints a list of test cases that are enabled
const _glob = require('glob')
const { promisify } = require('util')
const glob = promisify(_glob)
const path = require('path')
const { disabledTests } = require('./tests-manifest.js')
const main = async () => {
// Collect all test files
const testFiles = new Set(
(
await glob('**/*.test.{js,ts,tsx}', {
nodir: true,
cwd: path.resolve(__dirname, '../../../../test'),
})
).map((file) => `test/${file}`)
)
for (const testFile of disabledTests) {
testFiles.delete(testFile)
}
for (const testFile of testFiles) {
console.log(testFile)
}
}
main().catch((e) => console.error(e))
/// A script to remove / add next.js tests into the lists if there are any changes.
const fs = require('fs')
const _glob = require('glob')
const { promisify } = require('util')
const glob = promisify(_glob)
const path = require('path')
const generateManifest = (enabledTests, disabledTests) => `
// Tests that are currently enabled with Turbopack in CI.
// This list is not actively used, more of high level pictures of what tests are enabled.
const enabledTests = ${enabledTests}
// Tests that are currently disabled with Turbopack in CI.
// Any tests not listed in here are assumed to be enabled.
const disabledTests = ${disabledTests}
module.exports = {
enabledTests,
disabledTests,
}`
const main = async () => {
// Read existing manifests
let enabledTests = []
let disabledTests = []
const manifestPath = path.resolve(__dirname, 'tests-manifest.js')
if (fs.existsSync(manifestPath)) {
const manifest = require(manifestPath)
enabledTests = manifest.enabledTests
disabledTests = manifest.disabledTests
} else {
throw new Error('Manifest should exists')
}
// Collect all test files
const testFiles = (
await glob('**/*.test.{js,ts,tsx}', {
nodir: true,
cwd: path.resolve(__dirname, '../../../../test'),
})
).map((file) => `test/${file}`)
// Naively update enabled / disabled tests to the latest.
// This is not the most efficient way to do this, but it's good enough for now.
// First, remove enabled tests that are no longer in the test directory.
enabledTests = enabledTests.filter((testFile) => testFiles.includes(testFile))
// Anything else are disabled.
disabledTests = testFiles.filter(
(testFile) => !enabledTests.includes(testFile)
)
fs.writeFileSync(
manifestPath,
generateManifest(
JSON.stringify(enabledTests, null, 2),
JSON.stringify(disabledTests, null, 2)
),
'utf-8'
)
}
main().catch((e) => console.error(e))
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