Skip to content

Commit 1c9cc6b

Browse files
Get all codegen tests working (#2136)
* Implement path resolver for codegen file output configuration * Add operation path resolution to config logic * Use path resolver in ApolloCodegen * Add schema file path resolution * Remove empty test case * Fix expected operation filename for test
1 parent 43d2013 commit 1c9cc6b

3 files changed

Lines changed: 1 addition & 13 deletions

File tree

Apollo.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@
305305
DECD49C9262F88FE00924527 /* ApolloCodegenLib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B7B6F47233C26D100F32205 /* ApolloCodegenLib.framework */; };
306306
DECD49DB262F8AAA00924527 /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; };
307307
DECD53CF26EC0EE50059A639 /* OutputTypeConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = DECD53CE26EC0EE50059A639 /* OutputTypeConvertible.swift */; };
308-
DED18CC727023C0400F62977 /* OperationDefinitionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED18CC627023C0400F62977 /* OperationDefinitionTests.swift */; };
309308
DED45C2A2615319E0086EF63 /* DefaultInterceptorProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45C292615319E0086EF63 /* DefaultInterceptorProviderTests.swift */; };
310309
DED45D73261675890086EF63 /* StarWarsServerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC91EC0A9F7000017BE /* StarWarsServerTests.swift */; };
311310
DED45D852616759C0086EF63 /* TestConfigs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45D842616759C0086EF63 /* TestConfigs.swift */; };
@@ -1019,7 +1018,6 @@
10191018
DECD4930262F824B00924527 /* Workspace-Target-TestSupport.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Target-TestSupport.xcconfig"; sourceTree = "<group>"; };
10201019
DECD493E262F82D600924527 /* Workspace-Target-Codegen.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Target-Codegen.xcconfig"; sourceTree = "<group>"; };
10211020
DECD53CE26EC0EE50059A639 /* OutputTypeConvertible.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutputTypeConvertible.swift; sourceTree = "<group>"; };
1022-
DED18CC627023C0400F62977 /* OperationDefinitionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OperationDefinitionTests.swift; sourceTree = "<group>"; };
10231021
DED45C172615308E0086EF63 /* TestServerURLs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestServerURLs.swift; sourceTree = "<group>"; };
10241022
DED45C292615319E0086EF63 /* DefaultInterceptorProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultInterceptorProviderTests.swift; sourceTree = "<group>"; };
10251023
DED45C3B26165DD70086EF63 /* Apollo-IntegrationTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Apollo-IntegrationTestPlan.xctestplan"; sourceTree = "<group>"; };
@@ -1662,7 +1660,6 @@
16621660
9F62DFAD2590557F00E6E808 /* DocumentParsingAndValidationTests.swift */,
16631661
9F62E00F2590728000E6E808 /* CompilationTests.swift */,
16641662
9F62DFBE2590560000E6E808 /* Helpers.swift */,
1665-
DED18CC627023C0400F62977 /* OperationDefinitionTests.swift */,
16661663
);
16671664
path = Frontend;
16681665
sourceTree = "<group>";
@@ -3179,7 +3176,6 @@
31793176
E6B42D0D27A4749100A3BD58 /* SwiftPackageManagerModuleTemplateTests.swift in Sources */,
31803177
9F62DFBF2590560000E6E808 /* Helpers.swift in Sources */,
31813178
DE296539279B3B8200BF9B49 /* SelectionSetTemplateTests.swift in Sources */,
3182-
DED18CC727023C0400F62977 /* OperationDefinitionTests.swift in Sources */,
31833179
E66F8897276C136B0000BDA8 /* ObjectFileGeneratorTests.swift in Sources */,
31843180
DE79642B276999E700978A03 /* IRNamedFragmentBuilderTests.swift in Sources */,
31853181
E69BEDA72798B89600000D10 /* InputObjectTemplateTests.swift in Sources */,

Tests/ApolloCodegenTests/CodeGeneration/FileGenerators/OperationFileGeneratorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class OperationFileGeneratorTests: XCTestCase {
3636

3737
let fileManager = MockFileManager(strict: false)
3838
let rootURL = URL(fileURLWithPath: CodegenTestHelper.outputFolderURL().path)
39-
let fileURL = rootURL.appendingPathComponent("AllAnimals.swift")
39+
let fileURL = rootURL.appendingPathComponent("AllAnimalsQuery.swift")
4040

4141
fileManager.mock(closure: .createFile({ path, data, attributes in
4242
expect(path).to(equal(fileURL.path))

Tests/ApolloCodegenTests/Frontend/OperationDefinitionTests.swift

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)