diff --git a/.github/workflows/flare_ui.yml b/.github/workflows/flare_ui.yml index 8cda0b521..bf4d2f9b8 100644 --- a/.github/workflows/flare_ui.yml +++ b/.github/workflows/flare_ui.yml @@ -81,6 +81,7 @@ jobs: destination: ${{ matrix.destination }} name: ${{ matrix.name }} test_plan: FlareUI + test_plan: FlareUIUnitTests - name: Upload test coverage reports to Codecov uses: ./.github/actions/upload_test_coverage_report with: @@ -114,7 +115,7 @@ jobs: scheme: FlareUI destination: ${{ matrix.destination }} name: ${{ matrix.name }} - test_plan: FlareUI + test_plan: FlareUIUnitTests - name: Upload test coverage reports to Codecov uses: ./.github/actions/upload_test_coverage_report with: @@ -152,7 +153,7 @@ jobs: scheme: FlareUI destination: ${{ matrix.destination }} name: ${{ matrix.name }} - test_plan: FlareUI + test_plan: FlareUIUnitTests - name: Upload test coverage reports to Codecov uses: ./.github/actions/upload_test_coverage_report with: @@ -181,6 +182,44 @@ jobs: - name: ${{ matrix.name }} run: swift build -c release --target FlareUI + snapshots: + name: ${{ matrix.name }} + runs-on: ${{ matrix.runsOn }} + env: + DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer" + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + include: + - destination: "platform=macOS" + xcode: "Xcode_15.0" + runsOn: macos-13 + name: "macOS 13, Xcode 15.0, Swift 5.9.0" + - destination: "OS=17.0.1,name=iPhone 14 Pro" + name: "iOS 17.0.1" + xcode: "Xcode_15.0" + runsOn: macos-13 + - destination: "OS=17.0,name=Apple TV" + name: "tvOS 17.0" + xcode: "Xcode_15.0" + runsOn: macos-13 + steps: + - uses: actions/checkout@v3 + - name: ${{ matrix.name }} + uses: ./.github/actions/build_and_test + with: + scheme: FlareUI + destination: ${{ matrix.destination }} + name: ${{ matrix.name }}SnapshotTests + test_plan: SnapshotTests + - name: Upload test coverage reports to Codecov + uses: ./.github/actions/upload_test_coverage_report + with: + scheme_name: FlareUI + filename: ${{ matrix.name }}SnapshotTests + token: ${{ secrets.CODECOV_TOKEN }} + merge-test-reports: needs: [iOS, macOS, watchOS, tvOS] runs-on: macos-13 diff --git a/Tests/FlareUITests/UnitTests/FlareUITests.swift b/Tests/FlareUITests/UnitTests/FlareUITests.swift deleted file mode 100644 index 9994272d9..000000000 --- a/Tests/FlareUITests/UnitTests/FlareUITests.swift +++ /dev/null @@ -1,8 +0,0 @@ -// -// Flare -// Copyright © 2024 Space Code. All rights reserved. -// - -import XCTest - -final class FlareUITests: XCTestCase {} diff --git a/Tests/FlareUITests/SnapshotTests/Helpers/XCTestCase+.swift b/Tests/FlareUITests/UnitTests/Helpers/XCTestCase+.swift similarity index 100% rename from Tests/FlareUITests/SnapshotTests/Helpers/XCTestCase+.swift rename to Tests/FlareUITests/UnitTests/Helpers/XCTestCase+.swift diff --git a/Tests/TestPlans/FlareUI.xctestplan b/Tests/TestPlans/FlareUIUnitTests.xctestplan similarity index 78% rename from Tests/TestPlans/FlareUI.xctestplan rename to Tests/TestPlans/FlareUIUnitTests.xctestplan index 59e4ee2dd..ceeb2656d 100644 --- a/Tests/TestPlans/FlareUI.xctestplan +++ b/Tests/TestPlans/FlareUIUnitTests.xctestplan @@ -26,6 +26,13 @@ }, "testTargets" : [ { + "skippedTests" : [ + "ProductInfoViewSnapshotTests", + "ProductPlaceholderViewSnapshotTests", + "ProductViewSnapshotTests", + "ProductsViewSnapshotTests", + "SnapshotTestCase" + ], "target" : { "containerPath" : "container:Flare.xcodeproj", "identifier" : "514A62DAD52F32058E8084C4", diff --git a/Tests/TestPlans/SnapshotTests.xctestplan b/Tests/TestPlans/SnapshotTests.xctestplan new file mode 100644 index 000000000..03dc49284 --- /dev/null +++ b/Tests/TestPlans/SnapshotTests.xctestplan @@ -0,0 +1,46 @@ +{ + "configurations" : [ + { + "id" : "982AD05B-EBD5-4A98-A373-D1868847261D", + "name" : "Configuration 1", + "options" : { + + } + } + ], + "defaultOptions" : { + "codeCoverage" : { + "targets" : [ + { + "containerPath" : "container:Flare.xcodeproj", + "identifier" : "8D5BAE0D59CA24F5E8E0C695", + "name" : "FlareUI" + } + ] + }, + "targetForVariableExpansion" : { + "containerPath" : "container:Flare.xcodeproj", + "identifier" : "8D5BAE0D59CA24F5E8E0C695", + "name" : "FlareUI" + } + }, + "testTargets" : [ + { + "skippedTests" : [ + "ArrayExtensionsTests", + "ProductPresenterTests", + "ProductStrategyTests", + "ProductViewModelFactoryTests", + "ProductsPresenterTests", + "StoreButtonPresenterTests", + "SubscriptionDateComponentsFactoryTests" + ], + "target" : { + "containerPath" : "container:Flare.xcodeproj", + "identifier" : "514A62DAD52F32058E8084C4", + "name" : "FlareUITests" + } + } + ], + "version" : 1 +} diff --git a/project.yml b/project.yml index 7150e7969..042467194 100644 --- a/project.yml +++ b/project.yml @@ -75,8 +75,9 @@ targets: - path: Sources/FlareUI scheme: testPlans: - - path: Tests/TestPlans/FlareUI.xctestplan + - path: Tests/TestPlans/FlareUIUnitTests.xctestplan defaultPlan: true + - path: Tests/TestPlans/SnapshotTests.xctestplan gatherCoverageData: true coverageTargets: - FlareUI @@ -124,6 +125,22 @@ targets: TARGETED_DEVICE_FAMILY: "1,2,3,4" sources: - Tests/FlareUITests + # FlareUISnapshotTests: + # type: bundle.unit-test + # supportedDestinations: [iOS, tvOS, macOS] + # dependencies: + # - target: Flare + # - target: FlareMock + # - target: FlareUI + # - package: SnapshotTesting + # settings: + # base: + # GENERATE_INFOPLIST_FILE: YES + # PRODUCT_BUNDLE_IDENTIFIER: com.spacecode.flare-unit-tests + # SUPPORTED_PLATFORMS: "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator" + # TARGETED_DEVICE_FAMILY: "1,2,3,4" + # sources: + # - Tests/FlareUITests/SnapshotTests IntegrationTests: type: bundle.unit-test supportedDestinations: [iOS, tvOS, macOS]