Hive Hive
Sign in

fix(cli): cache XCTest and Swift Testing support frameworks

GitHub issue · Closed

Metadata
Source
tuist/tuist #11281
Updated
Jun 24, 2026
Domains
Cache
Details

Resolves N/A

This changes binary cache selection so XCTest-backed and Swift Testing-backed test-support frameworks can be cached while actual test bundles remain excluded.

The previous predicate treated every target that depended on XCTest, or enabled testing search paths, as non-cacheable. That was broader than the product-level constraint we need: test bundles should not become cache artifacts, but framework products used by tests can be hashed, warmed, and consumed from the local cache.

The implementation now filters cache candidates by cacheable product type plus testsBundle, and explicit cache warm selection keeps XCTest support frameworks as non-test roots. The tests cover direct XCTest dependencies, testing search paths, test bundle exclusion, transitive test usage, and a local-cache acceptance fixture with both an XCTest support framework and a Swift Testing support framework.

How to test locally

  • swiftformat cli/Sources/TuistCache/CacheGraphContentHasher.swift cli/Sources/TuistCache/CacheWarmTargetGraphSelector.swift cli/Tests/TuistCacheTests/CacheGraphContentHasherTests.swift cli/Tests/TuistCacheTests/CacheGraphContentHasherIntegrationTests.swift cli/Tests/TuistCacheTests/CacheWarmTargetGraphSelectorTests.swift cli/Tests/TuistCacheEEAcceptanceTests/TuistCacheEEAcceptanceTests.swift examples/xcode/generated_ios_app_with_cached_xctest_support/Project.swift examples/xcode/generated_ios_app_with_cached_xctest_support/Tuist.swift examples/xcode/generated_ios_app_with_cached_xctest_support/App/Sources/AppDelegate.swift examples/xcode/generated_ios_app_with_cached_xctest_support/App/Tests/AppTests.swift examples/xcode/generated_ios_app_with_cached_xctest_support/Feature/Sources/Feature.swift examples/xcode/generated_ios_app_with_cached_xctest_support/TestSupport/Sources/TestSupport.swift examples/xcode/generated_ios_app_with_cached_xctest_support/SwiftTestingSupport/Sources/SwiftTestingSupport.swift
  • .build/debug/tuist cache warm --path examples/xcode/generated_ios_app_with_cached_xctest_support --generate-only --print-hashes
  • .build/debug/tuist test App --build-only --no-binary-cache --no-upload --no-selective-testing --path examples/xcode/generated_ios_app_with_cached_xctest_support -- -destination 'generic/platform=iOS Simulator' -derivedDataPath /tmp/tuist-cached-xctest-support-derived-data CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
  • swift build --target TuistCache --replace-scm-with-registry
  • git diff --check
Comments
TA
tuist-atlas[bot] Jun 16, 2026

The fix to cache XCTest and Swift Testing support frameworks is available in version 4.200.2. Update to get this change.