Skip to content

Test collision resolver integration with doctor and dry-run paths #291

@bguidolim

Description

@bguidolim

Problem

DestinationCollisionResolver.resolveCollisions() is called in three places:

  1. Configurator.configure() — tested via CrossPackCollisionTests
  2. Configurator.dryRun()no dedicated test
  3. DoctorRunner.run()no dedicated test

The resolver is a pure function, so the risk is low. However, if someone removes the resolver call from dryRun, the dry-run output would show flat paths while configure would use namespaced paths — a confusing discrepancy. Similarly, doctor checks could reference wrong paths.

Proposed Tests

Dry-run

Add a test in LifecycleIntegrationTests that calls dryRun with two colliding packs and verifies the output references namespaced paths (or at minimum, that dryRun doesn't crash with colliding destinations).

Doctor

Add a test in DoctorRunnerIntegrationTests that configures two packs with colliding hook destinations, then runs doctor and verifies all checks pass (i.e., doctor checks look for files at the namespaced paths, not the flat paths).

References

  • Sources/mcs/Install/Configurator.swift:110 — dryRun call site
  • Sources/mcs/Doctor/DoctorRunner.swift:150 — doctor call site
  • Tests/MCSTests/LifecycleIntegrationTests.swift — existing collision tests
  • Tests/MCSTests/DoctorRunnerIntegrationTests.swift — doctor test patterns

Metadata

Metadata

Assignees

No one assigned

    Labels

    test-gapMissing test coverage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions