Skip to content

fix: centralize test data directories to project_root/.tmp#544

Merged
dengwx2009 merged 1 commit intomasterfrom
fix/centralize-test-data-dirs
Mar 3, 2026
Merged

fix: centralize test data directories to project_root/.tmp#544
dengwx2009 merged 1 commit intomasterfrom
fix/centralize-test-data-dirs

Conversation

@dengwx2026
Copy link
Collaborator

Summary

  • Add test_workdir session fixture in root conftest.py that redirects all ROCK_*_DIR env vars to project_root/.tmp/test_data/
  • Fix PermissionError: [Errno 13] Permission denied: '/data' in unit tests (e.g. test_chat_completions_routing_success)
  • Remove scattered per-file env overrides from test_model_service.py and test_close_session.py

Test plan

  • test_chat_completions_routing_success passes (was failing with PermissionError)
  • Full unit test suite: 190 passed, 0 failed
  • Lint clean (ruff check)

fixes #543

🤖 Generated with Claude Code

Add test_workdir fixture in root conftest.py that redirects all
ROCK_*_DIR env vars to .tmp/test_data/, fixing PermissionError
on /data paths in non-container environments.

- Set env vars at module import time for config.py constants
- Set both env_vars module attrs and os.environ for subprocess inheritance
- Remove scattered overrides from test_model_service.py and test_close_session.py
- Fix test_envs.py to test raw defaults via delattr

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dengwx2009 dengwx2009 merged commit 8088f5c into master Mar 3, 2026
9 checks passed
zhongwen666 pushed a commit to zhongwen666/ROCK that referenced this pull request Mar 3, 2026
…) (alibaba#544)

Add test_workdir fixture in root conftest.py that redirects all
ROCK_*_DIR env vars to .tmp/test_data/, fixing PermissionError
on /data paths in non-container environments.

- Set env vars at module import time for config.py constants
- Set both env_vars module attrs and os.environ for subprocess inheritance
- Remove scattered overrides from test_model_service.py and test_close_session.py
- Fix test_envs.py to test raw defaults via delattr

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.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.

fix: centralize test data directories to avoid PermissionError on /data paths

2 participants