Skip to content

tests: guard the ten defects seeded into the PostgreSQL satellite (#83) - #114

Merged
CaffeinatedCoder merged 2 commits into
mainfrom
tests/83-satellite-guards
Oct 20, 2026
Merged

CaffeinatedCoder merged 2 commits into
mainfrom
tests/83-satellite-guards

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #83

Problem

The 5.5.0 analysis seeded defects into the PostgreSQL satellite, and the full suite passed with each one applied. Most of them are silent: the migration scaffolds and applies, and the database differs from the model.

Change

test/…/NpgsqlSatelliteGuardTests.cs is new and holds one guard per row. It is a single new class rather than additions to the feature test files, because streams A and C are editing the typed-filter, translator and harness tests in parallel. Every test names its seed. No library code changes, so there is no changelog line.

Seed (row of #83) Guard Asserts
EndStatement(…, suppressTransaction: false) in the parts path Concurrent_parts_index_suppresses_the_transaction the generated MigrationCommand.TransactionSuppressed
ExclusionDescriptor.Equals without Deferrable/InitiallyDeferred Deferrable_change_…, Initially_deferred_change_…, Rename_with_deferrable_change_… a standalone drop plus an ADD with the new clause, and no RENAME CONSTRAINT
ExclusionDescriptor.Equals without Method Method_change_…, Rename_with_method_change_… the same, with EXCLUDE USING spgist
exclusion return [.. operations, .. drops, …] Exclusion_drop_precedes_base_operations the constraint's drop precedes the CreateIndexOperation of a native index taking its name; in the other order that index fails with 42P07
nested complex property ignores HasJsonPropertyName Nested_complex_property_honors_its_json_name "profile" #>> '{addr,City}'
TrimStart renders rtrim already covered: #72's "Typed expressions render as EF Core's queries render them" fails with the seed none added
"interval" removed from StableTextInputTypes TimeSpan_member_is_not_cast_to_interval "profile" ->> 'Duration'; the cast fails with 42P17, checked on PostgreSQL 18
null != x.P rendered IS NULL Null_on_the_left_keeps_the_negation "revoked_at" IS NOT NULL
no '' doubling in typed string literals Typed_filter_literal_doubles_quotes "code" <> 'O''Brien'
no '' doubling in the JSON ARRAY[...] form Json_key_with_quote_is_escaped ARRAY['Quoted','o''clock']::text[]
no " doubling in Quote Quote_doubles_double_quotes "ex_""room""" and "room""id" in the EXCLUDE DDL
char.IsAsciiLetter in BuildJsonPath Json_key_with_digit_keeps_the_literal_path_form '{Address2,City}'

Two corrections to the issue's note:

  • Row 8 was not covered. Typed filters use SQL null semantics: != and ! on a nullable operand drop NULL rows, a captured null renders = NULL #68 pins a null on the right (x.P != null, and a captured null). With null != x.P seeded to IS NULL, the left-hand branch still passed the whole suite, so it gets a guard here.
  • Rows 2 and 3 need two guards each. Removing a facet from Equals and GetHashCode together is caught by the same-name pair. Removing it from Equals alone is not, because the hash set still tells the two sides apart. That variant is silent only through the rename detection, which calls Equals directly, so a rename plus a deferrability or method change became a bare RENAME CONSTRAINT. The rename tests cover it.

Tests

  • Every seed above was applied on its own against the whole unit suite (TestCategory!=Integration). Each failed exactly its own guard, with 400 or 401 other tests passing. The Equals-only variants of rows 2 and 3 fail only the rename guard.
  • Full suite, integration included: 412 passed.

🤖 Generated with Claude Code

@CaffeinatedCoder CaffeinatedCoder added this to the 5.5.0 milestone Oct 20, 2026
@CaffeinatedCoder CaffeinatedCoder added tests Adds or changes tests only (harnesses, parity suites); no library code package/postgresql Affects EFCore.ComplexIndexes.PostgreSQL area/indexes Complex-property, composite, unique and filtered indexes area/constraints Temporal (WITHOUT OVERLAPS, PERIOD) and exclusion constraints labels Oct 20, 2026
The 5.5.0 analysis seeded defects into the PostgreSQL satellite that the
full suite let through. NpgsqlSatelliteGuardTests adds one guard per row of
#83, each proven by applying its seed against the whole unit suite: every
seed fails its own guard and nothing else.

Row 6 (TrimStart as rtrim) was already caught by #72's rendering test. Row
8 (null != x.P as IS NULL) was not: #68 pins a null on the right, and the
null-on-the-left branch passed with the seed, so it gets a guard here. The
Deferrable and Method rows have two guards each, since Equals alone is used
by the rename detection and a seed removing the facet from Equals but not
GetHashCode is caught only there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@CaffeinatedCoder
CaffeinatedCoder force-pushed the tests/83-satellite-guards branch from 6c6aecf to 49420ce Compare October 20, 2026 06:27
@CaffeinatedCoder
CaffeinatedCoder merged commit 994c82c into main Oct 20, 2026
@CaffeinatedCoder
CaffeinatedCoder deleted the tests/83-satellite-guards branch October 20, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/constraints Temporal (WITHOUT OVERLAPS, PERIOD) and exclusion constraints area/indexes Complex-property, composite, unique and filtered indexes package/postgresql Affects EFCore.ComplexIndexes.PostgreSQL tests Adds or changes tests only (harnesses, parity suites); no library code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests: ten seeded defects in the PostgreSQL satellite that the suite does not catch

1 participant