ci(lazycodex): gate publish and install
This commit is contained in:
@@ -117,24 +117,52 @@ describe("validateNonTuiArgs", () => {
|
||||
expect(result.errors).toContain("--copilot is required (values: no, yes)")
|
||||
})
|
||||
|
||||
test("allows codex-only non-TUI installs without OpenCode provider flags", () => {
|
||||
test("rejects codex-only non-TUI installs when lazycodex publishing is disabled", () => {
|
||||
// #given
|
||||
const args: InstallArgs = { tui: false, platform: "codex" }
|
||||
|
||||
// #when
|
||||
const result = validateNonTuiArgs(args)
|
||||
|
||||
// #then
|
||||
expect(result.valid).toBe(false)
|
||||
expect(result.errors).toContain(
|
||||
"Codex platform install is disabled. Set OMO_PUBLISH_LAZYCODEX=true to enable LazyCodex publish/install.",
|
||||
)
|
||||
})
|
||||
|
||||
test("allows codex-only non-TUI installs with lazycodex publishing enabled", () => {
|
||||
// #given
|
||||
const args: InstallArgs = { tui: false, platform: "codex" }
|
||||
|
||||
// #when
|
||||
const result = validateNonTuiArgs(args, { OMO_PUBLISH_LAZYCODEX: "true" })
|
||||
|
||||
// #then
|
||||
expect(result.valid).toBe(true)
|
||||
expect(result.errors).toEqual([])
|
||||
})
|
||||
|
||||
test("rejects platform=both when lazycodex publishing is disabled", () => {
|
||||
// #given
|
||||
const args = createArgs({ platform: "both" })
|
||||
|
||||
// #when
|
||||
const result = validateNonTuiArgs(args)
|
||||
|
||||
// #then
|
||||
expect(result.valid).toBe(false)
|
||||
expect(result.errors).toContain(
|
||||
"Codex platform install is disabled. Set OMO_PUBLISH_LAZYCODEX=true to enable LazyCodex publish/install.",
|
||||
)
|
||||
})
|
||||
|
||||
test("rejects OpenCode flags for codex-only non-TUI installs", () => {
|
||||
// #given
|
||||
const args = createArgs({ platform: "codex", claude: "yes" })
|
||||
|
||||
// #when
|
||||
const result = validateNonTuiArgs(args)
|
||||
const result = validateNonTuiArgs(args, { OMO_PUBLISH_LAZYCODEX: "true" })
|
||||
|
||||
// #then
|
||||
expect(result.valid).toBe(false)
|
||||
|
||||
Reference in New Issue
Block a user