mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 04:49:06 +00:00
Move test runner
This commit is contained in:
@@ -99,7 +99,7 @@ steps:
|
||||
- "logs/*"
|
||||
- "summary.md"
|
||||
command:
|
||||
- "node packages/bun-internal-test/src/runner.node.mjs bun-darwin-aarch64"
|
||||
- "node test/runner.node.mjs bun-darwin-aarch64"
|
||||
|
||||
- key: "build-darwin-x64-ci"
|
||||
group: ":darwin: x64"
|
||||
@@ -198,7 +198,7 @@ steps:
|
||||
- "logs/*"
|
||||
- "summary.md"
|
||||
command:
|
||||
- "node packages/bun-internal-test/src/runner.node.mjs bun-darwin-x64"
|
||||
- "node test/runner.node.mjs bun-darwin-x64"
|
||||
|
||||
- key: "build-darwin-x64-baseline-ci"
|
||||
group: ":darwin: x64-baseline"
|
||||
@@ -297,7 +297,7 @@ steps:
|
||||
- "logs/*"
|
||||
- "summary.md"
|
||||
command:
|
||||
- "node packages/bun-internal-test/src/runner.node.mjs bun-darwin-x64-baseline"
|
||||
- "node test/runner.node.mjs bun-darwin-x64-baseline"
|
||||
|
||||
- key: "build-linux-aarch64-ci"
|
||||
group: ":linux: aarch64"
|
||||
@@ -396,7 +396,7 @@ steps:
|
||||
- "logs/*"
|
||||
- "summary.md"
|
||||
command:
|
||||
- "node packages/bun-internal-test/src/runner.node.mjs bun-linux-aarch64"
|
||||
- "node test/runner.node.mjs bun-linux-aarch64"
|
||||
|
||||
- key: "build-linux-x64-ci"
|
||||
group: ":linux: x64"
|
||||
@@ -495,7 +495,7 @@ steps:
|
||||
- "logs/*"
|
||||
- "summary.md"
|
||||
command:
|
||||
- "node packages/bun-internal-test/src/runner.node.mjs bun-linux-x64"
|
||||
- "node test/runner.node.mjs bun-linux-x64"
|
||||
|
||||
- key: "build-linux-x64-baseline-ci"
|
||||
group: ":linux: x64-baseline"
|
||||
@@ -594,7 +594,7 @@ steps:
|
||||
- "logs/*"
|
||||
- "summary.md"
|
||||
command:
|
||||
- "node packages/bun-internal-test/src/runner.node.mjs bun-linux-x64-baseline"
|
||||
- "node test/runner.node.mjs bun-linux-x64-baseline"
|
||||
|
||||
- key: "build-windows-x64-ci"
|
||||
group: ":windows: x64"
|
||||
@@ -690,7 +690,7 @@ steps:
|
||||
env:
|
||||
CHERE_INVOKING: "1"
|
||||
command:
|
||||
- 'C:\\cygwin64\\bin\\bash --login -c ''node packages/bun-internal-test/src/runner.node.mjs bun-windows-x64'''
|
||||
- 'C:\\cygwin64\\bin\\bash --login -c ''node test/runner.node.mjs bun-windows-x64'''
|
||||
|
||||
- key: "build-windows-x64-baseline-ci"
|
||||
group: ":windows: x64-baseline"
|
||||
@@ -786,4 +786,4 @@ steps:
|
||||
env:
|
||||
CHERE_INVOKING: "1"
|
||||
command:
|
||||
- 'C:\\cygwin64\\bin\\bash --login -c ''node packages/bun-internal-test/src/runner.node.mjs bun-windows-x64-baseline'''
|
||||
- 'C:\\cygwin64\\bin\\bash --login -c ''node test/runner.node.mjs bun-windows-x64-baseline'''
|
||||
|
||||
9
.github/workflows/run-test.yml
vendored
9
.github/workflows/run-test.yml
vendored
@@ -37,7 +37,6 @@ jobs:
|
||||
package.json
|
||||
bun.lockb
|
||||
test
|
||||
packages/bun-internal-test
|
||||
packages/bun-types
|
||||
- name: Setup Environment
|
||||
shell: bash
|
||||
@@ -88,12 +87,6 @@ jobs:
|
||||
bun install --cwd test
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Install Dependencies (runner)
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
bun install --cwd packages/bun-internal-test
|
||||
- name: Run Tests
|
||||
id: test
|
||||
timeout-minutes: 90
|
||||
@@ -111,7 +104,7 @@ jobs:
|
||||
SHELLOPTS: igncr
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
node packages/bun-internal-test/src/runner.node.mjs $(which bun)
|
||||
node test/runner.node.mjs $(which bun)
|
||||
- if: ${{ always() }}
|
||||
name: Upload Results
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
8
.vscode/launch.json
generated
vendored
8
.vscode/launch.json
generated
vendored
@@ -445,8 +445,8 @@
|
||||
"request": "launch",
|
||||
"name": "bun test [*] (ci)",
|
||||
"program": "node",
|
||||
"args": ["src/runner.node.mjs"],
|
||||
"cwd": "${workspaceFolder}/packages/bun-internal-test",
|
||||
"args": ["test/runner.node.mjs"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole",
|
||||
},
|
||||
// Windows: bun test [file]
|
||||
@@ -1093,8 +1093,8 @@
|
||||
"request": "launch",
|
||||
"name": "Windows: bun test [*] (ci)",
|
||||
"program": "node",
|
||||
"args": ["src/runner.node.mjs"],
|
||||
"cwd": "${workspaceFolder}/packages/bun-internal-test",
|
||||
"args": ["test/runner.node.mjs"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole",
|
||||
},
|
||||
],
|
||||
|
||||
30
package.json
30
package.json
@@ -5,23 +5,23 @@
|
||||
"./packages/bun-types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@vscode/debugadapter": "^1.61.0",
|
||||
"esbuild": "^0.17.15",
|
||||
"eslint": "^8.20.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"mitata": "^0.1.3",
|
||||
"@vscode/debugadapter": "^1.65.0",
|
||||
"esbuild": "^0.21.4",
|
||||
"eslint": "^9.4.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"mitata": "^0.1.11",
|
||||
"peechy": "0.4.34",
|
||||
"prettier": "^3.2.5",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"source-map-js": "^1.0.2",
|
||||
"typescript": "^5.0.2"
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"source-map-js": "^1.2.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "^1.1.2",
|
||||
"@types/react": "^18.0.25",
|
||||
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
||||
"@typescript-eslint/parser": "^5.31.0"
|
||||
"@types/bun": "^1.1.3",
|
||||
"@types/react": "^18.3.3",
|
||||
"@typescript-eslint/eslint-plugin": "^7.11.0",
|
||||
"@typescript-eslint/parser": "^7.11.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"bun-types": "workspace:packages/bun-types"
|
||||
@@ -43,8 +43,8 @@
|
||||
"fmt:zig": "zig fmt src/*.zig src/*/*.zig src/*/*/*.zig src/*/*/*/*.zig",
|
||||
"lint": "eslint './**/*.d.ts' --cache",
|
||||
"lint:fix": "eslint './**/*.d.ts' --cache --fix",
|
||||
"test": "node packages/bun-internal-test/src/runner.node.mjs ./build/bun-debug",
|
||||
"test:release": "node packages/bun-internal-test/src/runner.node.mjs ./build-release/bun",
|
||||
"test": "node test/runner.node.mjs ./build/bun-debug",
|
||||
"test:release": "node test/runner.node.mjs ./build-release/bun",
|
||||
"zig-check": ".cache/zig/zig.exe build check --summary new",
|
||||
"zig-check-all": ".cache/zig/zig.exe build check-all --summary new",
|
||||
"zig": ".cache/zig/zig.exe "
|
||||
|
||||
6
packages/bun-internal-test/src/runner.node.mjs → test/runner.node.mjs
Normal file → Executable file
6
packages/bun-internal-test/src/runner.node.mjs → test/runner.node.mjs
Normal file → Executable file
@@ -1,3 +1,5 @@
|
||||
#! /usr/bin/env node
|
||||
|
||||
import { spawn, spawnSync } from "node:child_process";
|
||||
import {
|
||||
readFileSync,
|
||||
@@ -72,7 +74,7 @@ async function runTests(target) {
|
||||
|
||||
let results = {};
|
||||
for (const testPath of tests.slice(firstTest, lastTest)) {
|
||||
const title = relative(cwd, join(testsPath, testPath));
|
||||
const title = relative(cwd, join(testsPath, testPath)).replace(/\\/g, "/");
|
||||
const result = await runAndReportTest({ cwd, execPath, testPath, tmpPath: tmp });
|
||||
results[title] = result;
|
||||
}
|
||||
@@ -129,12 +131,14 @@ async function runTest({ cwd, execPath, testPath, tmpPath }) {
|
||||
[isWindows ? "TEMP" : "TMPDIR"]: tmp,
|
||||
GITHUB_ACTIONS: "true", // always true so annotations are parsed
|
||||
FORCE_COLOR: "1",
|
||||
IS_BUN_CI: "1",
|
||||
BUN_FEATURE_FLAG_INTERNAL_FOR_TESTING: "1",
|
||||
BUN_DEBUG_QUIET_LOGS: "1",
|
||||
BUN_GARBAGE_COLLECTOR_LEVEL: "1",
|
||||
BUN_ENABLE_CRASH_REPORTING: "1",
|
||||
BUN_RUNTIME_TRANSPILER_CACHE_PATH: "0",
|
||||
BUN_INSTALL_CACHE_DIR: join(tmp, "cache"),
|
||||
SHELLOPTS: "igncr",
|
||||
},
|
||||
});
|
||||
let doneCalls = 0;
|
||||
Reference in New Issue
Block a user