ci: run ct002 codegen unit tests in the host-e2e job#398
Open
tomquist wants to merge 1 commit into
Open
Conversation
The codegen schema-validator tests in tests/components/ct002/test_codegen.py
importorskip("esphome"), so they need the esphome Python module importable
in the venv that runs pytest. Previously they ran nowhere: the validate job
has no esphome installed, the ct002-host-e2e job only puts the esphome CLI on
PATH (via uv tool install) and selects -m esphome_e2e (which these aren't),
and no other job touches them.
Install esphome into the project venv at the end of the host-e2e job and run
the codegen tests with uv run --no-sync (esphome isn't in uv.lock, so a sync
would drop it). Ordered after the e2e run so the venv mutation can't perturb
it.
|
Caution Review failedFailed to post review comments WalkthroughIntroduces an ESPHome ct002 external component with filters, balancer, protocol, MQTT/HA/Marstek integrations; adds host/CMake tests, E2E backends and YAML configs; updates Python ct002 aggregation, simulator with DC input, Modbus UDP, HomeAssistant REST bootstrap; updates docs, CI, and release tooling. ChangesCT002 ESPHome feature and cross-backend updates
Estimated code review effort🎯 5 (Critical) | ⏱️ ~150 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The codegen schema-validator tests in
tests/components/ct002/test_codegen.pyimportorskip("esphome")— they import the esphome Python module to exercise thect002schema validators (MAC normalization, three-phase sensor validation) directly. That means they need the esphome module importable in the venv that runspytest.They ran nowhere in CI:
validatejob — esphome isn't installed →importorskipskips them (this is theESPHome not installed; skipping codegen unit tests / SKIPPEDline seen in CI logs).ct002-host-e2ejob — only puts the esphome CLI on PATH (viauv tool install, which is an isolated env, not importable), and selects-m esphome_e2e, which these tests aren't marked with.So 8 unit tests were silently dead. (The ESPHome E2E tests — the
esphome_e2e-marked suites — do run correctly inct002-host-e2e; they detect esphome viashutil.which("esphome"), so they were unaffected.)Fix
Run the codegen tests in the
ct002-host-e2ejob, which already has the esphome toolchain:--no-sync— esphome isn't inuv.lock, so a normaluv runwould re-sync and drop it;--no-syncpreserves the pip-installed module.Verification
Locally:
uv pip install esphome+uv run --no-sync pytest test_codegen.py→ 8 passed.CI/tooling-only change; no
CHANGELOG.mdentry (no user-visible behavior change).https://claude.ai/code/session_01EmFCdUKkFS5gp87kkjr5t1
Generated by Claude Code
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation