Skip to content

Increase optimizer submodule test coverage#1344

Merged
SkBlaz merged 2 commits intomasterfrom
copilot/increase-test-coverage-submodules
Apr 13, 2026
Merged

Increase optimizer submodule test coverage#1344
SkBlaz merged 2 commits intomasterfrom
copilot/increase-test-coverage-submodules

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

Summary

Increase coverage for low-tested optimizer submodules by adding a focused, deterministic optimizer test suite.

Changes

  • Added tests/test_optimizer_submodules.py.
  • Covered key behavior in:
    • py3plex.optimizer.plan_nodes
    • py3plex.optimizer.logical_plan
    • py3plex.optimizer.cost_model
    • py3plex.optimizer.physical_plan
    • py3plex.optimizer.rules
    • py3plex.optimizer.optimizer
  • Added tests for:
    • logical plan helper extraction and select-plan chain construction
    • network stats extraction and fallback behavior
    • cost estimate arithmetic and operator-level cost estimation
    • physical operators (layer pushdown, top-k, early limit) and physical plan serialization
    • rewrite rule behavior and rule engine traversal
    • optimizer metadata and optimize_query one-shot flow

Coverage

Measured with:

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 coverage run -m pytest tests/test_optimizer_submodules.py -q
  • coverage report -m py3plex/optimizer/*.py

Results for py3plex/optimizer:

  • Baseline (before): 0% total (with non-optimizer test target)
  • After: 81% total

Per-file after:

  • __init__.py: 100%
  • plan_nodes.py: 100%
  • logical_plan.py: 94%
  • cost_model.py: 89%
  • optimizer.py: 93%
  • physical_plan.py: 77%
  • rules.py: 66%

Validation

  • python -m ruff check tests/test_optimizer_submodules.py
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest tests/test_optimizer_submodules.py -q
  • parallel_validation run (Code Review + CodeQL) after updates

Copilot AI and others added 2 commits April 12, 2026 12:50
Copilot AI requested a review from SkBlaz April 12, 2026 12:53
@SkBlaz SkBlaz marked this pull request as ready for review April 13, 2026 08:33
@SkBlaz SkBlaz merged commit 6d7b63b into master Apr 13, 2026
34 checks passed
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