Skip to content

Commit 90458ed

Browse files
committed
Merge branch 'fix/fork-test-suite' into fix/linked-launch-inherits-mode
Brings in #4's remaining test fixes (f0924f6), so this PR's CI runs against a green base. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01A1D6J2UMPo7YBWQFvbg1br
2 parents c8a2539 + f0924f6 commit 90458ed

7 files changed

Lines changed: 50 additions & 8 deletions

File tree

‎apps/server/src/auth/EnvironmentAuth.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,12 +580,15 @@ it.layer(NodeServices.layer)("EnvironmentAuth.layer", (it) => {
580580
origin: "https://box.tail1234.ts.net",
581581
"x-forwarded-host": "box.tail1234.ts.net",
582582
});
583-
yield* upgrade({ origin: "t3code://app" });
583+
yield* upgrade({ origin: "synthos://app" });
584+
yield* upgrade({ origin: "synthos-dev://app" });
584585
yield* upgrade({ origin: "http://localhost:5733" });
585586
yield* upgrade({});
586587

587588
const otherPort = yield* Effect.flip(upgrade({ origin: "http://192.168.1.50:8080" }));
588589
expect(otherPort._tag).toBe("ServerAuthInvalidCredentialError");
590+
const upstreamDesktop = yield* Effect.flip(upgrade({ origin: "t3code://app" }));
591+
expect(upstreamDesktop._tag).toBe("ServerAuthInvalidCredentialError");
589592
const opaque = yield* Effect.flip(upgrade({ origin: "null" }));
590593
expect(opaque._tag).toBe("ServerAuthInvalidCredentialError");
591594
}).pipe(

‎apps/server/src/cli/pair.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ describe("auth scope options", () => {
478478
if (!CliError.isCliError(error) || error._tag !== "ShowHelp") {
479479
assert.fail(`Expected ShowHelp, got ${String(error)}`);
480480
}
481-
assert.deepEqual(error.commandPath, ["t3", ...command]);
481+
assert.deepEqual(error.commandPath, ["gch", ...command]);
482482
const scopeError = error.errors[0];
483483
if (scopeError?._tag !== "InvalidValue") {
484484
assert.fail(`Expected InvalidValue, got ${String(scopeError?._tag)}`);

‎apps/server/src/persistence/reconcileV2PreviewMigration.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ describe("V2 preview upgrade", () => {
5252
[70, "PeerLinks"],
5353
[71, "PeerLinkFence"],
5454
[72, "WaitingLinkRequestIndex"],
55+
[73, "SynthosWorkflows"],
56+
[74, "SynthosConnections"],
57+
[75, "SynthosPolicySnapshots"],
58+
[76, "SynthosKnowledge"],
59+
[77, "SynthosProfiles"],
60+
[78, "SynthosContext"],
61+
[79, "SynthosGraph"],
62+
[80, "SynthosToolProbes"],
5563
]);
5664
assert.deepStrictEqual(yield* runMigrations(), []);
5765
assert.deepStrictEqual(yield* sql`SELECT * FROM orchestration_v2_legacy_imports`, imports);
@@ -147,6 +155,14 @@ describe("V2 preview upgrade", () => {
147155
[70, "PeerLinks"],
148156
[71, "PeerLinkFence"],
149157
[72, "WaitingLinkRequestIndex"],
158+
[73, "SynthosWorkflows"],
159+
[74, "SynthosConnections"],
160+
[75, "SynthosPolicySnapshots"],
161+
[76, "SynthosKnowledge"],
162+
[77, "SynthosProfiles"],
163+
[78, "SynthosContext"],
164+
[79, "SynthosGraph"],
165+
[80, "SynthosToolProbes"],
150166
]);
151167
}).pipe(Effect.provide(NodeSqliteClient.layer({ filename: ":memory:" }))),
152168
);

‎apps/server/src/testUtils/gitConfig.setup.ts‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,25 @@ const entries: ReadonlyArray<readonly [key: string, value: string]> = [
88
["init.defaultBranch", "main"],
99
];
1010

11-
const existing = Number(process.env.GIT_CONFIG_COUNT ?? "0");
12-
process.env.GIT_CONFIG_COUNT = String(existing + entries.length);
13-
entries.forEach(([key, value], index) => {
14-
process.env[`GIT_CONFIG_KEY_${existing + index}`] = key;
15-
process.env[`GIT_CONFIG_VALUE_${existing + index}`] = value;
11+
// Inherited url.<base>.insteadOf rewrites change the remote URLs git reports back for fixtures.
12+
// Sandboxed shells inject them through env, and git has no setting that cancels one, so drop them.
13+
const isUrlRewrite = (key: string) => /^url\..+\.(?:push)?insteadof$/i.test(key);
14+
const inherited = Array.from(
15+
{ length: Number(process.env.GIT_CONFIG_COUNT ?? "0") },
16+
(_, index) => {
17+
const entry = [
18+
process.env[`GIT_CONFIG_KEY_${index}`] ?? "",
19+
process.env[`GIT_CONFIG_VALUE_${index}`] ?? "",
20+
] as const;
21+
delete process.env[`GIT_CONFIG_KEY_${index}`];
22+
delete process.env[`GIT_CONFIG_VALUE_${index}`];
23+
return entry;
24+
},
25+
);
26+
27+
const config = [...inherited.filter(([key]) => !isUrlRewrite(key)), ...entries];
28+
process.env.GIT_CONFIG_COUNT = String(config.length);
29+
config.forEach(([key, value], index) => {
30+
process.env[`GIT_CONFIG_KEY_${index}`] = key;
31+
process.env[`GIT_CONFIG_VALUE_${index}`] = value;
1632
});

‎packages/source-control-github/src/server/GitHubRest.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as Tracer from "effect/Tracer";
88
import { ChildProcessSpawner } from "effect/process";
99
import { VcsProcessTimeoutError } from "@t3tools/contracts";
1010
import { HttpClient, HttpClientResponse, type HttpClientRequest } from "effect/http";
11+
import * as HostProcess from "@t3tools/shared/HostProcess";
1112

1213
import * as GitHubRest from "./GitHubRest.ts";
1314
import * as GitHubRequestPolicy from "./GitHubRequestPolicy.ts";
@@ -246,6 +247,8 @@ describe("GitHubCredentials", () => {
246247
const credentialsWith = (run: SourceControlHost.SourceControlHost["Service"]["process"]["run"]) =>
247248
GitHubCredentials.layer.pipe(
248249
Layer.provide(TestSourceControlHost.layer({ process: { run } })),
250+
// An ambient GH_TOKEN or GITHUB_TOKEN outranks gh, so these cases would never reach it.
251+
Layer.provide(Layer.succeed(HostProcess.Environment, {})),
249252
Layer.provide(NodeCrypto.layer),
250253
Layer.provide(Layer.succeed(HttpClient.HttpClient, unexpectedHttp)),
251254
);

‎scripts/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "module",
55
"scripts": {
66
"typecheck": "tsc --noEmit",
7-
"test": "vp test run --config ../vite.config.ts --dir ."
7+
"test": "vp test run --config ../vite.config.ts --dir . && node --test synthos-companion/*.test.mjs synthos-service/*.test.mjs"
88
},
99
"dependencies": {
1010
"@effect/platform-node": "catalog:",

‎vite.config.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ const TEST_EXCLUDE = [
1111
"**/dist/**",
1212
"**/dist-electron/**",
1313
"**/.{idea,git,cache,output,temp}/**",
14+
// node:test suites, which Vitest loads but finds no suite in. The scripts
15+
// package's `test` task runs them with `node --test`.
16+
"**/synthos-companion/**",
17+
"**/synthos-service/**",
1418
];
1519

1620
// Directories whose tests belong to a package's own test config. desktop also

0 commit comments

Comments
 (0)