Skip to content

WIP: Update collection profiles e2e tests - #31477

Open
simonpasquier wants to merge 5 commits into
openshift:mainfrom
simonpasquier:update-collection-profiles-e2e-tests
Open

WIP: Update collection profiles e2e tests#31477
simonpasquier wants to merge 5 commits into
openshift:mainfrom
simonpasquier:update-collection-profiles-e2e-tests

Conversation

@simonpasquier

@simonpasquier simonpasquier commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Tests
    • Expanded coverage for Prometheus collection profiles, including full, minimal, empty, and default configurations.
    • Added validation for profile discovery, configuration updates, preservation of existing settings, and cleanup behavior.
    • Improved assertions to verify monitor selection and configuration outcomes across supported profile scenarios.

@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 added ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Aug 3, 2026
@openshift-ci
openshift-ci Bot requested review from machine424 and rexagod August 3, 2026 15:13
@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: simonpasquier

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-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Walkthrough

Collection profile tests now discover supported profiles from managed monitors, preserve existing operator ConfigMap settings, use typed selectors and shared assertions, and verify cleanup when configuration did not previously exist.

Changes

Prometheus collection profile tests

Layer / File(s) Summary
Profile configuration helper
test/extended/prometheus/collection_profiles.go
Defines explicit profile constants and updates nested Prometheus configuration while preserving existing ConfigMap YAML.
Profile discovery and test setup
test/extended/prometheus/collection_profiles.go
Discovers supported profiles from ServiceMonitor labels and updates setup and cleanup behavior.
Profile assertions and monitor tests
test/extended/prometheus/collection_profiles.go
Uses shared profile assertions, typed label selectors, and the new configuration helper across test scenarios.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning The file has seven direct error assertions without diagnostic messages, and configureCollectionProfile writes to configuration.Data without initializing a possible nil map. Add action-specific messages to direct assertions and initialize configuration.Data when it is nil before assigning config.yaml.
Microshift Test Compatibility ⚠️ Warning The unprotected collection-profiles suite uses openshift-monitoring, Prometheus, and ServiceMonitor APIs; its Describe has no MicroShift skip, apigroup tag, or runtime guard. Add [Skipped:MicroShift] or an appropriate unavailable-API apigroup tag to the Describe, or guard it with exutil.IsMicroShiftCluster and g.Skip().
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating collection profile end-to-end tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 Describe, Context, and It titles in collection_profiles.go are literal, descriptive strings with no runtime values, identifiers, names, timestamps, or addresses.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR changes existing collection-profile tests only. They use monitoring APIs and metrics, with no node, topology, scheduling, affinity, drain, or HA assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The commit modifies only a Prometheus e2e test. It adds no deployment manifests, operator code, controllers, replicas, affinity, tolerations, selectors, or topology constraints.
Ote Binary Stdout Contract ✅ Passed The patch adds no fmt.Print*, log/klog, os.Stdout, or Ginkgo suite-output calls; setup uses Ginkgo assertions and g.By only, so JSON stdout remains unmodified.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The branch adds no Ginkgo test declarations and no IPv4 literals, IP parsing, URL construction, or public/external network access; it only updates cluster ConfigMap and ServiceMonitor logic.
No-Weak-Crypto ✅ Passed The PR changes only collection-profile test logic; added lines contain no MD5, SHA1, DES, RC4, Blowfish, ECB, crypto APIs, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The PR changes only a Go test file. No privilege fields or security-context structures were added, and Kubernetes API calls only create or update a ConfigMap.
No-Sensitive-Data-In-Logs ✅ Passed The patch adds no logging of ConfigMap YAML or credentials. Errors expose only fixed resource names, profile labels, metric names, and PromQL; sensitive-data patterns are absent.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@simonpasquier

Copy link
Copy Markdown
Contributor Author

/uncc @rexagod

@openshift-ci
openshift-ci Bot removed the request for review from rexagod August 3, 2026 15:19
@simonpasquier

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-ovn

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
test/extended/prometheus/collection_profiles.go (1)

59-62: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Move collectionProfilesSupportedList into runner.

collectionProfilesSupportedList is mutable state populated in BeforeAll and read by both It blocks. Store it as runner.supportedCollectionProfiles to keep discovered test state with the existing lifecycle state and avoid package-level mutable state.

🤖 Prompt for 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.

In `@test/extended/prometheus/collection_profiles.go` around lines 59 - 62, Move
collectionProfilesSupportedList from package scope into the runner state as
runner.supportedCollectionProfiles. Update its runtime initialization in
BeforeAll and both It blocks to access the runner field, preserving the existing
discovery and test behavior while removing the package-level mutable variable.
🤖 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.

Nitpick comments:
In `@test/extended/prometheus/collection_profiles.go`:
- Around line 59-62: Move collectionProfilesSupportedList from package scope
into the runner state as runner.supportedCollectionProfiles. Update its runtime
initialization in BeforeAll and both It blocks to access the runner field,
preserving the existing discovery and test behavior while removing the
package-level mutable variable.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 70a77c8f-a3de-4f78-800a-e8daed9fc1fa

📥 Commits

Reviewing files that changed from the base of the PR and between e3c4a6b and 3829229.

📒 Files selected for processing (1)
  • test/extended/prometheus/collection_profiles.go

@simonpasquier

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2

@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@simonpasquier: The following test 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-gcp-ovn 3829229 link true /test e2e-gcp-ovn

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.

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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