Skip to content

Commit 3752218

Browse files
authored
refactor(tui): centralize application exit (anomalyco#31524)
1 parent 960eace commit 3752218

32 files changed

Lines changed: 176 additions & 1217 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
6666
- name: Run unit tests
6767
timeout-minutes: 20
68-
run: bun turbo test:ci --log-order=stream --log-prefix=task
68+
run: bun turbo test --output-logs=errors-only --log-order=grouped --log-prefix=task
6969
env:
7070
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }}
7171

@@ -74,26 +74,6 @@ jobs:
7474
working-directory: packages/opencode
7575
run: bun run test:httpapi
7676

77-
- name: Publish unit reports
78-
if: always()
79-
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v6.4.0
80-
with:
81-
report_paths: packages/*/.artifacts/unit/junit.xml
82-
check_name: "unit results (${{ matrix.settings.name }})"
83-
detailed_summary: true
84-
include_time_in_summary: true
85-
fail_on_failure: false
86-
87-
- name: Upload unit artifacts
88-
if: always()
89-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
90-
with:
91-
name: unit-${{ matrix.settings.name }}-${{ github.run_attempt }}
92-
include-hidden-files: true
93-
if-no-files-found: ignore
94-
retention-days: 7
95-
path: packages/*/.artifacts/unit/junit.xml
96-
9777
e2e:
9878
name: e2e (${{ matrix.settings.name }})
9979
strategy:
@@ -151,7 +131,6 @@ jobs:
151131
run: bun --cwd packages/app test:e2e:local
152132
env:
153133
CI: true
154-
PLAYWRIGHT_JUNIT_OUTPUT: e2e/junit-${{ matrix.settings.name }}.xml
155134
timeout-minutes: 30
156135

157136
- name: Upload Playwright artifacts
@@ -162,6 +141,5 @@ jobs:
162141
if-no-files-found: ignore
163142
retention-days: 7
164143
path: |
165-
packages/app/e2e/junit-*.xml
166144
packages/app/e2e/test-results
167145
packages/app/e2e/playwright-report

packages/app/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"build": "vite build",
1919
"serve": "vite preview",
2020
"test": "bun run test:unit",
21-
"test:ci": "mkdir -p .artifacts/unit && bun test --preload ./happydom.ts ./src --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml",
22-
"test:unit": "bun test --preload ./happydom.ts ./src",
21+
"test:unit": "bun test --only-failures --preload ./happydom.ts ./src",
2322
"test:unit:watch": "bun test --watch --preload ./happydom.ts ./src",
2423
"test:e2e": "playwright test",
2524
"test:e2e:local": "playwright test",

packages/app/playwright.config.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ const serverPort = process.env.PLAYWRIGHT_SERVER_PORT ?? "4096"
77
const command = `bun run dev -- --host 0.0.0.0 --port ${port}`
88
const reuse = !process.env.CI
99
const workers = Number(process.env.PLAYWRIGHT_WORKERS ?? (process.env.CI ? 5 : 0)) || undefined
10-
const reporter = [["html", { outputFolder: "e2e/playwright-report", open: "never" }], ["line"]] as const
11-
12-
if (process.env.PLAYWRIGHT_JUNIT_OUTPUT) {
13-
reporter.push(["junit", { outputFile: process.env.PLAYWRIGHT_JUNIT_OUTPUT }])
14-
}
15-
1610
export default defineConfig({
1711
testDir: "./e2e",
1812
outputDir: "./e2e/test-results",
@@ -24,7 +18,7 @@ export default defineConfig({
2418
forbidOnly: !!process.env.CI,
2519
retries: process.env.CI ? 2 : 0,
2620
workers,
27-
reporter,
21+
reporter: [["html", { outputFolder: "e2e/playwright-report", open: "never" }], ["line"]],
2822
webServer: {
2923
command,
3024
url: baseURL,

packages/core/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"db": "bun drizzle-kit",
1010
"migration": "bun run script/migration.ts",
1111
"fix-node-pty": "bun run script/fix-node-pty.ts",
12-
"test": "bun test",
13-
"test:ci": "mkdir -p .artifacts/unit && bun test --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml",
12+
"test": "bun test --only-failures",
1413
"typecheck": "tsgo --noEmit"
1514
},
1615
"bin": {

packages/core/src/flag/flag.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export const Flag = {
4646

4747
OPENCODE_WORKSPACE_ID: process.env["OPENCODE_WORKSPACE_ID"],
4848
OPENCODE_EXPERIMENTAL_WORKSPACES: enabledByExperimental("OPENCODE_EXPERIMENTAL_WORKSPACES"),
49-
OPENCODE_EXPERIMENTAL_SESSION_SWITCHER: enabledByExperimental("OPENCODE_EXPERIMENTAL_SESSION_SWITCHER"),
5049

5150
// Evaluated at access time (not module load) because tests, the CLI, and
5251
// external tooling set these env vars at runtime.

packages/effect-drizzle-sqlite/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"license": "MIT",
77
"private": true,
88
"scripts": {
9-
"test": "bun test --timeout 30000",
10-
"test:ci": "mkdir -p .artifacts/unit && bun test --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml",
9+
"test": "bun test --timeout 30000 --only-failures",
1110
"typecheck": "tsgo --noEmit"
1211
},
1312
"exports": {

packages/http-recorder/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
"access": "public"
2828
},
2929
"scripts": {
30-
"test": "bun test --timeout 30000",
31-
"test:ci": "mkdir -p .artifacts/unit && bun test --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml",
30+
"test": "bun test --timeout 30000 --only-failures",
3231
"typecheck": "tsgo --noEmit",
3332
"build": "bun ./script/build.ts",
3433
"verify:package": "bun ./script/verify-package.ts"

packages/llm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"private": true,
88
"scripts": {
99
"setup:recording-env": "bun run script/setup-recording-env.ts",
10-
"test": "bun test --timeout 30000",
10+
"test": "bun test --timeout 30000 --only-failures",
1111
"typecheck": "tsgo --noEmit"
1212
},
1313
"exports": {

packages/opencode/BUN_SHELL_MIGRATION_PLAN.md

Lines changed: 0 additions & 136 deletions
This file was deleted.

packages/opencode/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"private": true,
88
"scripts": {
99
"typecheck": "tsgo --noEmit",
10-
"test": "bun test --timeout 30000",
11-
"test:ci": "mkdir -p .artifacts/unit && bun test --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml",
10+
"test": "bun test --timeout 30000 --only-failures",
1211
"test:httpapi": "bun run script/httpapi-exercise.ts --mode coverage --fail-on-missing --fail-on-skip && bun run script/httpapi-exercise.ts --mode auth --fail-on-missing --fail-on-skip && bun run script/httpapi-exercise.ts --mode effect --fail-on-missing --fail-on-skip",
1312
"bench:test": "bun run script/bench-test-suite.ts",
1413
"profile:test": "bun run script/profile-test-files.ts",

0 commit comments

Comments
 (0)