-
Notifications
You must be signed in to change notification settings - Fork 1
StorageScrapFragment Compose 마이그레이션 및 ViewModel 테스트 추가 #392
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
Merged
unam98
merged 18 commits into
test/add-viewmodel-unit-test-infra
from
feature/storage-compose-migration
Jun 26, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ae6f188
feat: StorageScrapFragment Compose 마이그레이션 및 ViewModel 테스트 추가
unam98 cab9c8a
ci: PR CI에 unit test 실행 단계 추가 및 트리거 확대
unam98 2321b18
fix: CI JDK 버전을 21로 맞춤 (gradle-daemon-jvm.properties와 일치)
unam98 a807d66
fix: CodeRabbit이 발견한 Compose 포팅 회귀 2건 수정
unam98 8d786bc
test: StorageScrapScreen Compose UI test 3건 추가
unam98 135edb2
ci: Compose UI test(androidTest)를 에뮬레이터로 자동 실행하는 잡 추가
unam98 aa42315
fix: 스크랩 해제(하트탭) 시 누락된 로딩 피드백 복구
unam98 bd95fd5
refactor: 로딩 상태 결합 로직을 순수 함수로 분리 + 회귀 방지 테스트 추가
unam98 d47f44c
fix: CI 에뮬레이터 잡을 macos-latest(Apple Silicon)에 맞춰 arm64-v8a로 수정
unam98 f41f46b
fix: 안드로이드 에뮬레이터 CI 잡을 ubuntu-latest+KVM으로 전환
unam98 fe30826
fix: ExampleInstrumentedTest의 하드코딩된 패키지명 오타 수정
unam98 f780884
ci: 테스트별 성공/실패를 PR 체크에서 바로 확인하도록 test-reporter 추가
unam98 a8c2938
fix: test-reporter 체크런 생성에 필요한 actions:read 권한 추가
unam98 484725a
fix: dorny/test-reporter를 v3로 올려 체크런 대신 잡 서머리에만 찍히던 문제 해결
unam98 5f5a0fd
ci: dorny/test-reporter 대신 자체 스크립트로 테스트 결과를 PR 코멘트에 게시
unam98 dfdfd45
fix: 테스트 결과 코멘트에서 testcase의 classname으로 그루핑하도록 수정
unam98 b9a66c4
feat: 테스트 결과 코멘트의 각 테스트에 고정 앵커 추가
unam98 15c93d5
ci: 테스트 실패 시에만 PR 코멘트 게시, 통과 시 코멘트 삭제
unam98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #!/usr/bin/env python3 | ||
| """Parse JUnit XML test results and print failed tests to stdout. | ||
|
|
||
| Prints nothing when all tests pass. Prints only failed tests when failures exist, | ||
| so the caller can decide whether to post a PR comment based on whether stdout is non-empty. | ||
| """ | ||
| import glob | ||
| import sys | ||
| import xml.etree.ElementTree as ET | ||
|
|
||
|
|
||
| def main() -> None: | ||
| title = sys.argv[1] | ||
| patterns = sys.argv[2:] | ||
|
|
||
| paths = [] | ||
| for pattern in patterns: | ||
| paths.extend(sorted(glob.glob(pattern, recursive=True))) | ||
|
|
||
| if not paths: | ||
| return | ||
|
|
||
| failed_by_class: dict[str, list[str]] = {} | ||
| total = failed = 0 | ||
|
|
||
| for path in paths: | ||
| root = ET.parse(path).getroot() | ||
| for case in root.findall("testcase"): | ||
| total += 1 | ||
| if case.find("failure") is not None or case.find("error") is not None: | ||
| failed += 1 | ||
| classname = case.get("classname", root.get("name", path)) | ||
| failed_by_class.setdefault(classname, []).append( | ||
| f"- ❌ {case.get('name')}" | ||
| ) | ||
|
|
||
| if failed == 0: | ||
| return | ||
|
|
||
| print(f"## ❌ {title} — {total}개 중 {failed}개 실패\n") | ||
| for classname in sorted(failed_by_class): | ||
| print(f"### {classname}") | ||
| print("\n".join(failed_by_class[classname])) | ||
| print() | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
app/src/androidTest/java/com/runnect/runnect/presentation/storage/StorageScrapScreenTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| package com.runnect.runnect.presentation.storage | ||
|
|
||
| import androidx.compose.ui.semantics.ProgressBarRangeInfo | ||
| import androidx.compose.ui.test.assertIsDisplayed | ||
| import androidx.compose.ui.test.hasProgressBarRangeInfo | ||
| import androidx.compose.ui.test.junit4.createComposeRule | ||
| import androidx.compose.ui.test.onNodeWithText | ||
| import androidx.compose.ui.test.performClick | ||
| import com.runnect.runnect.domain.entity.MyScrapCourse | ||
| import com.runnect.runnect.presentation.ui.theme.RunnectTheme | ||
| import org.junit.Assert.assertEquals | ||
| import org.junit.Rule | ||
| import org.junit.Test | ||
|
|
||
| class StorageScrapScreenTest { | ||
|
|
||
| @get:Rule | ||
| val composeTestRule = createComposeRule() | ||
|
|
||
| private fun course(title: String) = MyScrapCourse( | ||
| courseId = 1, | ||
| id = 1, | ||
| publicCourseId = 10, | ||
| image = null, | ||
| city = "서울", | ||
| region = "강남", | ||
| title = title | ||
| ) | ||
|
|
||
| @Test | ||
| fun `카드탭_시_onScrapItemClick이_해당_코스로_호출된다`() { | ||
| val testCourse = course(title = "테스트 코스") | ||
| var clicked: MyScrapCourse? = null | ||
|
|
||
| composeTestRule.setContent { | ||
| RunnectTheme { | ||
| StorageScrapScreen( | ||
| state = StorageScrapUiState(courses = listOf(testCourse)), | ||
| onRefresh = {}, | ||
| onScrapItemClick = { clicked = it }, | ||
| onHeartClick = {}, | ||
| onGoToScrapClick = {}, | ||
| onErrorShown = {} | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| composeTestRule.onNodeWithText("테스트 코스").performClick() | ||
|
|
||
| assertEquals(testCourse, clicked) | ||
| } | ||
|
|
||
| @Test | ||
| fun `로딩_중에는_스크랩이_없어도_빈_화면이_보이지_않는다`() { | ||
| composeTestRule.setContent { | ||
| RunnectTheme { | ||
| StorageScrapScreen( | ||
| state = StorageScrapUiState(courses = emptyList(), isLoading = true), | ||
| onRefresh = {}, | ||
| onScrapItemClick = {}, | ||
| onHeartClick = {}, | ||
| onGoToScrapClick = {}, | ||
| onErrorShown = {} | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| composeTestRule.onNodeWithText("아직 스크랩한 코스가 없어요", substring = true) | ||
| .assertDoesNotExist() | ||
| } | ||
|
|
||
| @Test | ||
| fun `로딩이_끝나고_스크랩이_없으면_빈_화면이_보인다`() { | ||
| composeTestRule.setContent { | ||
| RunnectTheme { | ||
| StorageScrapScreen( | ||
| state = StorageScrapUiState(courses = emptyList(), isLoading = false), | ||
| onRefresh = {}, | ||
| onScrapItemClick = {}, | ||
| onHeartClick = {}, | ||
| onGoToScrapClick = {}, | ||
| onErrorShown = {} | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| composeTestRule.onNodeWithText("아직 스크랩한 코스가 없어요", substring = true) | ||
| .assertIsDisplayed() | ||
| } | ||
|
|
||
| @Test | ||
| fun `isLoading이_true이면_로딩_인디케이터가_보인다`() { | ||
| composeTestRule.setContent { | ||
| RunnectTheme { | ||
| StorageScrapScreen( | ||
| state = StorageScrapUiState(courses = listOf(course("코스")), isLoading = true), | ||
| onRefresh = {}, | ||
| onScrapItemClick = {}, | ||
| onHeartClick = {}, | ||
| onGoToScrapClick = {}, | ||
| onErrorShown = {} | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| composeTestRule.onNode(hasProgressBarRangeInfo(ProgressBarRangeInfo.Indeterminate)) | ||
| .assertIsDisplayed() | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
Repository: Runnect/Runnect-Android
Length of output: 203
🏁 Script executed:
sed -n '1,140p' .github/workflows/CI.ymlRepository: Runnect/Runnect-Android
Length of output: 4364
🏁 Script executed:
sed -n '1,220p' app/build.gradleRepository: Runnect/Runnect-Android
Length of output: 6577
Pin
actions/setup-javato a commit SHAactions/setup-java@v4is still a mutable tag. Pin it to the exact commit SHA your workflow allows instead of using a floating version.🧰 Tools
🪛 zizmor (1.26.1)
[error] 23-23: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents
Source: Linters/SAST tools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 제안입니다. CI 워크플로 전체에 영향 주는 변경이라 이번 PR 범위 밖으로 보고 별도 이슈로 분리하겠습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@unam98이해했습니다. 이번 PR 범위에서는 분리하는 판단이 합리적입니다.원하시면 제가 후속 GitHub 이슈로 정리해 드릴게요.
actions/setup-java를 고정 SHA로 pinning 하는 작업 범위와 수용 기준까지 포함해서 작성할 수 있습니다.(•ᵕ•)🐇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네, 부탁드립니다. 이슈로 열어주세요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 1806
@unam98후속 이슈 생성해두었습니다:#393.github/workflows/CI.yml의actions/setup-java@v4를 immutable commit SHA로 pinning#392/ 해당 리뷰 코멘트 백링크, assignee 지정필요하시면 이어서 이 PR의 해당 리뷰 코멘트도 제가 정리해서 마무리 방향 제안드릴게요.