pqi-conformance
Safe HaskellNone
LanguageHaskell2010

Pqi.Conformance

Description

A reusable differential-testing toolkit for pqi adapters.

An adapter's test suite calls specs with its Adapter value. The battery runs the same operation on the candidate and on the FFI reference and asserts that the protocol-derived observations match.

The throwaway PostgreSQL container lifecycle is baked into specs, so adapter test suites only need hspec (specs MyAdapter.adapter); they don't have to know about testcontainers at all. The SCRAM-SHA-256 authentication spec is part of the connectdb group and boots its own password-auth container.

Some specs only reproduce on the non-threaded RTS; nonThreadedSpecs collects them. A test suite built without -threaded should run it beside specs.

Synopsis

Documentation

specs :: Adapter -> Spec #

The full conformance battery: every per-operation spec under one shared trust-auth container, plus SCRAM-SHA-256 authentication (which boots its own password-auth container). Every operation spec is differential against the FFI reference.

nonThreadedSpecs :: Adapter -> Spec #

The specs that only reproduce on the non-threaded RTS, under one shared trust-auth container. On the threaded RTS they pass vacuously, so they must be run from a test suite built without -threaded.