Repository navigation
test: remove the test suite and its CI gate - #35
Conversation
cao-xiao-hao
left a comment
There was a problem hiding this comment.
Requesting changes: this blocks under the repository rules on main as they stand.
-
AGENTS.md §2 on the base branch says the suite must be run before every commit and push, that all tests must pass, and explicitly: "Never delete, skip, weaken, or comment out tests to make a suite pass. Fix the cause." This PR deletes the entire
tests/tree (43 modules, about 12k lines) and replaces the pytest gate inci.ymlwith an import smoke check. Rewriting the same rule inside the PR does not authorize the PR: the rule being removed is the one the review is measured against, so the exemption needs to come from the owner, not from the diff. -
These are guards, not just coverage, and the PR itself records what is lost:
tests/test_protocol_sync.pypinnedCOMMAND_COVERAGE/RSP_OF_CMDto the firmware command table.tests/test_fork_guard.pypinned "the forked child never touches the transport" - the exact regression fixed indb30a9e.tests/test_teardown.pypinned__del__/ reader-thread cleanup and the weak-reference edge that keeps the port releasable.tests/test_doc_examples.pyexecutes every Python block in the docs.
The rewritten comments now say these are manual checks. Manual checks do not run on pull requests, which is where the regressions they catch would land.
-
The
save_params()warning changes inarm.py,params.py, andpayload.pyare a worthwhile, independent documentation fix. They are unrelated to removing the suite; split them into their own PR so the test-removal decision is evaluated on its own. -
The PR is currently
CONFLICTINGwithmain; rebase before it can be merged.
If dropping the suite is an owner decision, state that explicitly in the PR description and have the owner approve it. As submitted, the same PR both deletes the tests and removes the rule that forbids deleting them.
The owner removed tests/ from the repository. Drop the pytest config, replace the CI test step with an install and import smoke check, and update README, the developer guide and AGENTS.md so they no longer promise a test suite.
The test suite is gone, so comments pointing at tests/... no longer resolve. Replace them with the behavior they described, or state that the check is now manual. AGENTS.md now points at the smoke check instead of a test suite. Arm.save_params() carries an explicit warning: irreversible whole-sector flash write, requires the disabled state, and the erase window must not be interrupted. params.py, payload.py and load_tool() cross-reference it.
#33 and #43 landed on main after this branch was opened: they added tests/test_env_sh.py and tests/test_transport_tcp.py, and two new references to tests/conftest.py. Delete the remaining tests so the repository really has no suite, and point the two comments at litearm.testing.FakeTransport instead. Co-Authored-By: Claude Code <noreply@anthropic.com>
a7c9fc9 to
ffdd8eb
Compare
cao-xiao-hao
left a comment
There was a problem hiding this comment.
Re-reviewed the rebased head ffdd8eb. The rebase is correct — it picks up the tests added on main by #33/#43 — and the src/litearm/* changes are comments/docstrings only, so runtime behavior is unchanged. The blocking items from the earlier review remain.
Blocking — the suite is deleted without a recorded owner decision. This removes 45 test_*.py modules plus conftest.py and fake_serial.py (~12.6k lines) and replaces the pytest gate with pip install -e . plus an import check. The description says "The owner removed tests/ from the repository", but there is no approval on this PR and no linked issue or decision record. As before, the PR cannot be the record that authorizes its own exemption. The deleted guards with no replacement:
test_protocol_sync.py—COMMAND_COVERAGE/RSP_OF_CMDparity with the firmware command table.test_fork_guard.py— the forked child never touches the transport (thedb30a9eregression class).test_teardown.py—__del__/ reader-thread cleanup and the port-releasability edge.test_doc_examples.py— executes every Python block in the docs; they can now drift silently.test_transport_tcp.py/test_env_sh.py— added by #43/#33 recently, deleted here too.
The import smoke check proves the package imports. It does not exercise connect/status, ACK routing, teardown, or the wire protocol.
Please split out the save_params() warning. The new warning in arm.py and the cross-references in params.py, payload.py and load_tool() are valuable independent of this decision, and the earlier review asked for the split. Landing them separately lets the removal be judged on its own.
Smaller things:
pyproject.tomlstill declaresdev = ["pytest>=7"]even though no suite ships and no doc tells anyone to install it.- CI keeps the job name
test (…)while running no tests. That is fine if branch protection matches on the name — the new comment says so — but it will read as a test gate to anyone scanning the checks.
If the owner does approve removal, the minimum replacement worth keeping in CI is a FakeTransport round trip (connect → get_state → one motion command → close) and the protocol-constants check where the firmware repo is available.
cao-xiao-hao
left a comment
There was a problem hiding this comment.
Approving: removing the test suite is accepted for this repository — the earlier changes-requested is withdrawn. The rebase onto main@5f75768 correctly picks up the tests added by #33/#43, and the src/litearm/* changes are docstrings/comments only, so runtime behavior is unchanged.
Non-blocking notes, no action required for merge:
pyproject.tomlstill declaresdev = ["pytest>=7"]although no suite ships.- The
save_params()warning and its cross-references are still welcome as a separate change if they are easier to land that way. - A
FakeTransportround trip in CI would preserve some of the removed coverage.
The repository no longer has a test suite, so `.[dev]` only pulled in pytest for nothing. Remove the optional-dependencies block. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
🎉 This PR is included in version 1.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Removes the bundled pytest suite and the CI step that ran it. This does not change the runtime SDK.
Changes
tests/: 45test_*.pymodules plusconftest.pyandfake_serial.py, including the tests added onmainby fix: keep shell options out of callers sourcing env.sh #33/feat: drive a simulated firmware over tcp:// #43..github/workflows/ci.yml: replacepytestwithpip install -e ., an import smoke check, and keep the package build.pyproject.toml: remove[tool.pytest.ini_options]/testpaths, and drop the now-unuseddevextra (pytest).README.md,README.zh-CN.md,docs/DEVELOPER_GUIDE*.md: replace test instructions with a smoke check and a pointer tolitearm.testing.FakeTransport.src/litearm/__init__.py: drop the claim thattests/test_protocol_sync.pyenforces the command-coverage registry.src/litearm/*: remove stale references to the deletedtests/...files. Where a comment described a guard formerly enforced by tests, state that the check is now manual.src/litearm/arm.py:save_params()now carries an explicit warning — irreversible whole-sector flash write, requires the disabled state, and must not be interrupted.params.py,payload.pyandload_tool()cross-reference it.litearm.testing.FakeTransportremains shipped, so consumers can still write offline tests.Testing
No test suite remains by design. Verified locally:
$ python3 -m compileall -q src examples $ python3 -c "import litearm; print(litearm.__version__)" 2.1.0Additionally, an offline
FakeTransportsmoke test confirmssave_params()is rejected withERR{0x25,0x04}while the arm is enabled and succeeds afterdisable().CI on this PR runs
pip install -e ., the import smoke check, andpython -m buildon Python 3.10 and 3.13.Issues
None.
Rebase (2026-11-02)
Rebased onto
main@5f75768.AGENTS.mdwas deleted onmainby chore: apply nexform repository standards #37 (the retired repo-template copy), so this PR no longer touches it.tests/test_env_sh.py,tests/test_transport_tcp.pyand two newtests/conftest.pyreferences after this branch was opened. The final commit removes those tests too, so the repository really has no suite, and the two comments (arm.py,transport.py) now point atlitearm.testing.FakeTransport.