Skip to content

fix(tests): the ddl unit tests expect the constraint-equivalence token (size 6) - #245

Merged
jexp merged 1 commit into
mainfrom
fix/ecc-ddl-equivalent-token
Nov 12, 2026
Merged

jexp merged 1 commit into
mainfrom
fix/ecc-ddl-equivalent-token

Conversation

@jexp

@jexp jexp commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Classification

Test-expectation fix — restores assertions a re-squash dropped; no engine behaviour change.

What

The #239 rework renamed the constraint-equivalence condition to EquivalentConstraintAlreadyExists (the documented 22N65 token) and the CREATE CONSTRAINT gate in catalog_schema.rs emits it. The re-squash that landed dropped ddl.rs from its declared file list, so its two unit tests kept asserting the index-equivalence token (22N70) the old path raised, and the executor suite went red on main. This restores the two assertions from the round that wrote them — the same root cause and the same fix shape as #244 (the constraint-matrix rows).

Verification

  • cargo test -p relate-executor --lib: 1567 passed, 3 ignored, including exec::ddl (main: 2 failed)
  • cargo fmt --all --check clean

🤖 Generated with Claude Code

…n (size 6)

The #239 rework renamed the constraint-equivalence condition to
EquivalentConstraintAlreadyExists (the documented 22N65 token) and the
CREATE CONSTRAINT gate in catalog_schema.rs emits it — but the re-squash
that landed dropped ddl.rs from its declared file list, so its two unit
tests kept asserting the index-equivalence token (22N70) the old path
raised, and the executor suite went red on main.

Restores the two assertions from the round that wrote them.

Verified: cargo test -p relate-executor --lib — 1567 passed, 3 ignored,
including exec::ddl; cargo fmt --all --check clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@jexp
jexp marked this pull request as ready for review November 12, 2026 14:26
@github-actions

Copy link
Copy Markdown

Security review (security-review skill)

Analysed the single-file diff in relate/relate-executor/src/exec/ddl.rs: three test-only assertion string literals under #[cfg(test)] mod tests (starts line 612) are updated from EquivalentSchemaRuleAlreadyExists to EquivalentConstraintAlreadyExists. No production code, auth, input validation, secret handling, dependency, network, or CI/agent-instruction surface is touched, so there is no trust-boundary or exploitability change.

No issues found.

Security review: ✅ no issues found

@jexp
jexp merged commit 71c2873 into main Nov 12, 2026
43 of 52 checks passed
@jexp
jexp deleted the fix/ecc-ddl-equivalent-token branch November 12, 2026 14:26
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Stellar review (stellar-review skill)

Round 1 · head 15d22642 · scope: 2/35 units (33 sealed from earlier rounds).

Findings on context units (not on the current diff — summary only; night-shift backlog, never inline, never verdict blockers)

  • [Medium] branching (q-repeated-conditionals) F-1-1: relate/relate-executor/src/exec/ddl.rs:687-692 — This is a hand-rolled copy of the fail-extraction that the module's canonical error_of already provides (imported at line 616, used at 648 and 668) and whose doc comment says the message is extracte Fix: Add one tests-module helper, e.g. fn assert_equivalent_constraint_rejected(g: &Graph, statement: &str) that runs the statement through error_of and pins semantic error: EquivalentConstraintAlreadyExists once, then call it from all three sites so the contract and its failure message live in a s
  • [Medium] branching (q-repeated-conditionals) F-1-2: relate/relate-executor/src/exec/ddl.rs:705-709 — The second copy of the same Ok(_) => panic! / Err(error) => error extraction sits eight lines below the first inside one test, re-deriving the pattern error_of exists to own — a repeated conditi Fix: Route this site through the single assert_equivalent_constraint_rejected(&g, statement) helper (or assert_eq!(error_of(...), ...)) introduced for the first copy; the per-statement intent moves into the helper or its call-site message.
  • [Medium] branching (q-repeated-conditionals) F-1-3: relate/relate-executor/src/exec/ddl.rs:809-812 — The same hand-rolled extraction appears a third time in the changed area, and this diff had to update its literal in lockstep with the other two — the concrete cost of branching around the canonical _Fix:_ Use the sharedassert_equivalent_constraint_rejected(&g, statement)` helper here too; all three sites then pin the error class exactly once and the next error-class rename is a one-line edit.
  • [Medium] boundaries (std-6) F-1-4: relate/relate-executor/src/exec/ddl.rs:687-693 — The module's canonical error_of helper (imported at the top of this test module and used at lines 648/668 via error_of(exec_autocommit(...))) documents itself as the one spelling for extracting a Fix: Use let error = error_of(exec_autocommit(...)); and assert against the returned String; if the per-scenario panic label matters, add a label parameter to error_of so the canonical helper stays the only extraction path.
  • [Medium] boundaries (std-6) F-1-5: relate/relate-executor/src/exec/ddl.rs:705-709 — Second occurrence of the same bespoke error extraction in the same test, bypassing the canonical error_of helper that already handles the Ok panic case (with the returned rows) for every other ex _Fix:_ Collapse to let error = error_of(exec_autocommit(&g, ...));and assert on the string, matching the two existingerror_of(exec_autocommit(...))` sites in this test module.
  • [Medium] boundaries (std-6) F-1-6: relate/relate-executor/src/exec/ddl.rs:809-812 — The same hand-rolled error extraction as the other two in-scope tests: it duplicates the canonical error_of scalar extractor already imported and used in this module, leaving two spellings of the "r Fix: Route through error_of(exec_autocommit(&g, ...)) (push any needed scenario label into the helper) instead of the inline match.

Stellar review: ✅ no issues found

@oplane-bot

oplane-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

Oplane Security Review

Oplane reviewed this PR and did not identify any security requirements that need attention. Review the generated threat model.


Change comment settings · Set up Oplane in your agent · Workflow guidance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant