Skip to content

Commit 0ec214b

Browse files
committed
test(napi): compile tests in debug mode (#12750)
Compile NAPI tests in debug mode (not release mode), to speed up build in CI. Only exception is `napi/parser` which is compiled with `--profile coverage`. The tests for this package are quite slow, so they'd take too long if package was compiled with no optimizations. `coverage` profile is closer to `--release`, but enables debug assertions, and has somewhat faster compilation (`-O 2` not `-O 3` etc). In CI: * Build time reduced by 1m30s. * Test run time increased by 30s. * Total reduction in CI time: 1 minute. NAPI tests are still the slowest task in CI by a long margin. Trimming a minute off the time is something, but this task is still too slow.
1 parent 89276b4 commit 0ec214b

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

napi/minify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"browser": "browser.js",
66
"scripts": {
77
"build-dev": "napi build --platform",
8-
"build-test": "pnpm run build",
8+
"build-test": "pnpm run build-dev",
99
"build": "pnpm run build-dev --features allocator --release",
1010
"postbuild-dev": "node patch.mjs",
1111
"test": "tsc && vitest run --dir ./test"

napi/oxlint2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build-dev": "pnpm run build-napi && pnpm run build-js",
99
"build-test": "pnpm run build-napi-test && pnpm run build-js",
1010
"build-napi": "napi build --platform --js ./bindings.js --dts ./bindings.d.ts --output-dir src-js --no-dts-cache --esm",
11-
"build-napi-test": "pnpm run build-napi --profile coverage --features force_test_reporter",
11+
"build-napi-test": "pnpm run build-napi --features force_test_reporter",
1212
"build-napi-release": "pnpm run build-napi --release",
1313
"build-js": "node scripts/build.js",
1414
"test": "tsc && vitest --dir ./test run"

napi/parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"browser": "wasm.mjs",
66
"scripts": {
77
"build-dev": "napi build --platform --js bindings.js",
8-
"build-test": "pnpm run build",
8+
"build-test": "pnpm run build-dev --profile coverage",
99
"build": "pnpm run build-dev --features allocator --release",
1010
"postbuild-dev": "node patch.mjs",
1111
"build-wasi": "pnpm run build-dev --release --target wasm32-wasip1-threads",

napi/playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"scripts": {
1616
"build-dev": "napi build --platform --target wasm32-wasip1-threads && node patch.mjs",
17-
"build-test": "pnpm run build",
17+
"build-test": "pnpm run build-dev",
1818
"build": "napi build --platform --release --target wasm32-wasip1-threads && node patch.mjs"
1919
},
2020
"dependencies": {

napi/transform/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"browser": "browser.js",
66
"scripts": {
77
"build-dev": "napi build --platform",
8-
"build-test": "pnpm run build",
8+
"build-test": "pnpm run build-dev",
99
"build": "pnpm run build-dev --features allocator --release",
1010
"postbuild-dev": "node patch.mjs",
1111
"test": "tsc && vitest run --dir ./test"

0 commit comments

Comments
 (0)