Skip to content

Commit

Permalink
[추가] 패키지 테스트 타겟 추가 및 스크립트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
x-0o0 committed Dec 25, 2023
1 parent 86070f6 commit 5a89422
Show file tree
Hide file tree
Showing 10 changed files with 242 additions and 43 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/BUILD_PACKAGE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🔨 iOS 16.2 iPhone 14 Pro 에서 스위프트 패키지를 빌드합니다.'
body: '🔨 iOS 17.0 iPhone 14 Pro 에서 스위프트 패키지를 빌드합니다.'
})
# 코드를 체크아웃 합니다.
Expand All @@ -40,8 +40,8 @@ jobs:
# KuringModulePackage 패키지를 빌드합니다. (최소 버전)
- name: KuringModulePackage 빌드
run: |
cd KuringModulePackage
xcodebuild build -scheme KuringModulePackage -destination 'platform=iOS Simulator,OS=latest,name=iPhone 14 Pro'
cd KuringPackage
xcodebuild build -scheme App -destination 'platform=iOS Simulator,OS=latest,name=iPhone 14 Pro'
# 빌드 성공시 커멘트
- name: Add Build comment
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/TEST_PACKAGE_TARGET_iOS17.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: 쿠링 패키지 iOS17에서 테스트하기

on:
issue_comment:
types: [created, edited]

jobs:
build:
if: github.event.issue.pull_request && contains(github.event.comment.body, '/쿠링') && contains(github.event.comment.body, 'ios17 패키지 테스트')
runs-on: macos-13 #최신버전
steps:
# 테스트 요청 시작
- name: Test iOS17
run: |
echo "iOS17 에서 패키지의 모든 테스트 타겟을 테스트 합니다."
# iOS17 테스트 응답 커멘트
- name: Add Test comment
uses: actions/github-script@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🔨 iOS 17.0 iPhone 15 Pro 에서 쿠링 앱을 테스트 합니다.'
})
# 코드를 체크아웃 합니다.
- name: Checkout repository
uses: actions/checkout@v2

# Xcode 버전을 설정합니다.
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0'

