GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(ci): register omitted V2 unit suites (#45970) · anomalyco/opencode@51d53f4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .gitattributes
  • packages
    • httpapi-codegen/test
      • generate.test.ts
      • write.test.ts
    • server/test
      • fetch.test.ts
    • session-ui/src
      • import-boundaries.test.ts
  • turbo.json
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.gitattributes‎

Copy file name to clipboardExpand all lines: .gitattributes
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ packages/core/migration/**/snapshot.json linguist-generated
22
packages/core/src/database/migration.gen.ts linguist-generated
33
packages/core/src/models-dev/snapshot.txt linguist-generated
44
packages/core/src/**/*.txt text eol=lf
5+
packages/httpapi-codegen/test/generated/*.ts text eol=lf
Collapse file

‎packages/httpapi-codegen/test/generate.test.ts‎

Copy file name to clipboardExpand all lines: packages/httpapi-codegen/test/generate.test.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { describe, expect, test } from "bun:test"
22
import { mkdtemp, rm } from "node:fs/promises"
33
import { tmpdir } from "node:os"
44
import { join } from "node:path"
5+
import { fileURLToPath } from "node:url"
56
import { Effect, FileSystem, Schema, SchemaAST, SchemaGetter } from "effect"
67
import {
78
HttpApi,
@@ -1096,7 +1097,7 @@ describe("HttpApiCodegen.generate", () => {
10961097
Effect.gen(function* () {
10971098
const output = compile(FixtureApi)
10981099
const actual = yield* Effect.promise(() =>
1099-
Array.fromAsync(new Bun.Glob("*.ts").scan(new URL("generated", import.meta.url).pathname)),
1100+
Array.fromAsync(new Bun.Glob("*.ts").scan(fileURLToPath(new URL("generated", import.meta.url)))),
11001101
)
11011102
expect(actual.sort((a, b) => a.localeCompare(b))).toEqual(
11021103
output.files.map((file) => file.path).sort((a, b) => a.localeCompare(b)),
Collapse file

‎packages/httpapi-codegen/test/write.test.ts‎

Copy file name to clipboardExpand all lines: packages/httpapi-codegen/test/write.test.ts
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { describe, expect } from "bun:test"
2+
import { join } from "node:path"
23
import { Effect, FileSystem, Option } from "effect"
34
import { write, type Output } from "../src"
45
import { it } from "./effect"
@@ -15,8 +16,8 @@ describe("HttpApiCodegen.write", () => {
1516
yield* write(output, "/generated")
1617

1718
expect(writes).toEqual([
18-
{ path: "/generated/session.ts", content: "export const session = {}\n" },
19-
{ path: "/generated/.httpapi-codegen.json", content: '["session.ts"]\n' },
19+
{ path: join("/generated", "session.ts"), content: "export const session = {}\n" },
20+
{ path: join("/generated", ".httpapi-codegen.json"), content: '["session.ts"]\n' },
2021
])
2122
}).pipe(
2223
Effect.provideService(
@@ -55,7 +56,7 @@ describe("HttpApiCodegen.write", () => {
5556
writeFileString: () => Effect.void,
5657
}),
5758
),
58-
Effect.tap(() => Effect.sync(() => expect(removed).toEqual(["/generated/old.ts"]))),
59+
Effect.tap(() => Effect.sync(() => expect(removed).toEqual([join("/generated", "old.ts")]))),
5960
)
6061
})
6162

Collapse file

‎packages/server/test/fetch.test.ts‎

Copy file name to clipboardExpand all lines: packages/server/test/fetch.test.ts
+28-18Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { ServerFetch } from "../src/fetch"
1111
const options = {
1212
app: { version: "test-version" },
1313
database: { path: ":memory:" },
14+
config: { project: false },
1415
models: { fetch: false },
1516
fs: { filewatcher: false },
1617
} as const
@@ -26,15 +27,20 @@ function occupy(port: number, cancel = false) {
2627
server: createServer((request, response) => {
2728
requests.push(request.url ?? "")
2829
response.end(cancel ? "cancelled" : "still running", () => {
29-
if (cancel) servers.forEach((item) => item.server.close())
30+
if (cancel)
31+
servers.forEach((item) => {
32+
// Bun clears its native handle in close(), so force-close connections first.
33+
item.server.closeAllConnections()
34+
item.server.close()
35+
})
3036
})
3137
}),
3238
}))
3339
yield* Effect.addFinalizer(() =>
3440
Effect.forEach(servers, (item) =>
3541
Effect.callback<void>((resume) => {
36-
item.server.close(() => resume(Effect.void))
3742
item.server.closeAllConnections()
43+
item.server.close(() => resume(Effect.void))
3844
}),
3945
),
4046
)
@@ -154,22 +160,26 @@ it.live("falls back to port 1457 when OpenAI OAuth port 1455 remains busy", () =
154160
}),
155161
)
156162

157-
it.live("explains how to recover when both OpenAI OAuth callback ports are busy", () =>
158-
Effect.gen(function* () {
159-
yield* occupy(1455)
160-
yield* occupy(1457)
161-
const handler = yield* ServerFetch.make(options)
162-
yield* ready(handler)
163-
const response = yield* connectOpenAI(handler)
164-
165-
expect(response.status).toBe(400)
166-
expect(yield* Effect.promise(() => response.json())).toEqual({
167-
_tag: "InvalidRequestError",
168-
message:
169-
"OpenAI browser login needs local port 1455 or 1457, but both are already in use. Stop the processes using those ports or choose ChatGPT Pro/Plus (headless), then try again.",
170-
kind: "integration_authorization",
171-
})
172-
}),
163+
it.live(
164+
"explains how to recover when both OpenAI OAuth callback ports are busy",
165+
() =>
166+
Effect.gen(function* () {
167+
yield* occupy(1455)
168+
yield* occupy(1457)
169+
const handler = yield* ServerFetch.make(options)
170+
yield* ready(handler)
171+
const response = yield* connectOpenAI(handler)
172+
173+
expect(response.status).toBe(400)
174+
expect(yield* Effect.promise(() => response.json())).toEqual({
175+
_tag: "InvalidRequestError",
176+
message:
177+
"OpenAI browser login needs local port 1455 or 1457, but both are already in use. Stop the processes using those ports or choose ChatGPT Pro/Plus (headless), then try again.",
178+
kind: "integration_authorization",
179+
})
180+
}),
181+
// Real retries wait 18 * 200 ms; startup and scoped cleanup also count toward the deadline.
182+
{ timeout: 10_000 },
173183
)
174184

175185
it.live("treats destroying a missing workspace as success", () =>
Collapse file

‎packages/session-ui/src/import-boundaries.test.ts‎

Copy file name to clipboard
+18-18Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
import { describe, expect, test } from "bun:test"
2+
import { Effect } from "effect"
23

34
const forbidden = /["']@opencode-ai\/(?:core|sdk|server)(?:\/[^"']*)?["']/
45
const oldSession = /(?:SessionV1|session-v1|legacy-message|legacy-message-values)/
56

67
describe("Session UI package boundaries", () => {
78
test("does not import server runtime packages", async () => {
8-
const files = new Bun.Glob("**/*.{ts,tsx}")
9-
const violations: string[] = []
10-
11-
for await (const path of files.scan({ cwd: import.meta.dir, absolute: true })) {
12-
if (path === import.meta.path) continue
13-
if (forbidden.test(await Bun.file(path).text())) violations.push(path.slice(import.meta.dir.length + 1))
14-
}
15-
16-
expect(violations).toEqual([])
9+
expect(await findViolations(forbidden)).toEqual([])
1710
})
1811

1912
test("does not declare server runtime dependencies", async () => {
@@ -26,15 +19,7 @@ describe("Session UI package boundaries", () => {
2619
})
2720

2821
test("does not contain old Session message boundaries", async () => {
29-
const files = new Bun.Glob("**/*.{ts,tsx}")
30-
const violations: string[] = []
31-
32-
for await (const path of files.scan({ cwd: import.meta.dir, absolute: true })) {
33-
if (path === import.meta.path) continue
34-
if (oldSession.test(await Bun.file(path).text())) violations.push(path.slice(import.meta.dir.length + 1))
35-
}
36-
37-
expect(violations).toEqual([])
22+
expect(await findViolations(oldSession)).toEqual([])
3823
})
3924

4025
test("exports the current Session document surface", async () => {
@@ -49,3 +34,18 @@ describe("Session UI package boundaries", () => {
4934
expect(exports["./timeline/projection"]).toBe("./src/timeline/projection.ts")
5035
})
5136
})
37+
38+
async function findViolations(pattern: RegExp) {
39+
const files = await Array.fromAsync(new Bun.Glob("**/*.{ts,tsx}").scan({ cwd: import.meta.dir, absolute: true }))
40+
const matches = await Effect.runPromise(
41+
Effect.forEach(
42+
files.filter((path) => path !== import.meta.path),
43+
(path) =>
44+
Effect.promise(async () =>
45+
pattern.test(await Bun.file(path).text()) ? path.slice(import.meta.dir.length + 1) : undefined,
46+
),
47+
{ concurrency: 8 },
48+
),
49+
)
50+
return matches.filter((path) => path !== undefined)
51+
}
Collapse file

‎turbo.json‎

Copy file name to clipboardExpand all lines: turbo.json
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
"dependsOn": [],
3535
"outputs": ["dist/**"]
3636
},
37+
"@opencode-ai/ai#test": {
38+
"dependsOn": ["^build"],
39+
"outputs": []
40+
},
3741
"@opencode-ai/codemode#test": {
3842
"dependsOn": ["^build"],
3943
"outputs": []
@@ -45,6 +49,13 @@
4549
"@opencode-ai/function#test": {
4650
"outputs": []
4751
},
52+
"@opencode-ai/httpapi-codegen#test": {
53+
"outputs": []
54+
},
55+
"@opencode-ai/server#test": {
56+
"dependsOn": ["^build"],
57+
"outputs": []
58+
},
4859
"@opencode-ai/cli#test": {
4960
"dependsOn": ["^build"],
5061
"outputs": []

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.