Skip to content

Commit

Permalink
Add Pagination Test Configuration (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
Iron-Ham authored and runner committed Oct 12, 2023
1 parent 96c28d0 commit a04b424
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
include:
- package: apollo-ios
- package: apollo-ios-codegen
- package: apollo-ios-pagination
name: Run swift build for SPM packages
steps:
- uses: maxim-lobanov/setup-xcode@v1
Expand Down
3 changes: 3 additions & 0 deletions Configuration/Apollo/Apollo-Target-PaginationTests.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "../Shared/Workspace-Target-Test.xcconfig"

INFOPLIST_FILE = Tests/ApolloPaginationTests/Info.plist
2 changes: 2 additions & 0 deletions Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ let project = Project(
.apolloInternalTestHelpersFramework(),
.apolloCodegenInternalTestHelpersFramework(),
.apolloTests(),
.apolloPaginationTests(),
.apolloPerformanceTests(),
.apolloServerIntegrationTests(),
.apolloCodegenTests(),
Expand All @@ -36,6 +37,7 @@ let project = Project(
schemes: [
.apolloCodegenTests(),
.apolloPerformanceTests(),
.apolloPaginationTests(),
.apolloServerIntegrationTests(),
.apolloTests(),
.codegenCLITests()
Expand Down
22 changes: 22 additions & 0 deletions Tests/ApolloPaginationTests/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
25 changes: 25 additions & 0 deletions Tests/TestPlans/Apollo-PaginationTestPlan.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"configurations" : [
{
"id" : "BF52CC8B-4AB1-4640-BAF4-00FDB47CC315",
"name" : "Configuration 1",
"options" : {

}
}
],
"defaultOptions" : {
"testTimeoutsEnabled" : true
},
"testTargets" : [
{
"parallelizable" : true,
"target" : {
"containerPath" : "container:ApolloDev.xcodeproj",
"identifier" : "F13FB1AFFD21C03856AD8A03",
"name" : "ApolloPaginationTests"
}
}
],
"version" : 1
}
6 changes: 6 additions & 0 deletions Tuist/ProjectDescriptionHelpers/Enums/ApolloTarget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public enum ApolloTarget {
case apolloCodegenLibWrapper
case apolloCodegenTests
case apolloInternalTestHelpers
case apolloPaginationTests
case apolloPerformanceTests
case apolloServerIntegrationTests
case apolloTests
Expand All @@ -29,6 +30,8 @@ public enum ApolloTarget {
return "ApolloCodegenTests"
case .apolloInternalTestHelpers:
return "ApolloInternalTestHelpers"
case .apolloPaginationTests:
return "ApolloPaginationTests"
case .apolloPerformanceTests:
return "ApolloPerformanceTests"
case .apolloServerIntegrationTests:
Expand Down Expand Up @@ -62,6 +65,8 @@ public enum ApolloTarget {
return "Apollo-Target-CodegenTests"
case .apolloInternalTestHelpers:
return "Apollo-Target-InternalTestHelpers"
case .apolloPaginationTests:
return "Apollo-Target-PaginationTests"
case .apolloPerformanceTests:
return "Apollo-Target-PerformanceTests"
case .apolloServerIntegrationTests:
Expand Down Expand Up @@ -100,6 +105,7 @@ public enum ApolloTarget {
.apolloPerformanceTests,
.apolloServerIntegrationTests,
.apolloTests,
.apolloPaginationTests,
.codegenCLITests:
version = "12.5"
}
Expand Down
3 changes: 3 additions & 0 deletions Tuist/ProjectDescriptionHelpers/Enums/ApolloTestPlan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ enum ApolloTestPlan {
case codegenCITest
case codegenCLITest
case integrationTest
case paginationTest
case performanceTest
case unitTest

Expand All @@ -22,6 +23,8 @@ enum ApolloTestPlan {
return Path("Tests/TestPlans/CodegenCLITestPlan.xctestplan")
case .integrationTest:
return Path("Tests/TestPlans/Apollo-IntegrationTestPlan.xctestplan")
case .paginationTest:
return Path("Tests/TestPlans/Apollo-PaginationTestPlan.xctestplan")
case .performanceTest:
return Path("Tests/TestPlans/Apollo-PerformanceTestPlan.xctestplan")
case .unitTest:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import ProjectDescription

extension Target {

public static func apolloPaginationTests() -> Target {
let target: ApolloTarget = .apolloPaginationTests

return Target(
name: target.name,
platform: .macOS,
product: .unitTests,
bundleId: "com.apollographql.\(target.name.lowercased())",
deploymentTarget: target.deploymentTarget,
sources: [
"Tests/\(target.name)/**",
],
dependencies: [
.target(name: ApolloTarget.apolloInternalTestHelpers.name),
.target(name: ApolloTarget.starWarsAPI.name),
.package(product: "Apollo"),
.package(product: "ApolloAPI"),
.package(product: "ApolloTestSupport"),
.package(product: "Nimble"),
.package(product: "ApolloPagination")
],
settings: .forTarget(target)
)
}

}

extension Scheme {

public static func apolloPaginationTests() -> Scheme {
let target: ApolloTarget = .apolloPaginationTests

return Scheme(
name: target.name,
buildAction: .buildAction(targets: [
TargetReference(projectPath: nil, target: target.name)
]),
testAction: .testPlans([
ApolloTestPlan.paginationTest.path,
])
)
}

}

0 comments on commit a04b424

Please sign in to comment.