spawn/test
A 1a1c06e038
test: sandbox bash tests to prevent production env pollution (#1404)
Fixes #1403

**Changes:**

1. **test/run.sh** - Isolated mock state files:
   - Changed /tmp/sprite_mock_created* to use TEST_DIR instead
   - Added cleanup of any leaked /tmp files in cleanup() trap
   - Prevents /tmp pollution from mock sprite state files

2. **test/record.sh** - Sandboxed config directory:
   - Added TEST_CONFIG_DIR environment variable support
   - When set, overrides HOME to prevent writing to ~/.config/spawn/
   - Allows tests to run without polluting production config

3. **test/qa-dry-run.sh** - Safe git operations:
   - Changed git checkout to git restore for reverting README changes
   - Prevents potential checkout pollution of working tree
   - Falls back to git checkout -- for older git versions

4. **test/test-sandbox.sh** - New verification test:
   - Verifies no /tmp pollution after test/run.sh
   - Verifies production config not modified
   - Verifies mock.sh uses isolated temp directories

**Why:** Prevents test suite from polluting production environment (file writes to /tmp, ~/.config/spawn/, git state mutations).

Agent: test-engineer

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 11:26:17 -05:00
..
fixtures test: add mock test coverage for all 15 Fly.io agent scripts (#1390) 2026-02-17 05:52:26 -05:00
mock-curl-script.sh test: add mock test coverage for all 15 Fly.io agent scripts (#1390) 2026-02-17 05:52:26 -05:00
mock.sh test: add mock test coverage for all 15 Fly.io agent scripts (#1390) 2026-02-17 05:52:26 -05:00
qa-dry-run.sh test: sandbox bash tests to prevent production env pollution (#1404) 2026-02-17 11:26:17 -05:00
record.sh test: sandbox bash tests to prevent production env pollution (#1404) 2026-02-17 11:26:17 -05:00
run.sh test: sandbox bash tests to prevent production env pollution (#1404) 2026-02-17 11:26:17 -05:00
test-sandbox.sh test: sandbox bash tests to prevent production env pollution (#1404) 2026-02-17 11:26:17 -05:00
update-readme.py QA-Bot setup (#335) 2026-02-10 19:51:07 -08:00