Repository navigation
test(mindrecord): screenshotTest 소스셋을 세우고 추억 공간 baseline 을 넣는다 (#1131) #1154
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
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2b5a31d
test(mindrecord): screenshotTest 소스셋을 세우고 추억 공간 baseline 을 넣는다 (#1131)
Sadturtleman fc5ec9c
test(mindrecord): 추억 공간 baseline 6장을 넣는다 (#1131)
Sadturtleman 9e590bc
test(mindrecord): baseline 을 CI 에 연결하고 문구를 리소스에서 읽는다
Sadturtleman 09f4029
Merge remote-tracking branch 'origin/develop' into test/1131-mindreco…
1hyok 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
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
14 changes: 14 additions & 0 deletions
14
.../screenshotTest/kotlin/com/afternote/feature/mindrecord/presentation/CompactDeviceSpec.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,14 @@ | ||
| package com.afternote.feature.mindrecord.presentation | ||
|
|
||
| /** | ||
| * 좁은 화면 baseline 이 쓰는 기기 스펙 — 국내 보급형(720×1600 물리) 기준 (#1131). | ||
| * | ||
| * 기본 `@Preview` 는 411×914dp 급으로 렌더된다. 이 앱은 고정 dp 리터럴이 많고 반응형 API 는 | ||
| * 거의 안 쓰므로, 스크롤이 없는 화면은 세로가 모자라면 그대로 잘린다. 실기 QA 가 돌던 | ||
| * 에뮬레이터는 그보다도 넓어(446×967dp) 잘림이 구조적으로 안 잡혔다 (#1129). | ||
| * | ||
| * dpi 320(xhdpi)은 실기기의 리소스 버킷을 맞추기 위한 값이다 — 같은 360×800dp 라도 160dpi 면 | ||
| * 다른 drawable/dimen 이 선택돼 기준으로 쓸 수 없다. `feature:onboarding`·`feature:receiver` | ||
| * 의 같은 상수와 값을 맞춘다. | ||
| */ | ||
| internal const val COMPACT_DEVICE_SPEC = "spec:width=360dp,height=800dp,dpi=320" |
119 changes: 119 additions & 0 deletions
119
...ote/feature/mindrecord/presentation/screen/memoryspace/MemorySpaceScreenScreenshotTest.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,119 @@ | ||
| package com.afternote.feature.mindrecord.presentation.screen.memoryspace | ||
|
|
||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import com.afternote.core.ui.theme.AfternoteTheme | ||
| import com.afternote.feature.mindrecord.presentation.COMPACT_DEVICE_SPEC | ||
| import com.afternote.feature.mindrecord.presentation.R | ||
| import com.afternote.feature.mindrecord.presentation.model.memoryspace.MemoryItem | ||
| import com.android.tools.screenshot.PreviewTest | ||
|
|
||
| /** | ||
| * 추억 공간은 `verticalScroll`·`Lazy*`·`Pager` 가 없다 — 세로가 모자라면 그대로 잘린다 (#1131). | ||
| * | ||
| * 상태 셋(기록 있음·0건·조회 실패)을 기본 크기와 좁은 화면([COMPACT_DEVICE_SPEC]) 양쪽에서 | ||
| * 고정한다. 0건과 실패는 문구뿐 아니라 **재시도 버튼 유무**로 갈리므로 따로 둔다. | ||
| * | ||
| * 문구는 하드코딩하지 않고 리소스에서 읽는다 — 잡으려는 것이 «세로가 모자라 잘리는가» 인데 | ||
| * 문구가 다르면 줄바꿈과 세로 점유가 달라져 감시 대상 자체가 어긋난다. 리소스를 부르면 | ||
| * 문구가 바뀔 때 baseline 이 빨개져 «갱신하라» 고 알려 준다 (#1131 리뷰). | ||
| */ | ||
| @PreviewTest | ||
| @Preview(showBackground = true, backgroundColor = 0xFFF5F5F5) | ||
| @Composable | ||
| internal fun memorySpaceScreenScreenshot() { | ||
| AfternoteTheme { | ||
| MemorySpaceContent( | ||
| onBackClick = {}, | ||
| modifier = Modifier.fillMaxSize(), | ||
| memories = previewMemories(), | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @PreviewTest | ||
| @Preview(showBackground = true, backgroundColor = 0xFFF5F5F5, device = COMPACT_DEVICE_SPEC) | ||
| @Composable | ||
| internal fun memorySpaceScreenCompactScreenshot() { | ||
| AfternoteTheme { | ||
| MemorySpaceContent( | ||
| onBackClick = {}, | ||
| modifier = Modifier.fillMaxSize(), | ||
| memories = previewMemories(), | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @PreviewTest | ||
| @Preview(showBackground = true, backgroundColor = 0xFFF5F5F5) | ||
| @Composable | ||
| internal fun memorySpaceScreenEmptyScreenshot() { | ||
| AfternoteTheme { | ||
| MemorySpaceContent( | ||
| onBackClick = {}, | ||
| modifier = Modifier.fillMaxSize(), | ||
| memories = emptyList(), | ||
| statusText = stringResource(R.string.mindrecord_memory_space_empty), | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @PreviewTest | ||
| @Preview(showBackground = true, backgroundColor = 0xFFF5F5F5, device = COMPACT_DEVICE_SPEC) | ||
| @Composable | ||
| internal fun memorySpaceScreenEmptyCompactScreenshot() { | ||
| AfternoteTheme { | ||
| MemorySpaceContent( | ||
| onBackClick = {}, | ||
| modifier = Modifier.fillMaxSize(), | ||
| memories = emptyList(), | ||
| statusText = stringResource(R.string.mindrecord_memory_space_empty), | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| /** 조회 실패 — 0건과 달리 재시도 버튼이 함께 그려진다. */ | ||
| @PreviewTest | ||
| @Preview(showBackground = true, backgroundColor = 0xFFF5F5F5) | ||
| @Composable | ||
| internal fun memorySpaceScreenErrorScreenshot() { | ||
| AfternoteTheme { | ||
| MemorySpaceContent( | ||
| onBackClick = {}, | ||
| modifier = Modifier.fillMaxSize(), | ||
| memories = emptyList(), | ||
| statusText = stringResource(R.string.mindrecord_error_memory_space_failed), | ||
| onRetryClick = {}, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @PreviewTest | ||
| @Preview(showBackground = true, backgroundColor = 0xFFF5F5F5, device = COMPACT_DEVICE_SPEC) | ||
| @Composable | ||
| internal fun memorySpaceScreenErrorCompactScreenshot() { | ||
| AfternoteTheme { | ||
| MemorySpaceContent( | ||
| onBackClick = {}, | ||
| modifier = Modifier.fillMaxSize(), | ||
| memories = emptyList(), | ||
| statusText = stringResource(R.string.mindrecord_error_memory_space_failed), | ||
| onRetryClick = {}, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * 네트워크 이미지는 렌더되지 않으므로 baseline 에는 자리와 텍스트만 남는다 — 잘림을 보는 | ||
| * 데에는 그것으로 충분하다. | ||
| */ | ||
| private fun previewMemories(): List<MemoryItem> = | ||
| listOf( | ||
| MemoryItem(1L, "https://example.com/1.jpg", "기억 1", "2024.11.11", "미리보기", listOf("태그")), | ||
| MemoryItem(2L, "https://example.com/2.jpg", "기억 2", "2024.11.12", "미리보기", emptyList()), | ||
| MemoryItem(3L, "https://example.com/3.jpg", "기억 3", "2024.11.13", "미리보기", emptyList()), | ||
| MemoryItem(4L, "https://example.com/4.jpg", "기억 4", "2024.11.14", "미리보기", emptyList()), | ||
| ) |
Binary file added
BIN
+147 KB
...rySpaceScreenScreenshotTestKt/memorySpaceScreenCompactScreenshot_e7ca7c28_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+47.6 KB
...ceScreenScreenshotTestKt/memorySpaceScreenEmptyCompactScreenshot_e7ca7c28_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+75.5 KB
...morySpaceScreenScreenshotTestKt/memorySpaceScreenEmptyScreenshot_90705b76_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+44.1 KB
...ceScreenScreenshotTestKt/memorySpaceScreenErrorCompactScreenshot_e7ca7c28_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+70.2 KB
...morySpaceScreenScreenshotTestKt/memorySpaceScreenErrorScreenshot_90705b76_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+255 KB
...ce/MemorySpaceScreenScreenshotTestKt/memorySpaceScreenScreenshot_90705b76_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
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.
[blocking] 소스셋은 켜졌지만 CI 는 이 모듈의
validateScreenshotTest를 돌지 않는다..github/workflows/screenshot.yml:60-64가 모듈을 하드코딩한다:실측 두 가지:
Screenshot / Validate Compose Preview Screenshots잡(run32860511624) 로그에:feature:mindrecord:presentation태스크는 한 줄도 없다. 초록인 것은 통과해서가 아니라 돌지 않아서다..github/전체에서mindrecord문자열이 0건이다.그러니 지금 상태로 들어가면 baseline 6장은 저장소에만 있고 아무도 보지 않는 파일이 된다. 좁은 화면 잘림을 잡겠다는 이 PR 의 목적이 CI 에서 실현되지 않는다.
세 곳을 함께 고쳐야 한다:
screenshot.yml:60-64— 태스크 목록에:feature:mindrecord:presentation:validateScreenshotTest추가screenshot.yml:81-85— 실패 시 렌더 PNG 를 받는 아티팩트 업로드 경로(feature/mindrecord/presentation/build/outputs/screenshotTest-results/). 이게 빠지면 CI 가 빨개졌을 때 무엇이 어떻게 그려졌는지 볼 방법이 없다.screenshot.yml:106— 실패 안내 문구의 모듈 목록덧붙여, 모듈이 하나 늘면 이 잡의 벽시계 시간도 늘어난다(현재 7분대).
--parallel이 걸려 있어 치명적이지는 않겠지만, 이 PR 에서 실제 증가폭을 한 번 확인해 두면 다음 모듈을 붙일 때 근거가 된다.