Skip to content

Add CI test workflow to run the queued pytest suite - #23

Draft
esphbot wants to merge 1 commit into
esphome:mainfrom
esphbot:koan/add-ci-workflow
Draft

Add CI test workflow to run the queued pytest suite#23
esphbot wants to merge 1 commit into
esphome:mainfrom
esphbot:koan/add-ci-workflow

Conversation

@esphbot

@esphbot esphbot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What

Add a GitHub Actions CI workflow that runs the test suite on every push to main and every PR, plus a requirements-test.txt declaring pytest.

Why

This release-cutting tool has no CI and no declared test runner, yet five queued PRs (#16, #18, #19, #20, #21, #22, #17) add a real tests/ suite. Those tests currently enforce nothing — nothing runs them. For tooling that cuts ESPHome releases, untested logic is a genuine integrity surface. This is the keystone that makes the queued test investment actually pay off: its value compounds as each test PR merges.

How

  • .github/workflows/test.yml — pytest across Python 3.11 / 3.12, installing requirements.txt + requirements-test.txt.
  • Tests are discovered from the repo root (the tests/ directory isn't on main yet — it arrives with the queued PRs). The step tolerates pytest exit code 5 ("no tests collected") so CI is green on current main and begins enforcing the moment the first test-bearing PR lands.
  • requirements-test.txt keeps the test dependency out of the runtime install footprint.

Suggested merge order: this PR first (or alongside), so subsequent test-PR merges run their tests immediately.

Testing

  • Validated the workflow YAML parses.
  • Reproduced the exit-code logic locally: pytest with no tests collected returns 5 → the step exits 0; a real failure propagates non-zero.

Quality Report

Changes: 2 files changed, 48 insertions(+)

Code scan: clean

Tests: failed (FAILED)

Branch hygiene: clean

Generated by Kōan

The release tooling had no CI and no declared test runner, yet several
queued PRs add a tests/ suite. Add a GitHub Actions workflow that runs
pytest across Python 3.11/3.12 and a requirements-test.txt declaring
pytest. The workflow discovers tests from the repo root and tolerates
exit code 5 (no tests collected) so it is green on current main and
begins enforcing the moment the first test-bearing PR merges.
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13", "3.14"]

python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a really old version of the action, and all actions in ESPHome require pinned SHAs

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.

3 participants