Skip to content

test(compat-suite): add v4 plugin scenarios #1

test(compat-suite): add v4 plugin scenarios

test(compat-suite): add v4 plugin scenarios #1

---
name: compatibility suite (V4 plugins)
# The V4 plugin features are not in the pinned suite submodule yet, so this
# checks out the suite branch that adds them and runs
# tests/compatibility_suite/test_v4_plugins.py against it. It runs on draft PRs
# and on PRs to any base, unlike test.yml.
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
suite-repository:
description: pact-compatibility-suite repository with features/V4/plugins
default: YOU54F/pact-compatibility-suite
suite-ref:
description: Ref of that repository to run
default: feat/plugin-features
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
env:
PYTEST_ADDOPTS: --color=yes
FORCE_COLOR: '1'
PACT_DO_NOT_TRACK: 'true'
SUITE_REPOSITORY: ${{ inputs.suite-repository || 'YOU54F/pact-compatibility-suite' }}
SUITE_REF: ${{ inputs.suite-ref || 'feat/plugin-features' }}
jobs:
plugins:
name: V4 plugins (Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
submodules: true
- name: Checkout plugin suite
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ${{ env.SUITE_REPOSITORY }}
ref: ${{ env.SUITE_REF }}
path: pact-compatibility-suite-plugins
- name: Set up uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
with:
enable-cache: true
- name: Install Python
run: uv python install 3.11
- name: Install the Pact CLI
uses: pact-foundation/pact-cli@ce8e65692ad3ea9d11244749ae24c8c49225d95f # main
- name: Install plugins
run: |
# matt is not in the plugin repository index, so it is installed from its release.
pact plugin install https://github.com/mefellows/pact-matt-plugin/releases/tag/v0.1.1 -y
pact plugin install csv --version 0.0.6 -y
pact plugin install avro --version 0.1.3 -y
pact plugin install protobuf --version 0.8.0 -y
# grpcio is only in the example group; the gRPC scenarios skip without it.
# pytest-bdd 9.0 uses FixtureManager._arg2fixturedefs, which pytest 9.2 removed.
- name: Run plugin features
env:
PACT_COMPAT_SUITE: ${{ github.workspace }}/pact-compatibility-suite-plugins
run: >-
uv run --python 3.11 --group test --with grpcio --with 'pytest<9.2'
pytest tests/compatibility_suite/test_v4_plugins.py --no-cov -rs