Skip to content

Test additional include list#2786

Open
oliver-smakal wants to merge 3 commits into
netobserv:mainfrom
oliver-smakal:test_additional_include_list
Open

Test additional include list#2786
oliver-smakal wants to merge 3 commits into
netobserv:mainfrom
oliver-smakal:test_additional_include_list

Conversation

@oliver-smakal
Copy link
Copy Markdown
Contributor

@oliver-smakal oliver-smakal commented May 26, 2026

Description

Adding testcase OCP-89198 for appending new metrics to the default list of metrics feature.

api-osmakal-bpfman-422-qe-devcluster-openshift-com:6443(default):~/Repos/network-observability-operator-wip/test_additional_include_list$ go run github.com/onsi/ginkgo/v2/ginkgo --focus="89198" -v ./integration-tests/backend
[1779806190] Backend Suite - 1/7491 specs Running Suite: Backend Suite - /home/osmakal/Repos/network-observability-operator-wip/test_additional_include_list/integration-tests/backend
==========================================================================================================
Random Seed: 1779806190

Will run 1 specs
Detected OCP version: v4.22
^[[A^[[A^[OA^[OA^[OA^[OAgit[sig-netobserv] Network_Observability Author:osmakal-High-89198-Verify processor metrics configuration with includeList and additionalIncludeList [Serial]
/home/osmakal/Repos/network-observability-operator-wip/test_additional_include_list/integration-tests/backend/test_flowcollector.go:326
• PASSED [874.740 seconds]
•------------------------------

Backend Suite - 1/1 specs • SUCCESS! [875.356 seconds]

Ran 1 tests
Passed: 1, Failed: 0, Skipped: 0
 SUCCESS! 14m35.35628213s PASS

Ginkgo ran 1 suite in 14m43.822737548s
Test Suite Passed

Checklist

  • Does the changes in PR need specific configuration or environment set up for testing?
    • if so please describe it in PR description.
  • I have added thorough unit tests for the change.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Summary by CodeRabbit

  • Tests
    • Added new integration test for OpenShift 4.14+ validating processor metrics configuration behavior with includeList and additionalIncludeList options, ensuring correct metrics are exposed across default and custom configuration scenarios.

Review Change Stack

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 26, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign oliviercazade for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Caution

Review failed

An error occurred during the review process. Please try again later.

📝 Walkthrough

Walkthrough

Added e2e test infrastructure for validating FlowCollector processor metrics configuration. Introduced a Prometheus metrics query helper that extracts netobserv flow metric names, and a table-driven test validating metric exposure across four scenarios combining includeList and additionalIncludeList settings.

Changes

Processor metrics configuration e2e testing

Layer / File(s) Summary
Prometheus metrics query helper
integration-tests/backend/metrics.go
getAllNetobservMetricNames queries Prometheus for netobserv flow metrics matching the pattern `netobserv_(node
Processor metrics configuration test
integration-tests/backend/test_flowcollector.go
E2e test verifying FlowCollector processor metrics exposure under four scenarios: default, includeList only, additionalIncludeList only, and both. Validates metric count and presence using the metrics query helper.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • netobserv/netobserv-operator#2546: Introduced additionalIncludeList API field; this PR's test validates the metric exposure behavior and interaction between includeList and additionalIncludeList.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title "Test additional include list" clearly summarizes the main change: adding a test for the additional include list feature for metrics configuration.
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.
Description check ✅ Passed PR description covers the main purpose (adding testcase for OCP-89198 feature) and includes the required QE checklist with Standard QE validation selected, but lacks detail on specific configuration/environment requirements and unit tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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: 1

🤖 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 `@integration-tests/backend/test_flowcollector.go`:
- Around line 426-429: Remove the unused variable by deleting the declaration
and population of expectedSet in TestFlowCollector (the block that starts with
"expectedSet := make(map[string]bool)" and the following for loop over
t.ExpectedMetrics); if deduplication or existence checks are not needed
elsewhere, simply remove both the map allocation and the loop to eliminate the
unused variable and allow the file to compile.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 55ef3b58-2b7a-4be0-88a6-64a7a3ef7cf1

📥 Commits

Reviewing files that changed from the base of the PR and between 2c808da and 88a4b8e.

📒 Files selected for processing (2)
  • integration-tests/backend/metrics.go
  • integration-tests/backend/test_flowcollector.go

Comment thread integration-tests/backend/test_flowcollector.go Outdated
@oliver-smakal
Copy link
Copy Markdown
Contributor Author

/assign @memodi

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants