Skip to content

Add list all-tests command for aggregated test listing#31105

Open
petr-muller wants to merge 4 commits intoopenshift:mainfrom
petr-muller:ocpbugs-84257-list-tests-vs-run-tests
Open

Add list all-tests command for aggregated test listing#31105
petr-muller wants to merge 4 commits intoopenshift:mainfrom
petr-muller:ocpbugs-84257-list-tests-vs-run-tests

Conversation

@petr-muller
Copy link
Copy Markdown
Member

@petr-muller petr-muller commented Apr 30, 2026

Summary

  • Add a new openshift-tests list all-tests subcommand that lists tests from all extension binaries in the release payload — the same aggregated set that run operates on
  • Support --suite flag to filter tests by any suite's CEL qualifiers (origin-defined or extension-advertised), without requiring cluster access
  • Fix router config manager tests that called oc.AdminKubeClient() during ginkgo tree building

Motivation

There is currently no way to see the aggregated test list across all extension binaries, or verify what an origin-defined suite selects, without run --dry-run (which requires cluster access). This was identified while investigating OCPBUGS-84257 where a broken suite qualifier caused zero tests to be selected.

list tests is the OTE contract command — each extension binary lists its own tests. But origin-defined suites like openshift/network/third-party are not visible to individual extension binaries. list all-tests fills this gap at the orchestrator level.

Example usage

List all tests from all payload binaries:

$ openshift-tests list all-tests

Filter by a suite:

$ openshift-tests list all-tests --suite openshift/network/third-party

Structured output:

$ openshift-tests list all-tests --suite openshift/network/third-party -o json

Example run against a 5.0 payload

Registry authentication is needed to pull from the CI registry (e.g. via oc registry login
or REGISTRY_AUTH_FILE):

$ oc --context app.ci registry login
$ EXTENSIONS_PAYLOAD_OVERRIDE=registry.ci.openshift.org/ocp/release-5:5.0.0-0.ci-2026-04-30-080539 \
  openshift-tests list all-tests --suite openshift/network/third-party 2>/dev/null | wc -l
103

Known extension binary issues

When running against a real payload, two extension binaries currently fail their info call because they unconditionally require KUBECONFIG even for non-cluster commands:

  • ovn-kubernetes (ovn-kubernetes-tests-ext): calls getKubeConfig() and ocpinfraprovider.New() unconditionally in main() for EVPN capability detection
  • ccm-aws (ccm-aws-tests): calls initFrameworkForTests() unconditionally which requires KUBECONFIG

list all-tests handles this gracefully — binaries that fail info are skipped with a warning and the remaining binaries' tests are listed successfully. Fixes for both upstream repos have been prototyped and tested locally:

  • ovn-kubernetes: make kubeconfig failure non-fatal; when ocpInfra is nil, shouldIncludeTest() includes all eligible tests
  • ccm-aws: split initFrameworkForTests() into cluster-independent defaults (runs at startup) and cluster-dependent init (deferred to AddBeforeAll)

These will be submitted as separate PRs to their respective repos.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added "all tests" command to list tests, filter by suite name, and output newline, JSON, or YAML formats.
    • Supports payload-only extraction and configurable parallel processing for faster binary handling.
  • Improvements

    • Better registry auth resolution for offline/payload-only scenarios.
    • Command logs partial failures and only lists binaries that provide valid info.
  • Tests

    • Added compliance test validating payload-only extension binaries.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci openshift-ci Bot requested review from alebedev87 and deads2k April 30, 2026 15:46
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 80cccf5d-7ea5-4375-b01f-198874de5d9e

📥 Commits

Reviewing files that changed from the base of the PR and between 6909ea7 and ee96fdb.

📒 Files selected for processing (7)
  • pkg/cmd/openshift-tests/list/all_tests.go
  • pkg/cmd/openshift-tests/list/root.go
  • pkg/test/extensions/binary.go
  • pkg/test/extensions/util.go
  • test/extended/extension/payload_compliance.go
  • test/extended/router/config_manager.go
  • test/extended/router/config_manager_ingress.go
🚧 Files skipped from review as they are similar to previous changes (6)
  • pkg/cmd/openshift-tests/list/root.go
  • test/extended/router/config_manager_ingress.go
  • test/extended/router/config_manager.go
  • pkg/test/extensions/util.go
  • test/extended/extension/payload_compliance.go
  • pkg/cmd/openshift-tests/list/all_tests.go

Walkthrough

Adds an all-tests CLI subcommand to extract payload-only extension test binaries, fetch per-binary Info, resolve suite qualifiers, aggregate and optionally filter test specs, and render output (text/JSON/YAML). Also adds payload-only extraction options, registry-auth resolution without cluster access, TestBinary helpers, and a payload compliance Ginkgo test.

Changes

Cohort / File(s) Summary
CLI: all-tests
pkg/cmd/openshift-tests/list/all_tests.go, pkg/cmd/openshift-tests/list/root.go
Adds NewListAllTestsCommand and registers all-tests. Implements extraction in payload-only mode, per-binary Info retrieval with partial-failure logging, suite-name → qualifiers resolution, spec filtering/sorting, and output formatting (text/json/yaml).
Extension binary utilities
pkg/test/extensions/binary.go, pkg/test/extensions/util.go
Adds TestBinary.Name() and TestBinary.HasInfo(); introduces ExtractionOption and WithPayloadOnly() and updates ExtractAllTestBinaries(..., opts ...) to support payload-only extraction flow; adds DetermineRegistryAuthFilePathWithoutCluster for auth lookup without cluster client.
Tests — router client init
test/extended/router/config_manager.go, test/extended/router/config_manager_ingress.go
Moves Kubernetes client initialization into per-test BeforeEach() instead of eager describe-time creation.
Extension compliance test
test/extended/extension/payload_compliance.go
New Ginkgo test that extracts payload-only binaries, invokes binary.Info() with timeouts, records known info failures, and fails on unexpected info outcomes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI as "all-tests Command"
    participant Extractor as "ExtractAllTestBinaries"
    participant Binaries as "Extension Binaries"
    participant Resolver as "Suite Resolver"
    participant Output

    User->>CLI: invoke all-tests [--suite NAME] [--output FORMAT]
    CLI->>Extractor: ExtractAllTestBinaries(parallelism, WithPayloadOnly)
    Extractor->>Binaries: enumerate & extract payload binaries (registry auth without cluster)
    Binaries-->>Extractor: extracted binaries
    CLI->>Binaries: call Info() for each binary (parallel, timeouts)
    Binaries-->>CLI: Info or error
    alt suite specified
        CLI->>Resolver: resolve suite name -> qualifiers (internal then advertised)
        Resolver->>Binaries: query advertised suite metadata as needed
        Binaries-->>Resolver: suite metadata
        Resolver-->>CLI: qualifiers
    end
    CLI->>CLI: filter aggregated specs by qualifiers, sort by spec.Name
    CLI->>Output: format results (newline / json / yaml)
    Output-->>User: print results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Single Node Openshift (Sno) Test Compatibility ❓ Inconclusive Unable to access test files to verify SNO compatibility. Cannot review new Ginkgo tests for multi-node assumptions or SNO guards. Provide access to test/extended/extension/payload_compliance.go, config_manager.go, and config_manager_ingress.go to verify SNO compatibility guards and multi-node assumptions in Ginkgo test declarations.
