Skip to content

feat: Improve handling of pre-processors with missing dependencies#797

Merged
gfieni merged 6 commits intomasterfrom
feat/processor-lazy-import
Mar 25, 2026
Merged

feat: Improve handling of pre-processors with missing dependencies#797
gfieni merged 6 commits intomasterfrom
feat/processor-lazy-import

Conversation

@gfieni
Copy link
Copy Markdown
Contributor

@gfieni gfieni commented Mar 25, 2026

This PR improves how pre-processors with missing external dependencies are handled.

Detailed changes :

  • Let ImportError propagate from pre-processors modules.
  • Remove eager pre-processors exports from powerapi.processor module.
  • Update CLI processor factories to use lazy imports so missing dependencies are handled at configuration time rather than module import time.
  • Cleanup CLI processor generator factories initialization (keep it similar to other generators)
  • Rework unit tests to isolate optional-processors behavior :
    • Add OpenStack generator unit tests.
    • Split generator tests by platform. (with automatic skip when dependencies are missing)
    • Use pre-processor without external dependencies for generic tests.
    • Rework binding manager tests to work without external dependencies.

gfieni added 5 commits March 23, 2026 14:29
- Move k8s processor tests into a separate file
- Update test configuration files
- Remove unused fixtures
Update the test modules to automatically skip the tests requiring
external dependencies when they are not installed.
@gfieni gfieni self-assigned this Mar 25, 2026
@gfieni gfieni requested a review from a team as a code owner March 25, 2026 11:04
@gfieni gfieni added the enhancement New feature or request label Mar 25, 2026
@gfieni gfieni force-pushed the feat/processor-lazy-import branch from 6c20b69 to 2df2f7c Compare March 25, 2026 11:15
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.70%. Comparing base (67beec6) to head (2df2f7c).
⚠️ Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
src/powerapi/cli/generator.py 88.88% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #797      +/-   ##
==========================================
+ Coverage   70.64%   70.70%   +0.06%     
==========================================
  Files          90       88       -2     
  Lines        2892     2895       +3     
==========================================
+ Hits         2043     2047       +4     
+ Misses        849      848       -1     
Files with missing lines Coverage Δ
src/powerapi/cli/generator.py 89.30% <88.88%> (+2.15%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gfieni gfieni merged commit a5f20f1 into master Mar 25, 2026
11 checks passed
@gfieni gfieni deleted the feat/processor-lazy-import branch March 25, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant