Repository navigation
ci: add macOS and Windows smoke tests - #35
Conversation
Add a `smoke` job that installs the package, starts the console script, and round-trips a saved trace on macOS and Windows. The full suite, lint, type checks and build stay in the existing Linux job, which is not modified. The subset is deliberately narrow: test_storage.py saves and loads traces under tmp_path and test_cli.py covers help/version/no-command, so the job answers "does this install and does the format round-trip here" without requiring the whole suite on every OS. Both use tmp_path or the in-process runner, so neither reads a committed bundle. Documented in the job rather than fixed here: the committed .sftrace bundles carry SHA-256 digests over file bytes, while the writers in trace/storage.py open in text mode without newline="". A bundle written on Windows therefore carries CRLF and cannot reproduce a Linux digest, and a Windows checkout rewrites the committed fixtures before any test runs (no .gitattributes). Making the on-disk format byte-identical across platforms is a separate change. Python versions are 3.11 and 3.13, the lowest and highest supported; the middle version remains covered by the Linux matrix.
|
CI has run: all eight jobs pass, including the four this PR adds. So the part of the description that said the Windows jobs were "unverified by me" is now answered by CI, and I could not have produced that answer from here. One thing this result does not establish, stated so nobody reads "Windows smoke passes" as more than it is: it does not show that a bundle written on Windows is interchangeable with one written on Linux. Every save/load test in |
|
Thanks for opening this PR and for the fix, @how2how2how2-arch. The new macOS and Windows smoke jobs are green, and documenting the CRLF digest limitation as a follow up was the right call. Appreciate the detailed testing notes. Merged. |
Refs #28
Summary
Adds one job,
smoke, to.github/workflows/ci.yml. It installs the package, starts the console script, and round-trips a saved trace on macOS and Windows. The existingtestjob is not modified — the diff is additions only (63 insertions, 0 deletions).I commented the proposal on the issue first, as its text asks. This PR is that proposal, runnable.
Changes
Steps:
uv sync --locked→stepfork --version→stepfork --help→pytest tests/unit/test_storage.py tests/unit/test_cli.py -q.Why this subset:
test_storage.pyis the trace save/load surface (every test usestmp_path), andtest_cli.pycovers help, version and no-command. Together they are the "installation, CLI startup, trace save/load" the issue names.tmp_pathor the in-processCliRunner, so neither reads a committed.sftracebundle. That matters, see the limitation below.stepfork --version), because a missing or broken entry point on a new OS is the failure this job exists to catch, and the in-process runner would not see it.Python versions are 3.11 and 3.13, the lowest and highest supported per
requires-python. The middle version stays covered by the Linux matrix; that is a deliberate cost choice, not a claim of equal coverage. Adding 3.12 takes it from 4 jobs to 6.Platform limitation found, documented in the job rather than fixed here
Checking whether the job could actually be green turned up a cross-platform issue worth its own change:
trace/integrity.py::_hash_fileandexport/receipt.py::bundle_digesthash file bytes;trace/storage.pyusewrite_textandpath.open("w")withoutnewline="";.sftrace/integrity files underexamples/andtests/golden/, and no.gitattributes.So a bundle written on Windows contains
\r\nand cannot reproduce a digest recorded on Linux, and onwindows-latestgit's defaultcore.autocrlf=truerewrites those committed files to CRLF at checkout, before any test runs. A Windows job that read them would fail for a reason unrelated to installation. The fix isnewline=""on the writers and/or.gitattributeswitheol=lf; it changes the on-disk format contract, so it should have its own test rather than ride along in a CI PR. Happy to do it next if you want it.Testing
I can only test the macOS half locally: this machine is macOS arm64, Python 3.13.9. Running the job's exact commands:
The workflow file parses, and both jobs are present:
I have no Windows machine, so the Windows jobs are unverified by me until CI runs them here. That is what this PR is for; if they fail, the failure log is the deliverable.
Checklist