Skip to content

Commit ae3fd15

Browse files
test(workspace): pin the dbt-fallback notice on the branch that produces it
The existing test asserted the redirect wording through a named warehouse, which never takes the dbt-fallback branch. This reaches that branch through the pure decision function and pins what the reworded notice must say: the call would try dbt first and fall back to the named connection, and the dbt path cannot be chosen from the tool.
1 parent 1d1f3bc commit ae3fd15

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎packages/opencode/test/altimate/workspace/precedence.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,25 @@ describe("the dbt-fallback redirect explains itself", () => {
527527
expect(verdict.redirect!.output).toContain("--integrations=local")
528528
expect(verdict.redirect!.metadata.via).toBeUndefined()
529529
})
530+
531+
test("the dbt-fallback branch says what the call would do, and that dbt cannot be chosen here", async () => {
532+
// Reaching this branch through check() needs a dbt project; the pure decision
533+
// function reaches it directly. The wording matters because the fallback is not
534+
// the served target — it is where the call would land if dbt yields nothing.
535+
const p = await refresh(SESSION, SNOWFLAKE_TOOLS)
536+
const v = decideForTarget(p, "sql_execute", {
537+
source: "dbt",
538+
type: undefined,
539+
fallback: { type: "snowflake", name: "local_snow" },
540+
})
541+
expect(v.redirect!.metadata.via).toBe("dbt-fallback")
542+
const out = v.redirect!.output
543+
expect(out).toContain("try the dbt project first")
544+
expect(out).toContain("fall back to the local connection `local_snow`")
545+
expect(out).toContain("The dbt path cannot be chosen from this tool")
546+
expect(out).toContain("--integrations=local")
547+
expect(out).not.toContain("this connection is served by")
548+
})
530549
})
531550

532551
describe("a redirect the caller cannot follow is not a redirect", () => {

0 commit comments

Comments
 (0)