Repository navigation
Fix two pre-existing Backend CI failures blocking every open PR - #7639
Conversation
_read_backend landed in #7385 without an encoding, so it falls back to the platform default and breaks on Windows the moment a backend file it reads gains a non-ASCII byte. tests/test_source_read_encoding.py guards exactly this and is currently failing on main, which turns Repo tests (CPU) red on every open PR whose CI runs the merge commit. The sibling _read helper directly above already passes encoding = "utf-8".
Three test_start.py cases assert on plain substrings of result.output, e.g. "Invalid value for '--gpu-memory-mode'". Typer renders parameter errors through Rich, which emits ANSI escapes as soon as FORCE_COLOR is set, so the substring is split across escape sequences and the assertion fails even though the message is present. They pass locally and fail in CI purely because the runner exports FORCE_COLOR; click, typer and rich are the same versions in both. Setting NO_COLOR alone does not help, FORCE_COLOR still wins, so the autouse fixture removes FORCE_COLOR and CLICOLOR_FORCE as well. #7598 only recently started running unsloth_cli/tests in Backend CI, which is why this surfaced now. Verified: the whole suite is 748 passed with and without FORCE_COLOR=1.
|
Added a second, independent fix to this PR: three They assert plain substrings of Click, Typer and Rich are identical locally and in CI (8.4.2 / 0.27.0 / 15.0.0), so it is not version drift. Reproduced by exporting
#7598 only recently started running these in Backend CI, which is why it surfaced now. The whole suite is 748 passed, 4 skipped with and without |
One conflict, in tests/studio/test_model_picker_contracts.py: unslothai#7639 added the explicit encoding to _read_backend on main while this branch had already added it with a comment explaining why. Same line either way, so the comment is kept. Re-verified on the merged tree rather than assuming the merge was inert: 2141 passed and 3 skipped across tests/studio, 316 passed across test_openai_auto_switch.py and test_api_monitor.py, typecheck clean, 111/111 node tests (main brought 8 of its own), production build clean.
Repo tests (CPU) is currently red on main:
_read_backendarrived in #7385 without an encoding. The sibling_readhelper directly above it already passesencoding = "utf-8", so this just makes the two agree.Worth fixing promptly because CI for a
pull_requestruns the merge commit, so every open PR inherits this failure even when its own head does not contain the helper. It is currently red on unrelated PRs for that reason.Verified on a clean
mainworktree: the guard test fails before, andtests/test_source_read_encoding.pyplus the fulltests/studio/test_model_picker_contracts.py(66 tests) pass after.