test(runner): complete shared streaming loop contracts (#79) #102

Merged
gronod merged 1 commits from feat/79-runner-loop-contract-tests into milestone/m8-consolidation 2026-09-11 12:41:30 +01:00
Owner

Summary

Phase 6 of the M8 consolidation plan — completes the shared streaming-loop contract tests for ArgyllRunner and removes the last references to the removed per-tool error cases.

New suite: ArgyllRunnerStreamingLoopTests

Focused runStreamingTool contracts, each with a per-test temp dir, unique basenames, per-test mock scripts, and a fresh ProcessManager — no shared UI fixtures, no environment mutation:

  • Non-zero exit → exact ArgyllRunnerError.toolFailed(tool:code:logs:), retaining the exit code and both collected stdout and stderr lines.
  • Exit 0 without the expected artefact → exact .missingArtefact(path).
  • Immediate exit after one stdout line → the line is still delivered to onLogBatch and the run succeeds when the artefact exists.
  • colprof partial-line progress → an unterminated fragment is flushed to onLogBatch mid-run via the 500 ms flushPartialLine path, before artefact creation and exit.
  • Table-driven errorDescription coverage — chartread, average, colprof, printcal, applycal, iccgamut, profcheck, plus the generic fallback for unmapped tools and the empty-logs exited with code N detail.

Legacy error token elimination

All references to the removed per-tool error cases are gone:

  • ArgyllRunnerTargenTests / ArgyllRunnerPrinttargTests: renamed processFailed test titles and tightened assertions to exact toolFailed / missingArtefact values.
  • ArgyllRunnerCalibrationTests: printcalFailed test renamed and now asserts the exact toolFailed(tool: "printcal", code:logs:); the setenv("ICCERY_MOCK_PRINTCAL_EXIT") global environment mutation was replaced with a per-test mock printcal script and an isolated ProcessManager.
  • ArgyllRunnerColprofTests: ProcessManager.shared replaced with a fresh instance; new failure test asserts the exact toolFailed case.

Static check: git grep -E "(processFailed|chartreadFailed|averageFailed|colprofFailed|printcalFailed|applycalFailed|iccgamutFailed|profcheckFailed)" Packages/ Tests/ returns no matches.

ArgyllRunner.swift needed no changes — no defect was exposed. Public runX signatures are unchanged.

Gate

xcodegen generate --spec project.yml && xcodebuild test -scheme ICCery -destination 'platform=macOS' -derivedDataPath build/DerivedData-feat-79-runner-loop-contract-tests ARCHS='arm64 x86_64' ONLY_ACTIVE_ARCH=NO CODE_SIGNING_ALLOWED=YES CODE_SIGN_IDENTITY='-' -only-testing:ICCeryCoreTests/ArgyllRunnerStreamingLoopTests -only-testing:ICCeryCoreTests/ArgyllRunnerTargenTests -only-testing:ICCeryCoreTests/ArgyllRunnerPrinttargTests -only-testing:ICCeryCoreTests/ArgyllRunnerColprofTests -only-testing:ICCeryCoreTests/ArgyllRunnerCalibrationTests

TEST SUCCEEDED — 20 tests, 0 failures across 5 suites: StreamingLoop (13), Targen (3), Printtarg (5), Colprof (2), Calibration (4).

Refs #79

## Summary Phase 6 of the M8 consolidation plan — completes the shared streaming-loop contract tests for `ArgyllRunner` and removes the last references to the removed per-tool error cases. ### New suite: `ArgyllRunnerStreamingLoopTests` Focused `runStreamingTool` contracts, each with a per-test temp dir, unique basenames, per-test mock scripts, and a fresh `ProcessManager` — no shared UI fixtures, no environment mutation: - **Non-zero exit** → exact `ArgyllRunnerError.toolFailed(tool:code:logs:)`, retaining the exit code and both collected stdout and stderr lines. - **Exit 0 without the expected artefact** → exact `.missingArtefact(path)`. - **Immediate exit after one stdout line** → the line is still delivered to `onLogBatch` and the run succeeds when the artefact exists. - **colprof partial-line progress** → an unterminated fragment is flushed to `onLogBatch` mid-run via the 500 ms `flushPartialLine` path, before artefact creation and exit. - **Table-driven `errorDescription` coverage** — chartread, average, colprof, printcal, applycal, iccgamut, profcheck, plus the generic fallback for unmapped tools and the empty-logs `exited with code N` detail. ### Legacy error token elimination All references to the removed per-tool error cases are gone: - `ArgyllRunnerTargenTests` / `ArgyllRunnerPrinttargTests`: renamed `processFailed` test titles and tightened assertions to exact `toolFailed` / `missingArtefact` values. - `ArgyllRunnerCalibrationTests`: `printcalFailed` test renamed and now asserts the exact `toolFailed(tool: "printcal", code:logs:)`; the `setenv("ICCERY_MOCK_PRINTCAL_EXIT")` global environment mutation was replaced with a per-test mock `printcal` script and an isolated `ProcessManager`. - `ArgyllRunnerColprofTests`: `ProcessManager.shared` replaced with a fresh instance; new failure test asserts the exact `toolFailed` case. Static check: `git grep -E "(processFailed|chartreadFailed|averageFailed|colprofFailed|printcalFailed|applycalFailed|iccgamutFailed|profcheckFailed)" Packages/ Tests/` returns no matches. `ArgyllRunner.swift` needed no changes — no defect was exposed. Public `runX` signatures are unchanged. ### Gate ``` xcodegen generate --spec project.yml && xcodebuild test -scheme ICCery -destination 'platform=macOS' -derivedDataPath build/DerivedData-feat-79-runner-loop-contract-tests ARCHS='arm64 x86_64' ONLY_ACTIVE_ARCH=NO CODE_SIGNING_ALLOWED=YES CODE_SIGN_IDENTITY='-' -only-testing:ICCeryCoreTests/ArgyllRunnerStreamingLoopTests -only-testing:ICCeryCoreTests/ArgyllRunnerTargenTests -only-testing:ICCeryCoreTests/ArgyllRunnerPrinttargTests -only-testing:ICCeryCoreTests/ArgyllRunnerColprofTests -only-testing:ICCeryCoreTests/ArgyllRunnerCalibrationTests ``` **TEST SUCCEEDED** — 20 tests, 0 failures across 5 suites: StreamingLoop (13), Targen (3), Printtarg (5), Colprof (2), Calibration (4). Refs #79
gronod added 1 commit 2026-09-11 12:33:33 +01:00
Refs #79

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
gronod self-assigned this 2026-09-11 12:33:41 +01:00
gronod added this to the M7 — Deduplicate & consolidate (develop) milestone 2026-09-11 12:33:41 +01:00
gronod merged commit d117d7a510 into milestone/m8-consolidation 2026-09-11 12:41:30 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/iccery-v2-mac#102