fix(tests): unbreak CI on Linux, and bump to 0.5.2 - #175
Merged
Conversation
Patch: no schema change, no new capability. #172 retimed the live detector to 01:20 UTC (cutting ~12h of detection lag), #174 made that safe, and #169 downgraded an unreachable venue from an ERROR traceback to a warning. #174 is the reason this release exists rather than #172 alone. The retiming trades a 13-hour data-publication margin for 20 minutes, and nothing on the live entry path dedupes an order -- so the freshness gate in `run_once` that withholds ALL entries when any bar is unconfirmed has to ship in the SAME wheel as the schedule it protects. Installing this wheel is a prerequisite for copying the new keel-live-run.sh/com.keel.live.plist to the deployment; the shell files alone would be the unsafe half. uv.lock relocked in the SAME commit, per 0.5.0 and 0.5.1. Verified with `uv sync --frozen`, which accepted the lock and rewrote nothing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… on Linux `main` went red the moment #174 landed. The new real-script tests execute the shipped `keel-live-run.sh` under `/usr/bin/sandbox-exec` (so a test run can never fire a real notification on a machine that also trades real money), with a `date` shim built on BSD `date -r` and stamp-failure cases built on `chflags uchg`. None of those exist on Linux, so all 45 invocations died with FileNotFoundError on the ubuntu runner. This is not a coverage question worth solving portably. The artifact under test IS a macOS deployment -- launchd plus `osascript` -- and the script only ever runs on the box that owns the launchd job. So on non-Darwin the real-script tests SKIP, and the schedule INVARIANT (exactly one cycle per UTC date, across both DST transitions) stays covered everywhere, because that is proven by the pure-Python model tests, which are platform-neutral. One runtime guard in `_run_script` covers all 45 call sites, since every invocation already funnels through it. The five tests that reach for `chflags` BEFORE running the script carry an explicit `@_macos_only` mark, where the runtime guard would come too late to stop a FileNotFoundError. Blocks the release otherwise: `release.yml` refuses to publish unless tests pass, so 0.5.2 could not have been cut with main in this state. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Two commits: a CI fix that
mainneeds right now, and the 0.5.2 version bump that depends on it.1.
mainis red — the real-script tests are macOS-only#174 added tests that execute the shipped
keel-live-run.shunder/usr/bin/sandbox-exec, so a test run can never fire a real notification on a machine that also trades real money. The harness also uses BSDdate -randchflags uchg. None of those exist on Linux, so all 45 invocations died withFileNotFoundError: /usr/bin/sandbox-execon the ubuntu runner, andmain's push CI has been failing since #174 merged.This is not a coverage question worth solving portably. The artifact under test is a macOS deployment — launchd plus
osascript— and the script only ever runs on the box that owns the launchd job. So on non-Darwin the real-script tests skip, while the schedule invariant (exactly one cycle per UTC date, across both DST transitions) stays covered on every platform, because that is proven by the pure-Python model tests.One runtime guard in
_run_scriptcovers all 45 call sites, since every invocation already funnels through it. The five tests that reach forchflagsbefore running the script carry an explicit@_macos_onlymark, where the runtime guard would come too late.This blocks everything else:
release.ymlrefuses to publish unless tests pass, so 0.5.2 could not be cut withmainin this state.2. Bump to 0.5.2
Patch — no schema change, no new capability. Ships #169, #172 and #174.
#174 is why this release exists rather than #172 alone. #172 retimed the live detector to 01:20 UTC, cutting ~12h of detection lag, but traded a 13-hour data-publication margin for 20 minutes — and nothing on the live entry path dedupes an order. #174's freshness gate in
run_oncewithholds all entries whenever any bar is unconfirmed, and it must ship in the same wheel as the schedule it protects.That makes the deployment order strict: install this wheel first, then copy
keel-live-run.sh/com.keel.live.plist. The shell files alone are the unsafe half. The plist also goes from 12 triggers to 24, so it needs alaunchctlreload, unlike the comment-only change in #171.uv.lockrelocked in the same commit, verified withuv sync --frozen.Gate: 1976 tests pass locally, ruff clean, mypy clean.
🤖 Generated with Claude Code