# KuringPackage 경로로 이동
- name: 패키지 경로로 이동
run: |
cd KuringPackage
# NoticeFeaturesTests 스킴을 테스트합니다.
- name: NoticeFeaturesTests 테스트
run: |
xcodebuild test -scheme NoticeFeaturesTests -destination 'platform=iOS Simulator,OS=17.0,name=iPhone 15 Pro'
# SubscriptionFeaturesTests 스킴을 테스트합니다.
- name: SubscriptionFeaturesTests 테스트
run: |
xcodebuild test -scheme SubscriptionFeaturesTests -destination 'platform=iOS Simulator,OS=17.0,name=iPhone 15 Pro'
# 테스트 성공시 커멘트
- name: Add Build comment
uses: actions/github-script@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ iOS17 에서 패키지를 성공적으로 테스트 했습니다.'
})
# 테스트 실패시 커멘트
- name: Notify failure
uses: actions/github-script@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '📬 iOS17 에서 패키지 테스트에 실패했습니다. Actions에서 실패 결과를 확인해주세요.'
})
if: failure()
12 changes: 0 additions & 12 deletions KuringApp/KuringApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
A9DAFA562AB1F04B0064F748 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9DAFA552AB1F04B0064F748 /* ContentView.swift */; };
A9DAFA582AB1F04C0064F748 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A9DAFA572AB1F04C0064F748 /* Assets.xcassets */; };
A9DAFA5B2AB1F04C0064F748 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A9DAFA5A2AB1F04C0064F748 /* Preview Assets.xcassets */; };
CA52DF392AD58F4B009B9272 /* NoticeAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA52DF382AD58F4B009B9272 /* NoticeAppTests.swift */; };
CA640C1D2AD84E10002836E0 /* SubscriptionViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA640C1C2AD84E10002836E0 /* SubscriptionViewTests.swift */; };
CA640C1F2AD8525D002836E0 /* SubscriptionAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA640C1E2AD8525D002836E0 /* SubscriptionAppTests.swift */; };
CAE658662B3992A800CD8A63 /* App in Frameworks */ = {isa = PBXBuildFile; productRef = CAE658652B3992A800CD8A63 /* App */; };
DF331DAB2AC917E100D0BB08 /* kuring_app.png in Resources */ = {isa = PBXBuildFile; fileRef = DF331DA72AC917E000D0BB08 /* kuring_app.png */; };
DF331DAC2AC917E100D0BB08 /* kuring_app_classic.png in Resources */ = {isa = PBXBuildFile; fileRef = DF331DA82AC917E000D0BB08 /* kuring_app_classic.png */; };
Expand Down Expand Up @@ -48,9 +45,6 @@
A9DAFA572AB1F04C0064F748 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
A9DAFA5A2AB1F04C0064F748 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
CA52DF2F2AD58DF2009B9272 /* KuringAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KuringAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
CA52DF382AD58F4B009B9272 /* NoticeAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoticeAppTests.swift; sourceTree = "<group>"; };
CA640C1C2AD84E10002836E0 /* SubscriptionViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionViewTests.swift; sourceTree = "<group>"; };
CA640C1E2AD8525D002836E0 /* SubscriptionAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionAppTests.swift; sourceTree = "<group>"; };
DF062D4A2AC87B6D00FC48C0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
DF331DA72AC917E000D0BB08 /* kuring_app.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = kuring_app.png; sourceTree = "<group>"; };
DF331DA82AC917E000D0BB08 /* kuring_app_classic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = kuring_app_classic.png; sourceTree = "<group>"; };
Expand Down Expand Up @@ -146,9 +140,6 @@
CA52DF302AD58DF2009B9272 /* KuringAppTests */ = {
isa = PBXGroup;
children = (
CA52DF382AD58F4B009B9272 /* NoticeAppTests.swift */,
CA640C1C2AD84E10002836E0 /* SubscriptionViewTests.swift */,
CA640C1E2AD8525D002836E0 /* SubscriptionAppTests.swift */,
);
path = KuringAppTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -302,9 +293,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CA52DF392AD58F4B009B9272 /* NoticeAppTests.swift in Sources */,
CA640C1D2AD84E10002836E0 /* SubscriptionViewTests.swift in Sources */,
CA640C1F2AD8525D002836E0 /* SubscriptionAppTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,28 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NoticeFeaturesTests"
BuildableName = "NoticeFeaturesTests"
BlueprintName = "NoticeFeaturesTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SubscriptionFeaturesTests"
BuildableName = "SubscriptionFeaturesTests"
BlueprintName = "SubscriptionFeaturesTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NoticeFeaturesTests"
BuildableName = "NoticeFeaturesTests"
BlueprintName = "NoticeFeaturesTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SubscriptionFeaturesTests"
BuildableName = "SubscriptionFeaturesTests"
BlueprintName = "SubscriptionFeaturesTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
16 changes: 16 additions & 0 deletions KuringPackage/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,21 @@ let package = Package(
.target(
name: "Models"
),

// MARK: - Tests
.testTarget(
name: "NoticeFeaturesTests",
dependencies: [
"NoticeFeatures", "SearchFeatures", "Models",
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]
),
.testTarget(
name: "SubscriptionFeaturesTests",
dependencies: [
"SubscriptionFeatures", "DepartmentFeatures", "Models",
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]
),
]
)
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
//
// NoticeAppTests.swift
// KuringAppTests
//
// Created by 이재성 on 10/10/23.
//

import XCTest
import ComposableArchitecture
@testable import KuringApp
@testable import NoticeFeatures
@testable import SearchFeatures

@MainActor
final class NoticeAppTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
//
// SubscriptionAppTests.swift
// KuringAppTests
//
// Created by 이재성 on 10/13/23.
//

import XCTest
import ComposableArchitecture
@testable import KuringApp
@testable import Models
@testable import DepartmentFeatures
@testable import SubscriptionFeatures

@MainActor
class SubscriptionAppTests: XCTestCase {
func test_showDepartmentEditor() async throws {
let 컴퓨터공학부 = NoticeProvider(
name: "computer_science",
hostPrefix: "cse",
korName: "컴퓨터공학부"
korName: "컴퓨터공학부",
category: .학과
)
let 체육교육과 = NoticeProvider(
name: "physical_education",
hostPrefix: "kupe",
korName: "체육교육과"
korName: "체육교육과",
category: .학과
)

let store = TestStore(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
//
// SubscriptionViewTests.swift
// KuringAppTests
//
// Created by 이재성 on 10/13/23.
//

import XCTest
import ComposableArchitecture
@testable import KuringApp
@testable import Models
@testable import DepartmentFeatures
@testable import SubscriptionFeatures

@MainActor
class SubscriptionViewTests: XCTestCase {
class SubscriptionTests: XCTestCase {
func test_tapConfirmButton() async throws {
let store = TestStore(
initialState: SubscriptionFeature.State(),
Expand Down Expand Up @@ -48,7 +43,8 @@ class SubscriptionViewTests: XCTestCase {
let department = NoticeProvider(
name: "computer_science",
hostPrefix: "cse",
korName: "컴퓨터공학부"
korName: "컴퓨터공학부",
category: .학과
)
let store = TestStore(
initialState: SubscriptionFeature.State(myDepartments: [department]),
Expand Down

0 comments on commit 5a89422

Please sign in to comment.