Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS test action #455

Merged
merged 4 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
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
@@ -1,16 +1,16 @@
name: iOS Build
name: iOS Build and Test

on:
push:
branches: [ "main" ]
pull_request:

concurrency:
group: ios-build-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-ios:
build-test-ios:
runs-on: macos-latest

steps:
Expand All @@ -20,3 +20,5 @@ jobs:
run: echo "arch=arm64" >> local.properties
- run: make build-app-debug
working-directory: app-ios
- run: make test-app-debug
working-directory: app-ios
36 changes: 25 additions & 11 deletions app-ios/App/App.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
}
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:..",
"identifier" : "TimetableDetailFeatureTests",
"name" : "TimetableDetailFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:..",
Expand All @@ -27,43 +34,50 @@
{
"target" : {
"containerPath" : "container:..",
"identifier" : "AppTests",
"name" : "AppTests"
"identifier" : "SponsorFeatureTests",
"name" : "SponsorFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:..",
"identifier" : "TimetableDetailFeatureTests",
"name" : "TimetableDetailFeatureTests"
"identifier" : "ContributorFeatureTests",
"name" : "ContributorFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:",
"containerPath" : "container:..",
"identifier" : "StaffFeatureTests",
"name" : "StaffFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:..",
"identifier" : "FavoriteFeatureTests",
"name" : "FavoriteFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:..",
"identifier" : "ContributorFeatureTests",
"name" : "ContributorFeatureTests"
"identifier" : "EventMapFeatureTests",
"name" : "EventMapFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:..",
"identifier" : "SponsorFeatureTests",
"name" : "SponsorFeatureTests"
"identifier" : "TimetableTests",
"name" : "TimetableTests"
}
},
{
"target" : {
"containerPath" : "container:..",
"identifier" : "StaffFeatureTests",
"name" : "StaffFeatureTests"
"identifier" : "AppTests",
"name" : "AppTests"
}
}
],
Expand Down
11 changes: 11 additions & 0 deletions app-ios/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ build-app-debug: build-kmp-module
-destination "platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5" \
clean build | xcbeautify

.PHONY: test-app-debug
test-app-debug:
set -o pipefail && \
xcodebuild test -project $(PROJECT_FILE) \
-scheme $(SCHEME_NAME_APP) \
-configuration Debug \
-skipPackagePluginValidation \
-skipMacroValidation \
-destination "platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5" \
| xcbeautify

.PHONY: bootstrap
bootstrap:
make setup && \
Expand Down
1 change: 1 addition & 0 deletions app-ios/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ let package = Package(
.kmpClient,
.theme,
.model,
.commonComponents,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ry-itto
I could solve it. Thank you!
#455 (comment)

]
),
.testTarget(
Expand Down
11 changes: 1 addition & 10 deletions app-ios/Tests/TimetableTests/TimetableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,4 @@ import XCTest
import ComposableArchitecture
@testable import TimetableFeature

final class TimetableTests: XCTestCase {
@MainActor func testExample() async throws {
let store = TestStore(initialState: TimetableReducer.State()) {
TimetableReducer()
}
await store.send(.onAppear) {
$0.timetableItems = SampleData().workdayResults
}
}
}
final class TimetableTests: XCTestCase {}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was removed because it is not appropriate for the current timetable view implementation.

Loading