Skip to content

Commit

Permalink
ci(test): enable turbopack test
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed May 8, 2023
1 parent 660d531 commit 24d6448
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -822,16 +822,12 @@ jobs:
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
# Enabling backtrace will makes snapshot tests fail
RUST_BACKTRACE: 0
# Path to the custom next-swc bindings located in **docker container** image.
# Path to the custom next-swc bindings.
NEXT_BINDINGS_BIN: /work/packages/next-swc/native/next-swc.linux-x64-gnu.node
# Glob pattern to run specific tests with --turbo.
NEXT_DEV_TEST_GLOB: '*'
# List of test files to run with turbopack as blocking CI check.
# [TODO]: as list grows we should consider different way to manage this.
TEST_FILES_LIST: |
test/development/acceptance-app/dynamic-error.test.ts \
test/development/acceptance-app/unsupported-app-features.test.ts \
test/development/acceptance-app/ReactRefresh.test.ts
NEXT_EXTERNAL_TESTS_FILTERS: /work/packages/next-swc/crates/next-dev-tests/tests-manifest.json

strategy:
fail-fast: false
steps:
Expand Down
5 changes: 5 additions & 0 deletions packages/next-swc/crates/next-dev-tests/tests-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
"test/development/acceptance-app/dynamic-error.test.ts",
"test/development/acceptance-app/unsupported-app-features.test.ts",
"test/development/acceptance-app/ReactRefresh.test.ts"
]
9 changes: 8 additions & 1 deletion run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const { createNextInstall } = require('./test/lib/create-next-install')
const glob = promisify(_glob)
const exec = promisify(execOrig)

// Try to read an external array-based json to filter tests to be executed.
// If process.argv contains a test to be executed, this'll append it to the list.
const externalTestsFilterLists = process.env.NEXT_EXTERNAL_TESTS_FILTERS
? require(process.env.NEXT_EXTERNAL_TESTS_FILTERS)
: []
const timings = []
const DEFAULT_NUM_RETRIES = os.platform() === 'win32' ? 2 : 1
const DEFAULT_CONCURRENCY = 2
Expand Down Expand Up @@ -138,7 +143,9 @@ async function main() {

console.log('Running tests with concurrency:', concurrency)

let tests = process.argv.filter((arg) => arg.match(/\.test\.(js|ts|tsx)/))
let tests = process.argv
.filter((arg) => arg.match(/\.test\.(js|ts|tsx)/))
.concat(externalTestsFilterLists)
let prevTimings

if (tests.length === 0) {
Expand Down

0 comments on commit 24d6448

Please sign in to comment.