Skip to content

SPM support — fixture, integration tests, and additionalEnvironment API#49

Merged
ericodx merged 6 commits intomainfrom
fixture-and-integration-test
Mar 31, 2026
Merged

SPM support — fixture, integration tests, and additionalEnvironment API#49
ericodx merged 6 commits intomainfrom
fixture-and-integration-test

Conversation

@ericodx
Copy link
Copy Markdown
Owner

@ericodx ericodx commented Mar 31, 2026

Summary

  • Add CalcLibrary SPM fixture (Package.swift + Calculator, Validator, Logic sources + XCTest suite with deliberate partial coverage)
  • Add MutantExecutorSPMIntegrationTests: end-to-end SPM pipeline producing known killed/survived sets (killed={m1,m2,m4}, survived={m3,m5,mi1})
  • Fix TestExecutionStage.launchSPM environment merge — previously replaced the entire process environment, causing swift test to fail without PATH/HOME
  • Add additionalEnvironment: [String: String] parameter to ProcessLaunching/ProcessLauncher: merges into the inherited parent environment rather than replacing it; SPM schematized path uses this to inject __SWIFT_MUTATION_TESTING_ACTIVE
  • Add SPM crash fixture tests for TestOutputParser covering Fatal error: and EXC_BAD_INSTRUCTION patterns from real swift test output

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.
  • docs: Changes only to the documentation.
  • ci: Changes related to continuous integration and deployment scripts.
  • build: Changes that affect the build system or external dependencies.
  • deps: Dependency version upgrades with no logic changes.
  • chore: Other changes that do not fit into the previous categories.
  • revert: Reverts a previous commit.

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 ericodx self-assigned this Mar 31, 2026
@ericodx ericodx changed the title Fixture and integration test feat: complete SPM support — fixture, integration tests, and additionalEnvironment API Mar 31, 2026
@ericodx ericodx added feature New feature or request test Addition or correction of tests integration Integration tests and end-to-end validation labels Mar 31, 2026
@ericodx ericodx changed the title feat: complete SPM support — fixture, integration tests, and additionalEnvironment API SPM support — fixture, integration tests, and additionalEnvironment API Mar 31, 2026
@ericodx ericodx merged commit f40a5e9 into main Mar 31, 2026
1 check passed
@ericodx ericodx deleted the fixture-and-integration-test branch March 31, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request integration Integration tests and end-to-end validation test Addition or correction of tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant