test(omo-codex): cover linkCachedPluginAgents in CI codex-compatibility matrix
Add the cross-platform agent-linker test file to the explicit list in the
'test:codex' script so the existing codex-compatibility CI job, which
runs on ubuntu-latest / macos-latest / windows-latest, actually exercises
it on every supported host OS.
Also add one host-platform test that omits the 'platform' parameter and
asserts against process.platform directly: on Unix the test verifies
symlinks land at ${CODEX_HOME}/agents; on Windows it verifies regular
file copies with the bundled name field. The other nine tests still mock
the 'platform' parameter to exercise all three code paths on every host;
this tenth test is the real-host integration check that the platform
detection logic itself works.
Result: 10 tests in src/cli/install-codex/link-cached-plugin-agents.test.ts,
all wired into 'bun run test:codex', which the existing CI matrix runs
on every push and PR to master/dev across all three supported operating
systems.
This commit is contained in:
@@ -180,4 +180,26 @@ describe("linkCachedPluginAgents", () => {
|
||||
) as { agents: string[] }
|
||||
expect(manifest.agents).toEqual([])
|
||||
})
|
||||
|
||||
test("auto-detects host platform when platform parameter is omitted", async () => {
|
||||
// given - no `platform` argument, so process.platform decides
|
||||
const { codexHome, pluginRoot } = await makeFixture()
|
||||
|
||||
// when
|
||||
const linked = await linkCachedPluginAgents({ codexHome, pluginRoot })
|
||||
|
||||
// then - on Unix expect symlinks; on Windows expect file copies
|
||||
expect(linked).toHaveLength(3)
|
||||
for (const entry of linked) {
|
||||
const linkStat = await lstat(entry.path)
|
||||
if (process.platform === "win32") {
|
||||
expect(linkStat.isSymbolicLink()).toBe(false)
|
||||
expect(linkStat.isFile()).toBe(true)
|
||||
const content = await readFile(entry.path, "utf8")
|
||||
expect(content).toContain(`name = "${entry.name.replace(/\.toml$/, "")}"`)
|
||||
} else {
|
||||
expect(linkStat.isSymbolicLink()).toBe(true)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user