OPRUN-4612: Add E2E tests for ExperimentalListPackageCustomSchemas gRPC endpoint#1327
OPRUN-4612: Add E2E tests for ExperimentalListPackageCustomSchemas gRPC endpoint#1327perdasilva wants to merge 1 commit into
Conversation
|
@perdasilva: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (8)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (5)
WalkthroughThis PR adds end-to-end testing for OLMv0 custom schema gRPC endpoints. It establishes gRPC as a direct dependency, embeds test fixtures in bindata, implements utilities for in-cluster catalog image building and gRPC port forwarding with a custom codec, and defines a test suite that validates custom schema queries across multiple scenarios including the requirement for the experimental header. ChangesCustom Schema gRPC Testing
Sequence DiagramssequenceDiagram
participant Test as E2E Test
participant OPMUtil as OPM Utilities
participant BuildAPI as Build API
participant CatalogPod as Catalog Pod
participant gRPCNet as gRPC Network
Test->>OPMUtil: GetOPMBaseImage()
OPMUtil-->>Test: base image
Test->>BuildAPI: BuildCustomCatalogImage()
BuildAPI->>BuildAPI: Apply templates, write FBC,<br/>generate Dockerfile
BuildAPI->>BuildAPI: Start build & poll until Complete
BuildAPI-->>Test: image reference
Test->>CatalogPod: PortForwardToCatalogPod()
CatalogPod->>CatalogPod: Discover pod, bind port,<br/>wait for readiness
CatalogPod-->>Test: localhost:port
Test->>gRPCNet: ListPackageCustomSchemas()
gRPCNet->>CatalogPod: insecure gRPC, custom codec
gRPCNet->>CatalogPod: ExperimentalListPackageCustomSchemasRequest
CatalogPod-->>gRPCNet: structpb.Struct stream
gRPCNet->>gRPCNet: convert & aggregate results
gRPCNet-->>Test: map[string]interface{} results
Test->>gRPCNet: ListPackageCustomSchemasWithoutExperimentalHeader()
gRPCNet-->>Test: empty results (header required)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 13 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (13 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Biome (2.5.0)tests-extension/test/qe/testdata/custom-schema/index.jsonFile contains syntax errors that prevent linting: Line 2: End of file expected; Line 3: End of file expected; Line 4: End of file expected; Line 5: End of file expected; Line 6: End of file expected Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests-extension/.openshift-tests-extension/openshift_payload_olmv0.json`:
- Around line 645-659: The "name" field in the JSON entry currently contains a
placeholder Polarion ID ("PolarionID:XXXXX"); replace "XXXXX" with the actual
Polarion case identifier in the "name" value (e.g., PolarionID:12345 or your
project's canonical Polarion format) so downstream test tracking can correlate
this payload entry; update the string that begins with "[sig-operator][Jira:OLM]
OLMv0 custom schema gRPC endpoint PolarionID:XXXXX-..." to include the real ID
and verify the final name still follows existing naming conventions and escaping
(no extra brackets or quotes).
In `@tests-extension/test/qe/specs/olmv0_custom_schema.go`:
- Around line 43-53: The logs currently print full image references (baseImage
and imageRef) which can expose internal hostnames; update the logging around
olmv0util.GetOPMBaseImage (baseImage) and olmv0util.BuildCustomCatalogImage
(imageRef) to avoid emitting full refs — instead log the catalogName or a
redacted form (e.g., strip registry/host portion or replace with
"<redacted-registry>") and include contextual text; change the two e2e.Logf
calls that reference baseImage and imageRef to print only the safe identifier or
redacted string.
- Line 38: The test title string in the g.It call currently uses the placeholder
"PolarionID:XXXXX" — update that placeholder to the actual Polarion case ID
(e.g. replace "PolarionID:XXXXX" with "PolarionID:12345" or the correct
alphanumeric ID) while leaving the rest of the description
("-[Skipped:Disconnected]ExperimentalListPackageCustomSchemas returns custom
schema FBC [Slow]") intact so the test title meets the required
"PolarionID:xxxxx" format.
In `@tests-extension/test/qe/util/olmv0util/custom_schema_grpc.go`:
- Around line 218-249: The port-forward readiness logic only watches scanner
output and a 30s timer, so early failures from cmd (exec.Command/Start) or
scanner errors are hidden; modify the code that creates and starts the
port-forward (the cmd variable and its Start call) to use a context (derive ctx
with timeout) and bind cmd to that context, and add channels to capture
cmd.Wait() errors and scanner.Scan() errors (e.g., an errCh alongside ready)
then change the select to wait on ready, errCh (receiving scanner or cmd.Wait
errors) and the time.After case so failures are surfaced immediately with the
real error instead of a generic timeout. Ensure you still kill/cleanup the
process on errors/timeouts.
- Around line 122-190: Change BuildCustomCatalogImage to accept a
context.Context and return an error instead of hard-asserting inside it: remove
o.Expect(...) calls and propagate errors from ApplyResourceFromTemplate,
os.MkdirTemp, os.WriteFile, the start-build Output() call, and the
wait.PollUntilContextTimeout call by returning them to the caller; use the
passed-in ctx for polling/timeout (replace wait.PollUntilContextTimeout with a
ctx-aware wait call, e.g., wait.PollUntilContext or use context.WithTimeout(ctx,
...)) and for any command execution
(oc.AsAdmin().WithoutNamespace().Run(...)).Output() error handling so the caller
can register cleanup before invoking BuildCustomCatalogImage and can
cancel/timeout the whole build lifecycle.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 716dc4ad-8e46-4b1c-b239-87cc49d6a8a2
📒 Files selected for processing (8)
tests-extension/.openshift-tests-extension/openshift_payload_olmv0.jsontests-extension/go.modtests-extension/pkg/bindata/qe/bindata.gotests-extension/test/qe/specs/olmv0_custom_schema.gotests-extension/test/qe/testdata/custom-schema/index.jsontests-extension/test/qe/testdata/olm/custom-schema-buildconfig.yamltests-extension/test/qe/testdata/olm/custom-schema-imagestream.yamltests-extension/test/qe/util/olmv0util/custom_schema_grpc.go
86b18e6 to
5bd2a37
Compare
|
/payload-aggregate periodic-ci-openshift-operator-framework-olm-release-4.22-periodics-e2e-gcp-ovn-ipi-disconnected-extended-f1 5 |
|
@perdasilva: This pull request references OPRUN-4612 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/payload-aggregate periodic-ci-openshift-operator-framework-olm-release-4.23-periodics-e2e-gcp-ovn-ipi-disconnected-extended-f1 5 |
|
@perdasilva: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/5e4bb090-6968-11f1-8793-d0e475f5b38e-0 |
Add tests for the new api.ExperimentalRegistry gRPC endpoint introduced in operator-registry PR #1981. The tests build a custom FBC catalog image in-cluster (using the opm base image from the catalog-operator deployment), create a CatalogSource, and query the endpoint via port-forward. Test scenarios: - Schema + package returns expected custom schema FBC blobs - Schema + nonexistent package returns empty stream - Nonexistent schema returns empty stream - Schema + empty package returns packageless blobs - Missing x-acknowledge-experimental header returns empty stream Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
5bd2a37 to
643a139
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fgiudici, perdasilva The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
/payload-aggregate periodic-ci-openshift-operator-framework-olm-release-4.23-periodics-e2e-gcp-ovn-ipi-disconnected-extended-f1 |
|
@perdasilva: it appears that you have attempted to use some version of the payload command, but your comment was incorrectly formatted and cannot be acted upon. See the docs for usage info. |
|
/payload-aggregate periodic-ci-openshift-operator-framework-olm-release-4.23-periodics-e2e-gcp-ovn-ipi-disconnected-extended-f1 5 |
|
@perdasilva: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/80e2a970-6b06-11f1-982e-48bf0d2c8aae-0 |
|
/retest |
|
/payload-aggregate periodic-ci-openshift-operator-framework-olm-release-5.0-periodics-e2e-gcp-ovn-ipi-disconnected-extended-f1 5 |
|
@perdasilva: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/015222e0-6b28-11f1-9caf-7b16c2a0784f-0 |
|
@perdasilva: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
api.ExperimentalRegistry/ExperimentalListPackageCustomSchemasstreaming gRPC endpoint introduced in operator-registry#1981--cache-only)Test scenarios
x-acknowledge-experimentalheader returns empty streamTest plan
make bindata && make build && make update-metadata && make verify— all pass🤖 Generated with Claude Code
Summary by CodeRabbit