Conversation
…es_cdc_rls The extension code lives in lib/extensions/postgres_cdc_rls/, but its tests were split across two trees that neither matched that path: test/extensions/postgres_cdc_rls/ (partial, matches lib/) test/realtime/extensions/cdc_rls/ (the rest, path doesn't match anything) Because the paths didn't line up, a broken function could still show a green run against the wrong test file. Move the five non-overlapping files into the canonical location. For replications_test.exs, which existed in both trees testing the same module from different angles, merge rather than overwrite: keep the canonical version's describe blocks (prepare_replication/2, terminate_backend/2, get_pg_stat_activity_diff/2, the five list_changes/5 slot_changes_count scenarios) and add the two describe blocks the other copy covered and the canonical one didn't (drop_replication_slot/2, and list_changes for schemas and tables with special characters). Tests already covering the same behaviour in both files were not duplicated. test/realtime/api/extensions_test.exs is left where it is, per the issue - it covers lib/realtime/api/extensions.ex, a different module. No production code changed. mix test test/extensions/postgres_cdc_rls/ passes: 12 doctests, 205 tests, 0 failures. Closes supabase#2223
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #2223.
The
postgres_cdc_rlsextension code lives inlib/extensions/postgres_cdc_rls/, but its tests were split across two trees, neither of which matched that path:test/extensions/postgres_cdc_rls/— partial, matcheslib/test/realtime/extensions/cdc_rls/— the rest, adds arealtime/prefixlib/doesn't have and shortenspostgres_cdc_rlstocdc_rlsBecause the paths didn't line up, a broken function could still show a green run against the wrong test file.
What changed
Moved the five non-overlapping files from
test/realtime/extensions/cdc_rls/intotest/extensions/postgres_cdc_rls/as straight renames (no content changes):cdc_rls_test.exsreplication_poller_test.exssubscription_manager_distributed_test.exssubscription_manager_test.exssubscriptions_test.exsreplications_test.exsexisted in both trees, testing the same module from different angles, so per the issue this one was merged rather than overwritten:prepare_replication/2,terminate_backend/2,get_pg_stat_activity_diff/2, and the fivelist_changes/5slot_changes_count scenarios.drop_replication_slot/2(not covered at all in the canonical file) and list_changes for schemas/tables with special characters (spaces, commas, quotes, emoji, etc. — also not covered in the canonical file).test/realtime/api/extensions_test.exsis left where it is, per the issue — it coverslib/realtime/api/extensions.ex, a different module.No production code changed.
Test plan
mix test test/extensions/postgres_cdc_rls/against a local realtime + tenant Postgres (viamix setup && mise run db-start): 12 doctests, 205 tests, 0 failures. Same test count/coverage as the sum of both trees before the merge, minus the genuinely duplicated cases.mix format --check-formattedandmix credo --strictboth clean.