spawn/test
A 6647f7ca05
refactor: reduce complexity in test/mock.sh and test/record.sh (#1096)
Extract assertion tracking and fixture detection logic in mock.sh:
- New _run_assertions_and_track() helper consolidates 20 lines of repeated assertions
- New _has_missing_fixture() helper checks mock log for fixture errors
- run_test() now 30 lines shorter, focusing on orchestration rather than details

Extract cloud endpoints data in record.sh:
- Replace 132-line case statement with data-driven approach
- Each cloud's endpoints now live in _ENDPOINTS_{cloud} variable
- get_endpoints() function reduced to 3 lines, delegates to variable lookup

Benefits:
- Reduced cognitive load: test logic separated from data
- Easier to add new clouds: just add _ENDPOINTS_* variable
- Better maintainability: centralized endpoint definitions

Tests: All 80 tests pass with fixtures enabled.

Co-authored-by: Spawn Refactor Service <refactor@spawn.service>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 07:12:54 -05:00
..
fixtures feat: add Gcore cloud provider with 3 agent scripts (#1079) 2026-02-14 00:19:25 -08:00
mock.sh refactor: reduce complexity in test/mock.sh and test/record.sh (#1096) 2026-02-14 07:12:54 -05:00
qa-dry-run.sh feat: qa bot and emails (#565) 2026-02-11 20:19:45 -08:00
record.sh refactor: reduce complexity in test/mock.sh and test/record.sh (#1096) 2026-02-14 07:12:54 -05:00
run.sh fix(security): harden weak crypto fallbacks, key validation, and temp paths (#1039) 2026-02-13 21:43:37 -05:00
update-readme.py QA-Bot setup (#335) 2026-02-10 19:51:07 -08:00