Skip to content

Presentation 계열 테스트 지원 코드를 target-local로 정리한다 #697

Description

@opficdev

전제

  • #696에서 PresentationEntryPresentationShared를 re-export하는 target으로 축소됨
  • Entry는 root/auth/login/main/window/global route와 해당 흐름의 Domain 참조를 소유함
  • Presentation target의 직접 Domain 의존성 제거는 이미 반영된 상태임
  • Application/Presentation/Tests와 기존 PresentationTests 기준 root support 경로는 더 이상 사용하지 않음
  • PresentationShared의 HomeTab 전용 코드 소유권을 정리한다 #695 이후 Home 전용 Search/Web/RecentTodo production/test 코드는 HomeTab/HomeTabTests로 이동된 상태임

문제

Presentation 계열 테스트 지원 코드는 target 분리 이후 일부 target-local로 복사되었지만, PresentationSharedTests support에 여러 target 전용 spy/helper가 남아 있음.

현재 checkout 기준 확인된 상태:

  • Entry/Tests/Support/EntryTestSupport.swiftEntryTests 공통 waitUntil, SignInUseCaseSpy를 이미 소유함
  • HomeTab/Tests/Home/HomeFeatureTestSpies.swift는 Home 전용 category/web/todo/network spy와 waitUntil을 이미 소유함
  • HomeTab/Tests/Search/SearchFeatureTestDoubles.swift는 Search 전용 spy/helper를 이미 소유함
  • NotificationTab/Tests/PushNotification/PushNotificationListTestSupport.swift는 PushNotification adapter와 fetch spy를 소유하지만, query/delete/toggle spy는 아직 PresentationShared/Tests/Support/TestSupport.swift에만 남아 있음
  • ProfileTab/Tests/Profile/ProfileFeatureTests.swiftProfileTab/Tests/Settings/SettingsFeatureTestDoubles.swift는 Profile/Settings 전용 spy/helper를 이미 소유함
  • PresentationShared/Tests/Support/TestSupport.swift에는 Entry, HomeTab, NotificationTab, ProfileTab 성격의 spy와 현재 사용처가 없는 spy가 남아 있음
  • Application/Presentation 아래 기존 PresentationTests header/comment 문자열은 현재 검색되지 않음

테스트 전용 코드를 공유 target으로 빼면 Tuist graph에 테스트 support target이 노출되므로, 별도 test-only module을 만들지 않고 각 테스트 target 내부에만 두는 방향으로 정리 필요.

작업 계획

  1. NotificationTabTests 전용 spy를 target-local로 이동
    • DeletePushNotificationUseCaseSpy
    • UndoDeletePushNotificationUseCaseSpy
    • TogglePushNotificationReadUseCaseSpy
    • FetchPushNotificationQueryUseCaseSpy
    • UpdatePushNotificationQueryUseCaseSpy
    • FetchPushNotificationsUseCaseSpyNotificationTabTestsPushNotificationListFetchUseCaseSpy가 있으므로 이동하지 않고 shared support 제거 대상으로 분류
  2. EntryTests 중복 제거
    • EntryTestSupport.swiftwaitUntil, SignInUseCaseSpy를 canonical로 유지
    • PresentationShared/Tests/Support/TestSupport.swift의 Entry 성격 SignInUseCaseSpy 제거
  3. HomeTabTests 중복 제거
    • HomeFeatureTestSpies.swift, SearchFeatureTestDoubles.swift의 target-local helper를 canonical로 유지
    • PresentationShared/Tests/Support/TestSupport.swift의 Home/Search 성격 spy 제거
  4. ProfileTabTests 중복 제거
    • ProfileFeatureTests.swift, SettingsFeatureTestDoubles.swift의 target-local helper를 canonical로 유지
    • PresentationShared/Tests/Support/TestSupport.swift의 Profile/Settings 성격 spy 제거
  5. PresentationSharedTests support 축소
    • Todo/Loading 등 shared production 타입 테스트가 실제로 사용하는 helper만 남김
    • 현재 기준으로 waitUntil만 남기는 방향으로 정리
    • 불필요해진 import 제거
  6. 같은 test target 내부 중복 이름만 정리하고, target 간 동일 이름 spy는 허용

완료 조건

  • 테스트 지원 코드가 production target 또는 production public surface에 남지 않음
  • 각 spy/helper가 사용하는 테스트 target 내부에서만 보임
  • PresentationSharedTests support에는 실제 shared production 타입 테스트에 필요한 helper만 남음
  • 별도 PresentationTestSupport 같은 test-only target을 만들지 않음
  • Tuist 의존성 그래프에 테스트 지원 전용 module이 추가되지 않음
  • Application/Presentation 아래 기존 PresentationTests header/comment 문자열이 계속 검색되지 않음

제외 범위

  • production 모듈 소유권 변경
  • #695의 Search/Web/RecentTodo production 코드 이동
  • #696의 Presentation/Entry 책임 분리 재작업
  • 테스트 지원 코드 중복을 없애기 위한 새 shared test target 추가
  • Tuist target dependency 변경

검증

  • 변경한 테스트 Swift 파일 lint
  • Entry build-for-testing
  • HomeTab build-for-testing
  • NotificationTab build-for-testing
  • ProfileTab build-for-testing
  • PresentationShared build-for-testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions