test(query): unit-test OracleReadOnlySessionEnforcer no-op contract#119
Merged
Conversation
Oracle's SET TRANSACTION READ ONLY is per-transaction and an embedded COMMIT escapes it (see PR #110), so the enforcer is intentionally a no-op that only exposes a Limitation message — same shape as the SQL Server enforcer. With no Oracle Testcontainer in the repo every line of the enforcer was unreachable, accounting for ~1.6pp of the recent codecov drop. Pins the same contract as the SQL Server tests with one Oracle-specific twist: the Limitation message must explain why per-transaction read- only is the wrong layer of defense (the SQL Server message has no equivalent caveat to assert). 9 cases: Limitation non-null and mentions Oracle, explains the per-transaction gap (contains "transaction" / "COMMIT" / "session- level"), recommends a concrete remediation (SELECT, READ ONLY, or ALTER DATABASE), Apply and Reset send no commands (NSubstitute DidNotReceive on CreateCommand), IsReadOnlyViolation returns false for every shape of exception, Instance is a singleton. Closes the 5-PR coverage-recovery series (#115, #116, #117, #118, this PR). Combined recovery target ~7pp. No source changes — the enforcer is reached via the InternalsVisibleTo added in PR #115.
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
Final PR in the 5-PR coverage-recovery series (after #115, #116, #117, #118). Pins the Oracle enforcer's intentionally-empty contract.
Oracle's
SET TRANSACTION READ ONLYis per-transaction and an embeddedCOMMITescapes it (see PR #110), soOracleReadOnlySessionEnforceris a no-op that only surfaces aLimitationmessage — same shape as the SQL Server enforcer. With no Oracle Testcontainer in the repo every line was unreachable, accounting for ~1.6pp of the recent codecov drop.Code changes
tests/Equibles.AgentQL.UnitTests/Query/ReadOnly/OracleReadOnlySessionEnforcerTests.cs(new) — 9 cases:Limitationis non-null and mentions Oracle.Limitationexplains the per-transaction gap (containstransaction/COMMIT/session-level).Limitationrecommends a concrete remediation (SELECT,READ ONLY, orALTER DATABASE).ApplyandResetsend no commands (NSubstituteDidNotReceiveWithAnyArgs().CreateCommand()).IsReadOnlyViolationreturnsfalsefor every shape of exception.Instanceis a singleton.9 / 9 pass. 134 / 134 across the full UnitTests suite. No source changes — the enforcer is reached via the
InternalsVisibleToadded in PR #115.Series wrap-up
Coverage should land back in the high 80s once Codecov processes the series.