Conversation
- Add .gitignore for Python/IDE/build artifacts - Add GitHub Actions CI (test matrix: 3.10, 3.11, 3.12 + import lint) - Add tests/test_fleet_compat.py with 35 new tests covering: - Fleet compat (16 tests): failure-to-status mapping, error codes, simulation result status, FleetError wrapping, enrich_step_record - Harness edge cases (8 tests): reset, agent removal, string failure type, empty queue step, DELAYED/DUPLICATE/CORRUPTED failures, max_steps limit - FailureInjector advanced (6 tests): has_planned_failures, multiple same-step, targeted injection, consume-once, rate boundary - Trust scores (3 tests): increase on success, decrease on error, clamp to [0,1] - Agent send (2 tests): send via harness, send without harness - Total: 60 passed, 2 skipped (require real fleet-stdlib)
| import os | ||
| sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src')) |
There was a problem hiding this comment.
🟡 Wrong sys.path manipulation causes ImportError when running test file standalone
Line 17 adds src/ to sys.path (copied from test_extended.py), but lines 19-34 use from src.xxx imports (matching test_sandbox.py's style). These two patterns are incompatible: adding src/ to sys.path enables from harness.xxx imports (without the src. prefix), while from src.xxx imports require the project root on sys.path. Running python tests/test_fleet_compat.py fails immediately with ModuleNotFoundError: No module named 'src'. The file explicitly includes if __name__ == "__main__": unittest.main() at line 377 suggesting standalone execution is intended. Compare with tests/test_sandbox.py:14-17 which correctly adds the project root for the same from src.xxx import style.
| import os | |
| sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src')) | |
| # Ensure project root is on sys.path so ``src.xxx`` relative imports resolve. | |
| _PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| if _PROJECT_ROOT not in sys.path: | |
| sys.path.insert(0, _PROJECT_ROOT) |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Adds CI, .gitignore, and expanded test coverage for the sandbox simulation framework.
Changes
ci.yml):tests/test_fleet_compat.py:Test Results
Files Added
.gitignore.github/workflows/ci.ymltests/test_fleet_compat.py