Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,29 +111,29 @@ fileprivate struct SwiftCompilationCachingTests: CoreBasedTests {
numCompile += tasks.count
}

results.checkNote("0 hits / 4 cacheable tasks (0%)")
results.checkNote("0 hits / \(numCompile) cacheable tasks (0%)")

results.checkNoTask()
}
#expect(try readMetrics("one").contains("\"swiftCacheHits\":0,\"swiftCacheMisses\":\(numCompile)"))

// touch a file, clean build folder, and rebuild.
try await tester.fs.updateTimestamp(testWorkspace.sourceRoot.join("aProject/App.swift"))
try await tester.checkBuild(runDestination: .macOS, buildCommand: .cleanBuildFolder(style: .regular), body: { _ in })
try await tester.checkBuild(runDestination: .anyiOSDevice, buildCommand: .cleanBuildFolder(style: .regular), body: { _ in })

tester.userInfo = rawUserInfo.withAdditionalEnvironment(environment: metricsEnv("two"))
try await tester.checkBuild(runDestination: .anyiOSDevice, persistent: true) { results in
results.checkTask(.matchRule(["SwiftCompile", "normal", "arm64", "Compiling App.swift", "\(tmpDirPath.str)/Test/aProject/App.swift"])) { task in
results.checkKeyQueryCacheHit(task)
}

results.checkNote("4 hits / 4 cacheable tasks (100%)")
results.checkNote("\(numCompile) hits / \(numCompile) cacheable tasks (100%)")
}
#expect(try readMetrics("two").contains("\"swiftCacheHits\":\(numCompile),\"swiftCacheMisses\":0"))
}
}

@Test(.requireSDKs(.iOS))
@Test(.requireSDKs(.macOS))
func swiftCachingSwiftPM() async throws {
try await withTemporaryDirectory { tmpDirPath async throws -> Void in
let commonBuildSettings = try await [
Expand Down