Parent
Part of #974 — Extensions SDK testing: PipelinePolicy
Context
PipelinePolicy is an out-of-tree Kuadrant extension built with the Extensions SDK. The extension is pre-installed on the test cluster via the helm chart — no deployment or CRD installation is needed from the testsuite side. This issue covers the Python model class, pytest fixtures, and a basic smoke test.
What needs to be done
1. PipelinePolicy Python class
Create testsuite/kuadrant/extensions/pipeline_policy.py following the existing pattern (see oidc_policy.py, plan_policy.py):
- Subclass
Policy
create_instance(cluster, name, target, ...) builds the CR model
- Methods to add
actionMethods, request actions, and response actions to the spec
- Use
@modify decorator on mutating methods
- Group:
extensions.kuadrant.io/v1alpha1, Kind: PipelinePolicy
2. Fixtures
Create a conftest with fixtures for:
- Creating a
PipelinePolicy resource targeting the test HTTPRoute
- Configuring request and response actions for the test scenarios
- Standard testsuite fixtures (
route, hostname, client, etc.)
3. Basic happy-path test
A smoke test that validates the extension is working end-to-end:
- Create a PipelinePolicy targeting an HTTPRoute with:
- A simple
allow request action (e.g., request.url_path != "/blocked")
- An
add_headers response action (e.g., add x-pipeline-policy: active)
- Send a request to an allowed path → expect 200 +
x-pipeline-policy: active header
- Send a request to
/blocked → expect 403 (denied by the allow action)
4. Test location
testsuite/tests/singlecluster/extensions/pipeline_policy/
├── conftest.py # PipelinePolicy fixtures
└── test_pipeline_policy_basic.py # Happy-path tests
5. Pytest markers
pytestmark = [pytest.mark.extensions]
Acceptance criteria
Parent
Part of #974 — Extensions SDK testing: PipelinePolicy
Context
PipelinePolicy is an out-of-tree Kuadrant extension built with the Extensions SDK. The extension is pre-installed on the test cluster via the helm chart — no deployment or CRD installation is needed from the testsuite side. This issue covers the Python model class, pytest fixtures, and a basic smoke test.
What needs to be done
1. PipelinePolicy Python class
Create
testsuite/kuadrant/extensions/pipeline_policy.pyfollowing the existing pattern (seeoidc_policy.py,plan_policy.py):Policycreate_instance(cluster, name, target, ...)builds the CR modelactionMethods,requestactions, andresponseactions to the spec@modifydecorator on mutating methodsextensions.kuadrant.io/v1alpha1, Kind:PipelinePolicy2. Fixtures
Create a conftest with fixtures for:
PipelinePolicyresource targeting the test HTTPRouteroute,hostname,client, etc.)3. Basic happy-path test
A smoke test that validates the extension is working end-to-end:
allowrequest action (e.g.,request.url_path != "/blocked")add_headersresponse action (e.g., addx-pipeline-policy: active)x-pipeline-policy: activeheader/blocked→ expect 403 (denied by the allow action)4. Test location
5. Pytest markers
Acceptance criteria
PipelinePolicyclass intestsuite/kuadrant/extensions/pipeline_policy.py/blocked, permits other pathsadd_headersaction are presentextensionsmake commit-acceptancepasses