|
| 1 | +--- |
| 2 | +allowed-tools: Bash(container *), Bash(cargo *), Read, Grep, Glob |
| 3 | +--- |
| 4 | + |
| 5 | +# Run Tests in Linux Container (Apple `container` CLI) |
| 6 | + |
| 7 | +Run RustPython tests inside a Linux container using Apple's `container` CLI. |
| 8 | +**NEVER use Docker, Podman, or any other container runtime.** Only use the `container` command. |
| 9 | + |
| 10 | +## Arguments |
| 11 | +- `$ARGUMENTS`: Test command to run (e.g., `test_io`, `test_codecs -v`, `test_io -v -m "test_errors"`) |
| 12 | + |
| 13 | +## Prerequisites |
| 14 | + |
| 15 | +The `container` CLI is installed via `brew install container`. |
| 16 | +The dev image `rustpython-dev` is already built. |
| 17 | + |
| 18 | +## Steps |
| 19 | + |
| 20 | +1. **Check if the container is already running** |
| 21 | + ```shell |
| 22 | + container list 2>/dev/null | grep rustpython-test |
| 23 | + ``` |
| 24 | + |
| 25 | +2. **Start the container if not running** |
| 26 | + ```shell |
| 27 | + container run -d --name rustpython-test -m 8G -c 4 \ |
| 28 | + --mount type=bind,source=/Users/al03219714/Projects/RustPython3,target=/workspace \ |
| 29 | + -w /workspace rustpython-dev sleep infinity |
| 30 | + ``` |
| 31 | + |
| 32 | +3. **Run the test inside the container** |
| 33 | + ```shell |
| 34 | + container exec rustpython-test sh -c "cargo run --release -- -m test $ARGUMENTS" |
| 35 | + ``` |
| 36 | + |
| 37 | +4. **Report results** |
| 38 | + - Show test summary (pass/fail counts, expected failures, unexpected successes) |
| 39 | + - Highlight any new failures compared to macOS results if available |
| 40 | + - Do NOT stop or remove the container after testing (keep it for reuse) |
| 41 | + |
| 42 | +## Notes |
| 43 | +- The workspace is bind-mounted, so local code changes are immediately available |
| 44 | +- Use `container exec rustpython-test sh -c "..."` for any command inside the container |
| 45 | +- To rebuild after code changes, run: `container exec rustpython-test sh -c "cargo build --release"` |
| 46 | +- To stop the container when done: `container rm -f rustpython-test` |
0 commit comments