Skip to content

fix: resolve fast-unit-tests CI collection errors and stale config assertions#77

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

fix: resolve fast-unit-tests CI collection errors and stale config assertions#77
lee101 wants to merge 1 commit intomainfrom
ci-fix/stock-prediction-fast-unit-tests-76

Conversation

@lee101
Copy link
Copy Markdown
Owner

@lee101 lee101 commented Mar 27, 2026

Summary

Four issues were causing the `fast-unit-tests` CI job (Python 3.13) to fail at collection time on PR #76:

  • JAX import errors (`test_jax_losses.py`, `test_jax_policy.py`, `test_jax_trainer_wandboard.py`): All three failed with `ModuleNotFoundError: No module named 'jax'` / `'flax'`. These packages are not in `requirements-ci.txt`. Added `pytest.skip(allow_module_level=True)` guards so the tests are cleanly skipped when jax/flax are absent instead of crashing collection.

  • Missing `resolve_data_path` function (`test_train_crypto_lora_sweep.py`): `ImportError: cannot import name 'resolve_data_path' from 'scripts.train_crypto_lora_sweep'`. Added `resolve_data_path(symbol, data_root)` that checks both flat (`{root}/{symbol}.csv`) and stocks-subdirectory (`{root}/stocks/{symbol}.csv`) layouts, and updated `main()` to use it.

  • Stale config assertions (`test_120d_eval_scripts.py::test_deployed_config_values`): `DEPLOYED_CONFIG` in `scripts/run_120d_worksteal_eval.py` was updated (`dip_pct` 0.20→0.18, `profit_target_pct` 0.15→0.20, `stop_loss_pct` 0.10→0.15) but the test assertions were not kept in sync. Updated test to match actual deployed values.

Tests run

```
CI=1 FAST_CI=1 CPU_ONLY=1 python -m pytest -v
-m "unit and not slow and not model_required and not cuda_required"
--tb=short --maxfail=10 tests/
```

Result: 78 passed, 14 skipped, 3963 deselected (0 failures, 0 collection errors)

Also verified `tests/test_train_crypto_lora_sweep.py::test_resolve_data_path_supports_mixed_hourly_root` passes independently.

🤖 Generated with Claude Code

…sertions

Four issues were causing the fast-unit-tests CI job to fail at collection time:

1. tests/test_jax_losses.py, test_jax_policy.py, test_jax_trainer_wandboard.py:
   All three fail with ModuleNotFoundError for jax/flax which are not in
   requirements-ci.txt. Added pytest.skip(allow_module_level=True) guards so
   tests are cleanly skipped when jax/flax are absent rather than erroring.

2. tests/test_train_crypto_lora_sweep.py:
   ImportError for resolve_data_path which was missing from
   scripts/train_crypto_lora_sweep.py. Added resolve_data_path() that checks
   both {root}/{symbol}.csv (flat) and {root}/stocks/{symbol}.csv (sub-dir)
   layouts, and updated main() to use it.

3. tests/test_120d_eval_scripts.py::test_deployed_config_values:
   DEPLOYED_CONFIG in scripts/run_120d_worksteal_eval.py was updated (dip_pct
   0.20->0.18, profit_target_pct 0.15->0.20, stop_loss_pct 0.10->0.15) but
   the test assertions were not kept in sync. Updated test to match actual
   deployed values.

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

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