Skip to content

test(controller): cover remaining indexer functions#1236

Open
fabriziosestito wants to merge 1 commit into
kubewarden:mainfrom
fabriziosestito:test/increase-indexer-coverage
Open

test(controller): cover remaining indexer functions#1236
fabriziosestito wants to merge 1 commit into
kubewarden:mainfrom
fabriziosestito:test/increase-indexer-coverage

Conversation

@fabriziosestito

Copy link
Copy Markdown
Collaborator

Description

Cover remaining indexer functions with tests

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
@fabriziosestito fabriziosestito added this to the v0.12.0 milestone Jun 16, 2026
@fabriziosestito fabriziosestito self-assigned this Jun 16, 2026
Copilot AI review requested due to automatic review settings June 16, 2026 12:00
@fabriziosestito fabriziosestito requested a review from a team as a code owner June 16, 2026 12:00
@github-project-automation github-project-automation Bot moved this to Pending Review in SBOMscanner Jun 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the controller indexer test suite to cover the remaining indexer functions and key-generation helpers used by SetupIndexer, ensuring field-index-backed list queries and index key formats are exercised by tests.

Changes:

  • Extend the SetupIndexer integration-style test to validate the NodeScanJob (spec.nodeName) and NodeSBOM (nodeMetadata.name) field indexes by listing with field selectors.
  • Add unit tests for indexNodeSBOMByNodeName to verify correct key extraction and non-target object behavior.
  • Add unit tests for index key helper functions (imageMetadataIndexKey, nodeMetadataIndexKey, imageRefIndexKey) including empty-field edge cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.05%. Comparing base (5adb1bd) to head (e243eaf).
⚠️ Report is 36 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1236      +/-   ##
==========================================
- Coverage   53.44%   50.05%   -3.40%     
==========================================
  Files          61       77      +16     
  Lines        5340     6479    +1139     
==========================================
+ Hits         2854     3243     +389     
- Misses       2088     2781     +693     
- Partials      398      455      +57     
Flag Coverage Δ
unit-tests 50.05% <ø> (-3.40%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Projects

Status: Pending Review

Development

Successfully merging this pull request may close these issues.

2 participants