Repository navigation
Tests: keep five tests off what the host has installed or downloaded - #13395
Merged
Merged
Conversation
- test_media_model_index_accounts, test_openai_catalog: the media scan walks every known HF cache home, including a host HF_HOME and the platform default under XDG_CACHE_HOME, which the suite-wide empty hub cache does not cover. Point both at nothing for these tests. - test_training_gated_upstream: the 4-bit row of the pre-detect test reads the 4-bit table only where bitsandbytes is usable. Pin that answer; the fallback has its own test. - test_sandbox_linux: _fake_editable now makes its dist-info the only one editable_source_roots sees, so a pip install -e in the running environment is not granted too. - test_async_grpo_fast_inference: skip the TRL client round trip when VLLMClient has no LoRA adapter calls (TRL < 1.14).
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
danielhanchen
added a commit
that referenced
this pull request
Oct 18, 2026
…solver checks hold on every host (#14116) Follow-up to #13265, #13395 and #13701. Each one was rechecked on other hosts and environments, and these four gaps showed up. Each one reproduces on `main` and is fixed here. No product code changes. ## Studio `--help` test (#13265) `COLUMNS=200` is not enough. Typer passes an inherited `TERMINAL_WIDTH` to Rich as an explicit width. `GITHUB_ACTIONS`, `FORCE_COLOR` or `PY_COLORS` force terminal mode, whose colour codes split every flag (`--model` no longer appears as a substring). On staging, the test fails on `ubuntu-latest` and `macos-15` for exactly this reason. The test now also sets `TERMINAL_WIDTH=200` and `_TYPER_FORCE_DISABLE_TERMINAL=1` (both present from Typer 0.19, the floor), and it decodes the child's output as UTF-8 so a CJK Windows code page cannot break the decode. | Environment | `main` | Here | | --- | --- | --- | | none | pass | pass | | `TERMINAL_WIDTH=80` | fail | pass | | `GITHUB_ACTIONS=true` | fail | pass | | `FORCE_COLOR=1` | fail | pass | | `PY_COLORS=1` | fail | pass | | `GITHUB_ACTIONS=true TERM=dumb` | fail | pass | ## Media scan tests (#13395) `test_media_model_index_accounts.py` and `test_openai_catalog.py` cleared `HF_HOME` and redirected `XDG_CACHE_HOME`. The scan also reads: - `hf_default_cache_dir()`, which is `Path.home() / ".cache" / "huggingface" / "hub"` and ignores `XDG_CACHE_HOME`; - the LM Studio, Hermes, Ollama and oMLX model folders, including the system-wide Ollama paths; - `./models` under the working directory. So the most common developer setup, an image model in the default HF cache, still added rows. Both fixtures now point those helpers at the test's temp dir and run from it. Patching the helpers rather than `HOME` means the fix works the same on Windows (`USERPROFILE`), macOS and Linux. Result with a fake image model planted in each location (33 tests in each case): | Case | `main` | Here | | --- | --- | --- | | clean | 33 passed | 33 passed | | model in `~/.cache/huggingface/hub`, `~/.lmstudio/models`, `OLLAMA_MODELS` | 4 failed | 33 passed | | pytest run from a folder with `models/<x>/model_index.json` | 4 failed | 33 passed | ## Installer differential comparer (#13265) The rule that drops a repeated 100% bar (a winget redraw) compared lines after sizes were normalised. That made two genuinely different events collapse into one bar and compare equal: - a second transfer with no header line, where a partial frame sits between the two full bars; - two finished downloads of different sizes. A repeat is now dropped only when no partial frame was seen since the kept bar and the raw numbers match. Two new tests cover these cases; they fail on `main` and pass here. The existing redraw test still passes (94 passed). ## Node harness resolver (#13701) #13701 lets a `const` bound to an arrow or function expression be lifted even when some of its references cannot be. Two shapes could now load-crash a harness: - an eagerly evaluated const that calls such a helper on load (`const TABLE = { v: f() }`, directly or through another helper); - an immediately invoked `const v = function () { ... }();`, which runs on load. The first is now dropped like a const that reads the missing reference itself. A const that only names the helper (`[g]`) is kept. The second stays eager. No current frontend source has either shape: a sweep of every top-level declaration in `studio/frontend/src` found no harness that loads only on one side. All 278 tests that use the resolver pass, and the two new tests fail with the old resolver. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.
Summary
Five tests pass in CI but fail on a normal development machine, because they read what the host has installed or downloaded instead of only what the test sets up. Each one was reproduced on main in a Python 3.13 environment matching CI's Repo tests job (CPU torch 2.10, transformers 5.17), with HF_HOME set, models in the HF cache, an editable install and TRL 1.13. Each one passes after this change both on that host and with an empty cache.
No product code changes.
The five
test_media_model_index_accounts(2 tests) andtest_openai_catalog(2 tests)['Qwen/Qwen-Image-2512', 'Tongyi-MAI/Z-Image', ...] == ['owner-flux']._hf_cache_is_emptyfixture pins the hub cache, but not the other two places the scan reads: a hostHF_HOME, which is captured inhf_cache_settings._EXPLICIT_CACHE_ENVat import, and the platform default underXDG_CACHE_HOMEor~/.cache.HF_HOMEsnapshot and pointXDG_CACHE_HOMEat an empty directory.test_training_gated_upstream::test_pre_detect_reads_the_repo_the_loader_fetches[...bnb-4bit]_metadata_lookup_nameonly reads the 4-bit table when_bitsandbytes_allows_4bit()is true, and that is false wherever unsloth imports on a CPU host.test_pre_detect_follows_the_bitsandbytes_fallbackalready covers the false branch.test_sandbox_linux(3 editable-root tests)_fake_editableprepends a fake dist-info, buteditable_source_roots()also walks every real distribution. Apip install -ein the environment running the suite then gets granted too._fake_editablenow makes its dist-info the only oneimportlib.metadata.distributionsreturns.tests/test_async_grpo_fast_inference.py::test_trl_vllm_client_reads_this_server'VLLMClient' object has no attribute 'load_lora_adapter'. TRL 1.13's async GRPO client only syncs full weights, and Unsloth already refusesfast_inferenceAsyncGRPO below TRL 1.14 (_check_async_grpo_fast_inference).Testing
HF_HOMEset, models cached, editable install)test_hf_cache_settings.py, emptyXDG_CACHE_HOME, noHF_HOMEtests/test_async_grpo_fast_inference.pyon TRL 1.13