Skip to content

feat(core): accept split and existing config flow tests in config-flow-tests - #186

Open
joostlek wants to merge 2 commits into
mainfrom
clanker/relaxed-shannon-cxsiiv
Open

joostlek wants to merge 2 commits into
mainfrom
clanker/relaxed-shannon-cxsiiv

Conversation

@joostlek

@joostlek joostlek commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Proposed change

Extends the config-flow-tests check (added in #106) so it stops failing PRs that do have config flow tests:

  • Accepts split test files: any added or modified tests/components/<domain>/test_config_flow*.py counts, e.g. test_config_flow_options.py. Removed files still don't count.
  • Passes when tests/components/<domain>/test_config_flow.py already exists at the head commit, even if the PR doesn't touch it.
  • Only a top-level homeassistant/components/<domain>/config_flow.py counts as a new config flow; a config_flow.py in a subpackage is ignored.
  • The failure message now names the exact test file to add for each integration.

Skip/pass messages, the docs link, events and waiver settings are unchanged from #106, so the dispatch snapshots don't change. All of #106's tests are kept as they were; new tests cover the cases above.

Type of change

  • Dependency upgrade
  • Bugfix
  • New rule or command
  • New repository manifest (enable the bot on another repo)
  • New feature (which adds functionality to an existing engine)
  • Code quality improvement or refactor (incl. tests)

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass (mise run test). Your PR cannot be merged unless tests pass.
  • Lint and type checks pass (mise run check).
  • The code has been formatted (mise run format).
  • Tests have been added to verify that the new code works.
  • There is no commented out or debug code in this PR.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If behaviour, configuration, or environment variables changed:

  • README.md and .env.example have been updated accordingly.

Generated by Claude Code

Add a `config-flow-tests` check for home-assistant/core that fails when a
PR adds `homeassistant/components/<domain>/config_flow.py` without config
flow tests. Tests count when the PR adds or changes a
`tests/components/<domain>/test_config_flow*.py`, or when
`test_config_flow.py` already exists at the head commit. Only org members
can waive it.

This closes the gap where Codecov's 100% patch target on config_flow.py
never fires because CI skips integrations without a tests folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SLHDn89A2kWbEMXXcWAysQ
main added its own config-flow-tests rule (#106, #193). Keep main's rule
and messages as the base and fold in this branch's extra cases: split
test_config_flow_*.py files, tests already at the head commit, nested
config_flow.py ignored, and missing test paths named in the failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SLHDn89A2kWbEMXXcWAysQ
@joostlek joostlek changed the title feat(core): require tests when a PR adds a config flow feat(core): accept split and existing config flow tests in config-flow-tests Dec 3, 2026
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