Ote Binary Stdout Contract ❓ Inconclusive PR targets openshift-tests CLI list subcommand and test infrastructure; no definitive OTE binary entry points with stdout violations identified in investigation. Review actual PR diff to confirm whether new OTE binary main() functions were added and whether any logging writes to stdout without stderr redirection.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: adding a new 'list all-tests' command for aggregated test listing, which aligns with the primary focus of this pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All Ginkgo test names in modified or added files are stable and deterministic, using only static descriptive strings with no dynamic values.
Test Structure And Quality ✅ Passed Ginkgo tests properly moved kubeClient initialization from Describe scope into g.BeforeEach hooks for correct test lifecycle management.
Microshift Test Compatibility ✅ Passed New payload_compliance test uses only core utilities (ExtractAllTestBinaries, binary.Info) without MicroShift-unavailable APIs.
Topology-Aware Scheduling Compatibility ✅ Passed PR contains only CLI tools, test infrastructure helpers, and test refactoring with no scheduling constraints or topology-aware deployment manifests.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The test files modified (config_manager.go, config_manager_ingress.go, payload_compliance.go) do not contain hardcoded IPv4 addresses, explicit external connectivity calls, or IPv4-specific network assumptions that would prevent IPv6-only cluster execution.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/cmd/openshift-tests/list/all_tests.go`:
- Around line 106-108: The suite resolution currently calls
resolveSuiteQualifiers(ctx, suiteName, allBinaries) which can re-include
binaries that previously failed Info(); change it to use the filtered set
availableBinaries so the --suite logic skips binaries that already failed.
Update the call site where suiteName is non-empty to pass availableBinaries
instead of allBinaries (referencing suiteName and resolveSuiteQualifiers),
ensuring the rest of the control flow and qualifiers handling remains unchanged.

In `@pkg/test/extensions/util.go`:
- Around line 303-306: The os.Stat check currently treats any non-ENOENT error
as success; change the logic so that only err == nil is treated as a valid file
presence (use ciProfilePullSecretPath and the os.Stat result), and explicitly
surface other non-ENOENT errors back to the caller (e.g., return an error when
err != nil && !os.IsNotExist(err)). Update the block around the os.Stat call
that references ciProfilePullSecretPath so it returns the path on err == nil,
and returns the underlying os.Stat error for other failures instead of assuming
the file is usable.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 383eae15-9442-43a8-8a2c-5508b9225b67

📥 Commits

Reviewing files that changed from the base of the PR and between 264fe2e and 6c74b2e.

📒 Files selected for processing (6)
  • pkg/cmd/openshift-tests/list/all_tests.go
  • pkg/cmd/openshift-tests/list/root.go
  • pkg/test/extensions/binary.go
  • pkg/test/extensions/util.go
  • test/extended/router/config_manager.go
  • test/extended/router/config_manager_ingress.go

Comment thread pkg/cmd/openshift-tests/list/all_tests.go
Comment thread pkg/test/extensions/util.go Outdated
@openshift-merge-bot openshift-merge-bot Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Apr 30, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
pkg/test/extensions/payload_compliance_test.go (1)

17-18: ⚡ Quick win

Replace placeholder issue links in knownInfoFailures.

Line 17 and Line 18 still point to issues/XXXX, which makes the exemption list hard to track and clean up. Please replace with real upstream issue IDs (or remove the exemption if no issue exists yet).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/test/extensions/payload_compliance_test.go` around lines 17 - 18, The
entries in the knownInfoFailures slice/variable (specifically the items
"ovn-kubernetes-tests-ext" and "ccm-aws-tests") still reference placeholder
issue URLs (/issues/XXXX); update those entries to point to the actual upstream
issue IDs (replace the XXXX with the real issue numbers in the comment URLs) or
remove the exemption lines entirely if no real issue exists, so that
knownInfoFailures only contains accurate issue links or no stale placeholders.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/test/extensions/payload_compliance_test.go`:
- Around line 17-18: The entries in the knownInfoFailures slice/variable
(specifically the items "ovn-kubernetes-tests-ext" and "ccm-aws-tests") still
reference placeholder issue URLs (/issues/XXXX); update those entries to point
to the actual upstream issue IDs (replace the XXXX with the real issue numbers
in the comment URLs) or remove the exemption lines entirely if no real issue
exists, so that knownInfoFailures only contains accurate issue links or no stale
placeholders.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: cf72af05-63b9-4680-bf27-4213df03269c

📥 Commits

Reviewing files that changed from the base of the PR and between 5560264 and f9ba46f.

📒 Files selected for processing (1)
  • pkg/test/extensions/payload_compliance_test.go

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended/extension/payload_compliance.go`:
- Around line 17-20: Update the knownInfoFailures set to use the actual CCM
binary name by replacing the "ccm-aws-tests" entry with
"cloud-controller-manager-aws-tests-ext" so the exemption in the
knownInfoFailures variable matches the value returned by TestBinary.Name() after
ungzipFile extraction.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 9b0ff526-3641-4638-861b-8dd3be76298f

📥 Commits

Reviewing files that changed from the base of the PR and between f9ba46f and 6909ea7.

📒 Files selected for processing (2)
  • pkg/test/extensions/binary.go
  • test/extended/extension/payload_compliance.go

