[FEAT] Junit4 테스트 환경을 설정해보자. #225
Merged
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.
Related issue 🛠
closed #224
어떤 변경사항이 있었나요?
CheckPoint ✅
PR이 다음 요구 사항을 충족하는지 확인하세요.
Work Description ✏️
Uncompleted Tasks 😅
To Reviewers 📢
멀티모듈에서 테스트 환경 처음 적용해봤는데 이런 트러블슈팅이 있어서 공유합니다!
처음에 TestAndroid.kt의 configureTestAndroid를 모든 모듈에 일괄 적용했더니 빌드가 실패하는 문제가 발생했습니다...
원인을 찾아보니, androidTestImplementation에 추가한 Compose UI 테스트 관련 의존성들이 Manifest 또는 android {} 블록이 없는 모듈에서는 정상적으로 처리되지 않아
Missing AndroidManifest.xml에러가 발생했습니다.그래서 if (path.startsWith(":feature:")) 조건을 추가해서 피쳐 모듈에만 적용되도록 했습니다!
커버리지 리포트 생성 시 .exec 파일이 존재하지 않아 createDebugUnitTestCoverageReport Task가 실패하는 문제가 있었습니다.
.exec 파일은 실제로 테스트가 실행되어야 생성되는데 그동안 모듈 만들때 test모듈을 다 지워서 실패하는거 있죠..
그래서 Task에 onlyIf { file.exists() } 조건을 걸어 테스트가 수행되지 않았을 경우 자동으로 스킵되도록 처리했습니다.
아 그리고 Codecov를 사용하고 싶었는데 권한이 없어서 나중에 코드래빗 권한 받을 때 같이 받아야될듯 ㅠ