Skip to content

test(compatibility-suite): add V4 plugin steps - #5

Draft
YOU54F wants to merge 3 commits into
masterfrom
feat/compat-suite-plugins
Draft

YOU54F wants to merge 3 commits into
masterfrom
feat/compat-suite-plugins

Conversation

@YOU54F

@YOU54F YOU54F commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds the V4 plugin features to the pact-php compatibility suite:

  • compatibility-suite/suites/v4/plugins.php and tests/Context/V4/PluginContext.php
  • providers that run as subprocesses: php -S, a line-based TCP server, and a minimal h2c gRPC server
  • a v4-plugins CI job

Depends on the suite branch feat/plugin-features (YOU54F/pact-compatibility-suite#1). Its features are read from PACT_COMPAT_SUITE, and the run is skipped when that is unset or has no features/V4/plugins. Needs plugins matt 0.1.1, csv 0.0.6, avro 0.1.3 and protobuf 0.8.0 installed.

PACT_COMPAT_SUITE=/path/to/pact-compatibility-suite vendor/bin/behat --suite=v4_plugins

The v4-plugins CI job runs only when the PACT_COMPAT_SUITE_PLUGINS_REF repo variable is set, until the suite submodule has the features.

Results

  • 48/48 pass against released FFI. No src/ changes.
  • The existing suite is unchanged: 164 pass, 16 fail, 9 pending.

Limitations

No generic plugin entry point in the DSL. The pieces are generic:

  • AbstractPluginPactDriver calls usingPlugin(name, version).
  • PluginBodyDriver calls interactionContents.
  • MockServer::getTransport()/getTransportConfig() call createMockServerForTransport.

But they are only reachable by subclassing per plugin (Plugins/Csv, Protobuf, Sse; there is none for matt or avro), and there's no public "use plugin X@version, transport Y" entry point. So these steps call PhpPact\FFI\Client directly, and the suite does not exercise the plugin DSL layer. A small generic driver/factory taking the plugin name, version and transport would let the runner, and users of plugins with no wrapper, stay on the DSL.

The gRPC client is curl --http2-prior-knowledge. The protobuf mock server listens on ::1 only.

Core suite gaps (not in this PR): 25 fail

  • V1 provider (6): broker scenarios, missing provider-state callback, request filter.
  • V3 matching rules (5): coerce-from-string number/integer/decimal, ContentType matcher (both cases).
  • V3 message provider (1): binary body, negative case.
  • V4 matching rules (2): not-empty matcher with binary data.
  • V4 synchronous messages (11): every scenario fails. The steps are probably missing or out of date.

CI

The v4-plugins job in .github/workflows/compatibility-suite.yml checks out YOU54F/pact-compatibility-suite@feat/plugin-features (overridable with the repository variables PACT_COMPAT_SUITE_PLUGINS_REPOSITORY/PACT_COMPAT_SUITE_PLUGINS_REF), installs matt 0.1.1, csv 0.0.6, avro 0.1.3 and protobuf 0.8.0, and runs behat --suite=v4_plugins (48 scenarios) with PACT_COMPAT_SUITE set.

🤖 Generated with Claude Code

Add a v4_plugins Behat suite for the pact-compatibility-suite plugin
features (matt, csv, avro and protobuf content, and matt/gRPC transports).
The features are read from the checkout named by PACT_COMPAT_SUITE, as
they are not in the pinned submodule yet; the suite is skipped when it is
not set, and @wip scenarios are excluded.

The steps call pact_ffi directly, run the providers as PHP subprocesses
(php -S, a line-based TCP server and a minimal h2c gRPC server), and set
a transport interaction's transport by editing the pact file, since the
FFI has no call for it.

A v4-plugins CI job installs the plugins and runs the suite when the
PACT_COMPAT_SUITE_PLUGINS_REF repository variable names a suite ref.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coveralls

coveralls commented Oct 29, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 40940181002

Coverage remained the same at 92.475%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2857
Covered Lines: 2642
Line Coverage: 92.47%
Coverage Strength: 114.48 hits per line

💛 - Coveralls

YOU54F and others added 2 commits October 29, 2026 19:14
matt is not in the pact plugin repository index, so `pact plugin install
matt` exits 1 without output. Install it from the mefellows/pact-matt-plugin
v0.1.1 release instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ault

The v4-plugins job only ran when PACT_COMPAT_SUITE_PLUGINS_REF was set.
It now checks out YOU54F/pact-compatibility-suite feat/plugin-features
unless PACT_COMPAT_SUITE_PLUGINS_REPOSITORY or PACT_COMPAT_SUITE_PLUGINS_REF
override it, so it runs on every PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants