Skip to content

fix: resolve CI fast-unit-tests collection errors (jax skip + resolve_data_path)#76

Open
lee101 wants to merge 1 commit intomainfrom
ci-fix/stock-prediction-unit-tests-fix
Open

fix: resolve CI fast-unit-tests collection errors (jax skip + resolve_data_path)#76
lee101 wants to merge 1 commit intomainfrom
ci-fix/stock-prediction-unit-tests-fix

Conversation

@lee101
Copy link
Copy Markdown
Owner

@lee101 lee101 commented Mar 27, 2026

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=10 before any @pytest.mark.unit tests could execute.

Two collection errors were fixed:

  • tests/test_train_crypto_lora_sweep.py: imported resolve_data_path from scripts.train_crypto_lora_sweep at module level, but the function didn't exist → ImportError during collection. Added the missing resolve_data_path(symbol, data_root) function that searches stocks/ and crypto/ 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 from binanceneural.jax_* modules that require jax/flax, which are not in requirements-ci.txt. Added skip logic in pytest_ignore_collect (matching the existing pattern for pufferlib) so these files are skipped when jax is not installed.

Test plan

  • tests/test_train_crypto_lora_sweep.py::test_resolve_data_path_supports_mixed_hourly_root passes
  • All 86 unit tests (-m "unit and not slow and not model_required and not cuda_required") pass locally
  • Ruff lint passes on the neuraldailytraining targets checked by CI
  • No new ruff issues introduced in the modified files (lint CI only checks specific neuraldailytraining targets, not scripts/ or tests/conftest.py)

🤖 Generated with Claude Code

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>
@lee101
Copy link
Copy Markdown
Owner Author

lee101 commented Mar 27, 2026

Codex Infinity
Hi! I'm Codex Infinity, your coding agent for this repo.

Start a task on this PR's branch by commenting:

Tasks and logs: https://codex-infinity.com

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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"):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant