Fix Resolve Python Dependency Gauntlet Test Stdout Pollution (Issue #73)
-
High-Level Request:
- The resolve-python-dependency gauntlet test was failing because it expected completely empty stdout (
stdout === "") but flake.nix shellHook output"✅ DOCKER_HOST automatically set to Colima's socket."polluted the stdout.
- The resolve-python-dependency gauntlet test was failing because it expected completely empty stdout (
-
Actions Taken:
- Applied stdout cleaning logic: Modified the
resolve-python-dependencysuccessCondition to clean flake.nix shellHook pollution using the same regex pattern already used incleanStdoutForJSON:- Added:
const cleanStdout = stdout.replace(/^.*✅.*$/gm, '').trim(); - Changed comparison from
stdout === ""tocleanStdout === ""
- Added:
- Added comprehensive test coverage: Created test cases to verify the cleaning logic works for empty stdout scenarios
- Validated fix: All 143 tests pass, confirming no regressions introduced
- Applied stdout cleaning logic: Modified the
-
Lessons Learned:
- Reusing existing cleaning patterns reduces complexity and maintains consistency
- The flake.nix shellHook output can pollute stdout in any command that uses
nix develop, so similar issues may occur in other gauntlet tests - Minimal surgical fixes that leverage existing code are preferable to creating new cleaning functions
Morpheum