pqi-conformance 1.0.16.0 → 1.0.16.1
raw patch · 3 files changed
+16/−13 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- README.md +10/−11
- pqi-conformance.cabal +2/−2
CHANGELOG.md view
@@ -1,3 +1,7 @@+# v1.0.16.1++Doc corrections: the README and package description describe adapters as `Pqi.Adapter` values instead of `Pqi.IsConnection` instances, and use the `notifyBePid` field name.+ # v1.0.16.0 ## Non-breaking
README.md view
@@ -31,9 +31,9 @@ independently for each adapter. - **`socket`** - the file descriptor of the client socket. Also connection-specific. Covered only by its own presence check.-- **`Notify.bePid`** - the PID of the notifying backend. Since each adapter's+- **`Notify.notifyBePid`** - the PID of the notifying backend. Since each adapter's connection has its own backend, cross-adapter comparison would always fail.- Instead, each adapter asserts independently that `notification.bePid ==+ Instead, each adapter asserts independently that `notification.notifyBePid == backendPID connection` (a within-connection assertion that verifies the PID field is correctly populated). @@ -47,7 +47,7 @@ The suite is organised as **one spec module per API operation**, under `Pqi.Conformance.Operation.*` - `...Operation.Exec`, `...Operation.ExecParams`, `...Operation.LoSeek`, `...Operation.Fnumber`, and so on, one for every public-method of `Pqi.IsConnection`, `Pqi.IsResult`, and `Pqi.IsCancel`,+function on `Pqi.Connection`, `Pqi.Result`, and `Pqi.Cancel`, plus the connection-independent `Adapter` fields `Pqi.unescapeBytea` and `Pqi.resStatus`. Each module holds the differential scenarios that exercise that one operation (its happy paths, its edge cases,@@ -56,24 +56,23 @@ ## Usage -An adapter's own test suite is a one-liner - it hands `specs` a `Proxy` of its-connection type and `specs` takes care of booting the container and running the-whole battery (every operation, the coverage meta-test, and SCRAM):+An adapter's own test suite is a one-liner - it hands `specs` its `Pqi.Adapter`+value and `specs` takes care of booting the container and running the whole+battery (every operation, the coverage meta-test, and SCRAM): ```haskell module Main (main) where -import Data.Proxy (Proxy (..))+import MyAdapter (adapter) import Pqi.Conformance (specs)-import MyAdapter (MyConnection) import Test.Hspec (hspec) main :: IO ()-main = hspec (specs (Proxy @MyConnection))+main = hspec (specs adapter) ``` -`MyConnection` only needs a `Pqi.IsConnection` instance; the candidate and-the `postgresql-libpq` reference are both driven through that interface.+The candidate is driven entirely through the fields of its `Pqi.Adapter`+value, the same way the `postgresql-libpq` reference is. ## Contributing
pqi-conformance.cabal view
@@ -1,10 +1,10 @@ cabal-version: 3.0 name: pqi-conformance-version: 1.0.16.0+version: 1.0.16.1 category: Database, PostgreSQL, Testing synopsis: Differential conformance tests for pqi adapters description:- A reusable [@hspec@](https://hackage.haskell.org/package/hspec) toolkit that checks any [@pqi@](https://hackage.haskell.org/package/pqi) 'Pqi.IsConnection' adapter against the FFI reference adapter. It boots a throwaway PostgreSQL container (via [@testcontainers@](https://hackage.haskell.org/package/testcontainers)), runs the same operation on the candidate and the FFI connection, and asserts that the protocol-derived observations match.+ A reusable [@hspec@](https://hackage.haskell.org/package/hspec) toolkit that checks any [@pqi@](https://hackage.haskell.org/package/pqi) adapter, given as a 'Pqi.Adapter' value, against the FFI reference adapter. It boots a throwaway PostgreSQL container (via [@testcontainers@](https://hackage.haskell.org/package/testcontainers)), runs the same operation on the candidate and the FFI connection, and asserts that the protocol-derived observations match. Each adapter's own test suite reuses these spec builders, wiring itself in as the candidate.