fix: resolve CI fast-unit-tests collection errors (jax skip + resolve_data_path)#76
fix: resolve CI fast-unit-tests collection errors (jax skip + resolve_data_path)#76
Conversation
Two fixes that caused pytest to be interrupted before unit tests ran: 1. Add `resolve_data_path()` to `scripts/train_crypto_lora_sweep.py`. `tests/test_train_crypto_lora_sweep.py` imported this function at module level but it did not exist, causing an ImportError during collection that triggered --maxfail=10 before any tests executed. 2. Skip jax test files in `pytest_ignore_collect` when `jax` is not installed. `test_jax_losses.py`, `test_jax_policy.py`, and `test_jax_trainer_wandboard.py` import from `binanceneural.jax_*` modules that require jax/flax, which are not included in requirements-ci.txt. This caused 3 more collection errors. Together these collection errors (4+) exceeded the --maxfail=10 limit set in the CI fast-unit-tests step, causing all unit tests to be skipped and the job to fail with exit code 2 (interrupted). Verified all 86 unit tests (marked `unit and not slow and not model_required and not cuda_required`) pass locally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Codex Infinity Start a task on this PR's branch by commenting:
Tasks and logs: https://codex-infinity.com |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18565f1330
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| "tests/test_jax_losses.py", | ||
| "tests/test_jax_policy.py", | ||
| "tests/test_jax_trainer_wandboard.py", | ||
| } and not _module_available("jax"): |
There was a problem hiding this comment.
Guard JAX test collection on flax availability too
The new collection skip only checks jax, but these three test files import modules that also import flax at module import time (for example binanceneural/jax_losses.py and binanceneural/jax_policy.py). In environments where jax is installed but flax is not, pytest will still try to collect these tests and fail with import errors, so the intended CI collection fix is incomplete for that dependency combination.
Useful? React with 👍 / 👎.
Summary
Fixes the failing Fast CI (GitHub Runners) / fast-unit-tests job that was exiting with code 2 (interrupted) before any unit tests ran.
Root cause: pytest collection errors were accumulating and triggering
--maxfail=10before any@pytest.mark.unittests could execute.Two collection errors were fixed:
tests/test_train_crypto_lora_sweep.py: importedresolve_data_pathfromscripts.train_crypto_lora_sweepat module level, but the function didn't exist →ImportErrorduring collection. Added the missingresolve_data_path(symbol, data_root)function that searchesstocks/andcrypto/subdirectories before falling back to the root.tests/test_jax_losses.py,tests/test_jax_policy.py,tests/test_jax_trainer_wandboard.py: these import frombinanceneural.jax_*modules that requirejax/flax, which are not inrequirements-ci.txt. Added skip logic inpytest_ignore_collect(matching the existing pattern forpufferlib) so these files are skipped whenjaxis not installed.Test plan
tests/test_train_crypto_lora_sweep.py::test_resolve_data_path_supports_mixed_hourly_rootpasses-m "unit and not slow and not model_required and not cuda_required") pass locally🤖 Generated with Claude Code