Skip to content

Support SPM execution with process lifecycle management#51

Merged
ericodx merged 20 commits intomainfrom
improve-spm-execution-and-performance
Apr 3, 2026
Merged

Support SPM execution with process lifecycle management#51
ericodx merged 20 commits intomainfrom
improve-spm-execution-and-performance

Conversation

@ericodx
Copy link
Copy Markdown
Owner

@ericodx ericodx commented Apr 3, 2026

Summary

  • Add full SPM (Swift Package Manager) execution support with shared sandbox, incremental builds, and escaped child process cleanup
  • Implement deferred process cleanup (CapturedOutput + launchCapturingDeferred) to prevent xcresult bundle truncation on Xcode paths while still killing orphan processes on SPM paths
  • Reroute schema-excluded mutants to the incompatible executor instead of marking them as unviable, recovering previously lost mutation coverage
  • Guarantee SimulatorPool.tearDown() on all error paths, preventing simulator leak across runs
  • Add per-mutant narrow exclusion on schematized build failures, replacing the previous per-file exclusion that discarded too many mutants
  • Unify IncompatibleTestLaunchResult into TestLaunchResult and centralize Xcode vs SPM result parsing in TestResultResolver

Type of Change

  • feat: A new feature has been added.
  • fix: A bug has been fixed.
  • perf: A code change that improves performance.
  • refactor: A code change that neither fixes a bug nor adds a feature.
  • test: Addition or correction of tests.

Invariants Checklist

  • Original project is never modified — all mutations happen inside an isolated sandbox
  • xcodebuild build-for-testing runs exactly once for all schematizable mutants
  • No mutant results are lost or duplicated
  • Mutant positions (file, line, column) are accurate in all reported results
  • A cancelled task never leaves a simulator slot permanently acquired from the pool
  • schematizedContent never contains the __swiftMutationTestingID global declaration
  • Swift 6 Strict Concurrency compatible
  • Pipeline stages remain stateless pure transformations

Pipeline Impact

Which stages are affected?

  • SandboxFactory
  • BuildStage
  • SimulatorPool
  • TestExecutionStage
  • IncompatibleMutantExecutor
  • PerFileBuildFallback
  • CacheStore
  • Reporters (Text / JSON / HTML / Sonar)
  • CLI / Configuration
  • Models / RunnerInput contract
  • None

Testing

  • Unit tests added or updated
  • Tests use mock ProcessLaunching — no real xcodebuild, xcrun simctl, or xcresulttool
  • Tests use FileHelpers for any filesystem interaction (temp directories only)
  • Snapshot tests added or updated (if reporter output format changed)
  • Integration tests added or updated and tagged separately (if pipeline or CLI behavior changed)
  • All tests pass locally (swift test)

ericodx added 20 commits April 1, 2026 15:34
@ericodx ericodx self-assigned this Apr 3, 2026
@ericodx ericodx changed the title Improve spm execution and performance Support SPM execution with process lifecycle management Apr 3, 2026
@ericodx ericodx added feature New feature or request fix Something wasn't working refactor Code change that neither fixes a bug nor adds a feature test Addition or correction of tests performance Changes that improve execution speed or resource usage labels Apr 3, 2026
@ericodx ericodx merged commit c9d784c into main Apr 3, 2026
1 check passed
@ericodx ericodx deleted the improve-spm-execution-and-performance branch April 3, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request fix Something wasn't working performance Changes that improve execution speed or resource usage refactor Code change that neither fixes a bug nor adds a feature test Addition or correction of tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant