diff --git a/Sources/TuistKit/Services/XcodeBuildService.swift b/Sources/TuistKit/Services/XcodeBuildService.swift index 8fbefb444ae..bd259683cc6 100644 --- a/Sources/TuistKit/Services/XcodeBuildService.swift +++ b/Sources/TuistKit/Services/XcodeBuildService.swift @@ -92,6 +92,7 @@ struct XcodeBuildService { throw XcodeBuildServiceError.schemeNotPassed } let graph = try await xcodeGraphMapper.map(at: path) + try await ServiceContext.current?.runMetadataStorage?.update(graph: graph) let graphTraverser = GraphTraverser(graph: graph) guard let scheme = graphTraverser.schemes().first(where: { $0.name == schemeName diff --git a/Tests/TuistKitTests/Services/XcodeBuildServiceTests.swift b/Tests/TuistKitTests/Services/XcodeBuildServiceTests.swift index 1db26ff655a..714fc018d15 100644 --- a/Tests/TuistKitTests/Services/XcodeBuildServiceTests.swift +++ b/Tests/TuistKitTests/Services/XcodeBuildServiceTests.swift @@ -264,15 +264,15 @@ struct XcodeBuildServiceTests { ] ) + let graph: Graph = .test( + projects: [ + temporaryPath: project, + ] + ) + given(xcodeGraphMapper) .map(at: .any) - .willReturn( - .test( - projects: [ - temporaryPath: project, - ] - ) - ) + .willReturn(graph) given(selectiveTestingGraphHasher) .hash( @@ -367,6 +367,9 @@ struct XcodeBuildServiceTests { ], ] ) + await #expect( + runMetadataStorage.graph == graph + ) } } }