wy-a648lq: flip the embeddeddolt tolerant mixed-batch case to the wired-edge contract

The env-gated embeddeddolt TestCreateIssues case still asserted the
pre-fix contract (skip-report the regular->wisp edge, persist nothing),
which CI's 'Test (Embedded Dolt Storage 5/5)' shard caught on PR #6126.
It now asserts what the engine promises since d75948c82: nothing is
skip-reported and the edge lands in dependencies.depends_on_wisp_id.
Run: BEADS_TEST_EMBEDDED_DOLT=1 go test ./internal/storage/embeddeddolt
-run 'TestCreateIssues/(wires_mixed|rejects_regular_to_wisp|rejects_wisp_to_regular)' rc=0.
This commit is contained in:
homer 2026-09-01 05:40:39 -07:00 • committed by Steve Yegge
commit 40b3232456

View file

@ -982,7 +982,12 @@ func TestCreateIssues(t *testing.T) {
te.assertRowNotExists(t, ctx, "wisps", wisp.ID)
})
t.Run("skips_mixed_batch_dependency_when_validation_errors_are_tolerated", func(t *testing.T) {
// A tolerant mixed batch (the importer's shape, SkipDependencyValidationErrors)
// keeps its regular->wisp edge: every row of both planes is written on the
// one transaction before the dependency pass, so the edge is writable
// (wy-a648lq). Nothing is skip-reported, and the edge lands in
// dependencies.depends_on_wisp_id — the regular source's own table.
t.Run("wires_mixed_batch_dependency_when_validation_errors_are_tolerated", func(t *testing.T) {
te := newTestEnv(t, "sk")
ctx := t.Context()
@ -1019,17 +1024,15 @@ func TestCreateIssues(t *testing.T) {
}
te.assertRowExists(t, ctx, "issues", regular.ID)
te.assertRowExists(t, ctx, "wisps", wisp.ID)
if len(skipped) != 1 ||
!strings.Contains(skipped[0], "sk-regular-source -> sk-wisp-target") ||
!strings.Contains(skipped[0], "cross-bucket dependency") {
t.Fatalf("skipped = %#v, want cross-bucket dependency detail", skipped)
if len(skipped) != 0 {
t.Fatalf("skipped = %#v, want the in-batch cross-plane edge wired, not skip-reported", skipped)
}
var regularDeps, wispDeps int
te.queryScalar(t, ctx, "SELECT COUNT(*) FROM dependencies WHERE issue_id = ?", []any{regular.ID}, &regularDeps)
te.queryScalar(t, ctx, "SELECT COUNT(*) FROM dependencies WHERE issue_id = ? AND depends_on_wisp_id = ? AND depends_on_issue_id IS NULL", []any{regular.ID, wisp.ID}, &regularDeps)
te.queryScalar(t, ctx, "SELECT COUNT(*) FROM wisp_dependencies WHERE issue_id = ?", []any{regular.ID}, &wispDeps)
if regularDeps != 0 || wispDeps != 0 {
t.Fatalf("persisted dependency counts = regular:%d wisp:%d, want none", regularDeps, wispDeps)
if regularDeps != 1 || wispDeps != 0 {
t.Fatalf("persisted dependency counts = regular(depends_on_wisp_id):%d wisp:%d, want 1 and 0", regularDeps, wispDeps)
}
})