Comment thread test/extended/extension/payload_compliance.go
petr-muller and others added 4 commits April 30, 2026 18:34
Move oc.AdminKubeClient() calls from Describe body into BeforeEach in
router config manager tests. Ginkgo Describe bodies run during tree
building, so deferring cluster access to BeforeEach avoids unnecessary
coupling between test discovery and cluster availability. This improves
compatibility with workflows that build the test tree without a live
cluster connection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add functional options pattern to ExtractAllTestBinaries so callers can
skip non-payload extension discovery, which requires cluster access via
oc client. This enables listing tests from payload binaries without a
cluster connection.

Also adds Name() and HasInfo() on TestBinary, and
DetermineRegistryAuthFilePathWithoutCluster() for resolving registry
auth without a cluster.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a new "openshift-tests list all-tests" subcommand that lists tests
from all extension binaries in the release payload. Unlike "list tests"
which operates on a single OTE component, this command aggregates tests
across all binaries — the same set that "run" operates on.

The --suite flag filters tests by a suite's CEL qualifiers, working with
both origin-defined suites (like openshift/network/third-party) and
suites advertised by extension binaries. This enables validating suite
selections without cluster access or --dry-run.

Does not require cluster access. Extension binaries that fail info
(e.g. due to missing KUBECONFIG) are skipped with a warning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a ginkgo test that extracts all payload extension binaries and
verifies each responds to the OTE "info" command. Binaries with known
upstream issues are exempted; the test fails if an exempted binary
starts succeeding, prompting removal from the exemption list.

Runs as part of openshift/conformance/parallel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@petr-muller petr-muller force-pushed the ocpbugs-84257-list-tests-vs-run-tests branch from be64966 to ee96fdb Compare April 30, 2026 16:34
@petr-muller
Copy link
Copy Markdown
Member Author

/test all

@petr-muller
Copy link
Copy Markdown
Member Author

@coderabbitai resume

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

✅ Actions performed

Reviews resumed.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: coderabbitai[bot], petr-muller

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 2026

@petr-muller: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-vsphere-ovn-upi ee96fdb link true /test e2e-vsphere-ovn-upi
ci/prow/e2e-gcp-ovn ee96fdb link true /test e2e-gcp-ovn
ci/prow/e2e-vsphere-ovn ee96fdb link true /test e2e-vsphere-ovn
ci/prow/e2e-aws-ovn-fips ee96fdb link true /test e2e-aws-ovn-fips
ci/prow/e2e-aws-ovn-microshift ee96fdb link true /test e2e-aws-ovn-microshift
ci/prow/e2e-metal-ipi-ovn-ipv6 ee96fdb link true /test e2e-metal-ipi-ovn-ipv6

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-trt
Copy link
Copy Markdown

openshift-trt Bot commented Apr 30, 2026

Risk analysis has seen new tests most likely introduced by this PR.
Please ensure that new tests meet guidelines for naming and stability.

New Test Risks for sha: ee96fdb

Job Name New Test Risk
pull-ci-openshift-origin-main-e2e-aws-ovn-fips High - "[sig-ci] [OTE] Payload extension binaries [Suite:openshift/conformance/parallel] should all respond to the info command" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-aws-ovn-microshift High - "[sig-ci] [OTE] Payload extension binaries [Suite:openshift/conformance/parallel] should all respond to the info command" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-gcp-ovn High - "[sig-ci] [OTE] Payload extension binaries [Suite:openshift/conformance/parallel] should all respond to the info command" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-ci] [OTE] Payload extension binaries [Suite:openshift/conformance/parallel] should all respond to the info command" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-vsphere-ovn High - "[sig-ci] [OTE] Payload extension binaries [Suite:openshift/conformance/parallel] should all respond to the info command" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-vsphere-ovn-upi High - "[sig-ci] [OTE] Payload extension binaries [Suite:openshift/conformance/parallel] should all respond to the info command" is a new test that failed 1 time(s) against the current commit

New tests seen in this PR at sha: ee96fdb

  • "[sig-ci] [OTE] Payload extension binaries [Suite:openshift/conformance/parallel] should all respond to the info command" [Total: 6, Pass: 0, Fail: 6, Flake: 0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant