Skip to content

Let PROPERTY_DB point at Redis, not only at a directory - #8

Merged
rasuvaeff merged 2 commits into
masterfrom
feat/redis-corpus-from-env
Aug 15, 2026
Merged

Let PROPERTY_DB point at Redis, not only at a directory#8
rasuvaeff merged 2 commits into
masterfrom
feat/redis-corpus-from-env

Conversation

@rasuvaeff

Copy link
Copy Markdown
Owner

The twin of property-testing-testo#9 — same variable, same DSN, same messages.

Core 0.3 shipped RedisCorpus and no suite could reach it: the engine reads no environment by design, so resolving where a corpus lives is the adapter's job, and this adapter hardcoded FilesystemCorpus::fromEnv(). Found while dogfooding 0.3 on rasuvaeff/circuit-breaker.

PROPERTY_DB=/tmp/corpus                  vendor/bin/phpunit   # one machine, as before
PROPERTY_DB=redis://127.0.0.1:6379       vendor/bin/phpunit   # shared
PROPERTY_DB=redis://redis:6379/suite-a:  vendor/bin/phpunit   # shared server, own prefix

Same document as the directory form, so a corpus moves between them by copying. ext-redis preferred, predis/predis otherwise, and neither installed throws rather than falling back — a suite told to share its corpus and quietly writing where nobody reads is worse than one that stops.

Parsing sits in its own RedisDsn, which in the Testo adapter came out of a mutation finding: the default port and the predis parameter array were unobservable where they were built, and checking them meant connecting to a server.

composer build green: 83 tests, ~2.4k assertions; mutation 191/199, gate 90, nothing escaped in the new code. README (both languages), llms.txt, AGENTS.md and CHANGELOG updated.

Core 0.3 shipped RedisCorpus — a corpus shared between CI and
developers — and no suite could reach it. The engine reads no
environment by design, so resolving where a corpus lives is this
adapter's job, and this adapter hardcoded the filesystem one.

PROPERTY_DB now takes redis://host[:port][/key-prefix] as well as a
path, with the same parsing, defaults and messages as the Testo adapter,
because the variable is one contract across both. ext-redis is preferred
when loaded, predis otherwise, and neither installed throws rather than
falling back: a suite told to share its corpus and quietly writing where
nobody reads is worse than one that stops.
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 06d2d961-02d0-4899-bb1d-57ed409c1ce9


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Same fix as the Testo adapter, for the same reason: CI installs
ext-redis and runs no Redis server, so an eager connect() in the
resolver made every job red, while the composer image passed because it
has no extension and predis is lazy by construction.

The phpredis client is wrapped so the socket opens on the first recall
or write, and two tests keep it honest — resolving a DSN returns without
a server, and the documented preference is asserted in whichever
environment the suite runs in.
@rasuvaeff
rasuvaeff merged commit 5b8aa38 into master Aug 15, 2026
11 checks passed
@rasuvaeff
rasuvaeff deleted the feat/redis-corpus-from-env branch August 15, 2026 05:41
@rasuvaeff rasuvaeff mentioned this pull request Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant