Skip to content

ci: build-test 잡이 테스트를 컴파일조차 하지 않던 문제 수정 - #79

Merged
jei007 merged 1 commit into
eGovFramework:mainfrom
wantaekchoi:fix/ci-skips-tests
Sep 11, 2026
Merged

ci: build-test 잡이 테스트를 컴파일조차 하지 않던 문제 수정#79
jei007 merged 1 commit into
eGovFramework:mainfrom
wantaekchoi:fix/ci-skips-tests

Conversation

@wantaekchoi

Copy link
Copy Markdown
Contributor

수정 사유 Reason for modification

  • 버그수정 Bug fixes
  • 기능개선 Enhancements
  • 기능추가 Adding features
  • 기타 Others

수정된 소스 내용 Modified source

워크플로 이름은 build-test 이고(.github/workflows/maven.yml:1) README 7행이 그 배지를 노출합니다. 그런데 유일한 빌드 단계(23행)가 -Dmaven.test.skip=true 로 돌아 src/test 의 테스트 19개 클래스가 실행은커녕 컴파일도 되지 않습니다. maven.test.skipskipTests 와 달리 surefire 실행뿐 아니라 testCompile 단계까지 건너뜁니다.

테스트 소스에 컴파일 오류를 넣고 워크플로와 같은 명령을 돌려도 이렇게 끝납니다.

[INFO] --- compiler:3.14.0:testCompile (default-testCompile) @ egovframe-boot-web ---
[INFO] Not compiling test sources
[...]
[INFO] --- surefire:3.5.4:test (default-test) @ egovframe-boot-web ---
[INFO] Tests are skipped.
[...]
[INFO] BUILD SUCCESS

이 줄이 쓰인 2023-04-07 에는 저장소에 src/test 가 없었습니다. main 이 테스트를 처음 받은 것은 23개월 뒤인 2025-03-06(#28 머지)이고, 그 뒤로 maven.yml 이 네 번 고쳐지는 동안에도 이 줄만 그대로 남았습니다. 테스트를 끄려고 넣은 플래그가 아니라 테스트가 없던 시절의 설정으로 보입니다.

변경

-      run: mvn -B package --file pom.xml -Dmaven.test.skip=true
+      run: mvn -B package --file pom.xml

플래그만 지웠습니다. 브라우저 창을 띄우는 EgovSampleControllerTestSelenium(@BeforeEach 에서 옵션 없이 new ChromeDriver() 호출, 36행)은 이름이 surefire 기본 include(Test*·*Test·*Tests·*TestCase)에 걸리지 않아 선택되지 않고, 나머지 18개 클래스 54건이 main 대상 push·PR 에서 돌게 됩니다.

pom.xml 은 건드리지 않았습니다. surefire 설정을 새로 넣지 않아도 워크플로 한 줄로 같은 결과가 나오고, 로컬 mvn test 동작도 그대로 남습니다.

영향 범위

push·pull_request(main) 로 도는 유일한 워크플로의 빌드 단계 한 줄입니다. egovframe-boot-web-5.0.0.jar 산출물은 동일하고 다음 단계 ls -laR target 도 그대로 성공합니다(목록에 test-classes·surefire-reports 가 추가됩니다). 애플리케이션 코드·설정·테스트 코드 변경은 없습니다.

검증 (실측)

위 출력은 테스트 소스를 일부러 망가뜨려 얻은 것입니다.

sed -i '' 's|vo.setId("SAMPLE-001");|vo.setId(THIS_DOES_NOT_COMPILE);|' \
  src/test/java/egovframework/example/sample/service/SampleVOTest.java
mvn -B package --file pom.xml -Dmaven.test.skip=true

같은 파일에 이 PR 의 명령을 쓰면 잡힙니다.

mvn -B package --file pom.xml
[ERROR] /private/tmp/cd-boot4/src/test/java/egovframework/example/sample/service/SampleVOTest.java:[37,26] cannot find symbol
  symbol:   variable THIS_DOES_NOT_COMPILE
  location: class egovframework.example.sample.service.SampleVOTest
[...]
[INFO] BUILD FAILURE

되돌린 뒤 같은 명령을 실행한 결과입니다.

[INFO] Compiling 19 source files with javac [debug parameters release 17] to target/test-classes
[...]
[INFO] Tests run: 54, Failures: 0, Errors: 0, Skipped: 0
[...]
[INFO] BUILD SUCCESS

빠지는 Selenium 클래스는 단독으로도 실행해 보았습니다 — mvn -B test -Dtest='*Selenium'Tests run: 1, Failures: 0, Errors: 0, Skipped: 0. 깨져서 빠지는 것이 아니고, 헤드리스 전환은 테스트 코드 쪽 별건입니다.

  • Java: 21.0.11 (테스트 컴파일은 위 출력대로 release 17)
  • Maven: 3.9.16

JUnit 테스트 JUnit tests

  • JUnit 테스트 JUnit tests
  • 수동 테스트 Manual testing

저장소에 이미 있는 테스트를 실행만 되살렸고 새로 추가한 테스트는 없습니다. 수동 테스트는 워크플로의 run: 명령을 그대로 실행하는 방식으로 했습니다.

테스트 브라우저 Test Browser

  • Chrome
  • Firefox
  • Edge
  • Safari
  • Opera
  • Internet Explorer
  • 기타 Others

해당 없음 (CI 워크플로 변경, 화면 영향 없음)

테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video

해당 없음 — 위 명령 출력으로 대신합니다.

빌드 단계가 -Dmaven.test.skip=true 로 돌아 src/test 의 테스트 19개
클래스가 컴파일도 되지 않았다. 이 플래그는 실행뿐 아니라 테스트
컴파일까지 건너뛴다. 테스트 소스에 컴파일 오류를 넣고 같은 명령을
돌려도 'Not compiling test sources' 를 찍고 BUILD SUCCESS 가 난다.

이 줄은 저장소에 src/test 가 없던 2023-04-07 에 쓰였고, 테스트가
main 에 들어온 뒤에도 그대로 남았다. 플래그를 지우면 18개 클래스
54건이 돈다. 브라우저 창을 띄우는 EgovSampleControllerTestSelenium
은 이름이 surefire 기본 include 에 걸리지 않아 선택되지 않는다.

@jei007 jei007 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

표준프레임워크에 대한 지속적인 참여에
대단히 감사드립니다.

@jei007
jei007 merged commit 0ded435 into eGovFramework:main Sep 11, 2026
1 check passed
@wantaekchoi
wantaekchoi deleted the fix/ci-skips-tests branch September 11, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants