Skip to content

Commit 467b3aa

Browse files
alexization백효석
andauthored
(#78) backend verification contract reset
* chore: 백엔드 레거시 검증 자산 제거 - legacy verification Gradle task와 CI workflow 제거 - OpenAPI tracked 문서와 verification 전용 테스트 제거 - harness 재구성을 위한 clean baseline 정리 * ci: 백엔드 최소 검증 게이트 복구 --------- Co-authored-by: 백효석 <202580031@jei.com>
1 parent 64c0541 commit 467b3aa

12 files changed

Lines changed: 35 additions & 587 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ on:
55
branches:
66
- main
77
- develop
8-
98
pull_request:
109
branches:
1110
- main
1211
- develop
1312

1413
jobs:
15-
build:
16-
name: Build & Test
14+
verify:
15+
name: Unit and Integration Verification
1716
runs-on: ubuntu-latest
1817

1918
steps:
@@ -30,35 +29,8 @@ jobs:
3029
- name: Grant execute permission for gradlew
3130
run: chmod +x gradlew
3231

33-
- name: Build with Gradle
34-
run: ./gradlew build -x test
35-
3632
- name: Run unit tests
3733
run: ./gradlew test
3834

3935
- name: Run integration tests
4036
run: ./gradlew integrationTest
41-
42-
- name: Upload unit test results
43-
uses: actions/upload-artifact@v4
44-
if: always()
45-
with:
46-
name: unit-test-results
47-
path: build/reports/tests/test/
48-
retention-days: 7
49-
50-
- name: Upload integration test results
51-
uses: actions/upload-artifact@v4
52-
if: always()
53-
with:
54-
name: integration-test-results
55-
path: build/reports/tests/integrationTest/
56-
retention-days: 7
57-
58-
- name: Upload build artifacts
59-
uses: actions/upload-artifact@v4
60-
if: success()
61-
with:
62-
name: jar-artifact
63-
path: build/libs/*.jar
64-
retention-days: 7

.github/workflows/deploy.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,34 @@ env:
1212
IMAGE_NAME: git-ranker
1313

1414
jobs:
15+
verify:
16+
name: Pre-deploy Verification
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Java 21
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: '21'
27+
distribution: 'temurin'
28+
cache: 'gradle'
29+
30+
- name: Grant execute permission for gradlew
31+
run: chmod +x gradlew
32+
33+
- name: Run unit tests
34+
run: ./gradlew test
35+
36+
- name: Run integration tests
37+
run: ./gradlew integrationTest
38+
1539
docker:
1640
name: Build & Push Docker Image
1741
runs-on: ubuntu-latest
42+
needs: verify
1843

1944
steps:
2045
- name: Checkout code

.github/workflows/quality-gate.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<a href="#badge">Badge</a> •
2828
<a href="#data-refresh">Data Refresh</a> •
2929
<a href="#faq">FAQ</a> •
30-
<a href="#development-verification">Development Verification</a> •
3130
<a href="#contributing">Contributing</a> •
3231
<a href="#roadmap">Roadmap</a> •
3332
<a href="#license">License</a> •
@@ -283,20 +282,6 @@ GitHub 프로필(`README.md`)에 동적 배지를 삽입해, 현재 티어와
283282

284283
---
285284

286-
<a id="development-verification"></a>
287-
## 🧪 Development Verification
288-
289-
로컬 변경 후 backend 검증은 아래 순서로 실행합니다.
290-
291-
- `./gradlew test jacocoTestCoverageVerification`: 단위 테스트와 커버리지 검증을 실행합니다. Docker가 없어도 동작합니다.
292-
- `./gradlew verifyDockerAvailable`: Testcontainers 기반 통합 테스트 전에 Docker CLI와 daemon 연결 가능 여부를 fail-fast로 확인합니다.
293-
- `./gradlew integrationTest`: `verifyDockerAvailable`를 먼저 실행한 뒤 `*IT` 통합 테스트를 수행합니다. Docker가 준비되지 않았으면 환경 문제로 즉시 실패합니다.
294-
295-
> [!TIP]
296-
> `verifyDockerAvailable`가 실패하면 먼저 `docker version`이 성공하는지 확인한 뒤 `./gradlew integrationTest`를 다시 실행하세요.
297-
298-
---
299-
300285
<a id="contributing"></a>
301286
## 🤝 Contributing
302287

build.gradle

Lines changed: 8 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ plugins {
22
id 'java'
33
id 'org.springframework.boot' version '3.4.0'
44
id 'io.spring.dependency-management' version '1.1.6'
5-
id 'jacoco'
65
}
76

87
group = 'com.gitranker'
@@ -55,7 +54,6 @@ dependencies {
5554
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
5655
testImplementation 'org.testcontainers:junit-jupiter'
5756
testImplementation 'org.testcontainers:mysql'
58-
testImplementation 'com.tngtech.archunit:archunit-junit5:1.4.1'
5957

6058
testRuntimeOnly 'com.h2database:h2'
6159
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
@@ -67,26 +65,11 @@ tasks.named('test') {
6765
exclude '**/*IT.class'
6866
}
6967

70-
tasks.named('processResources') {
71-
filteringCharset = 'UTF-8'
72-
filesMatching('static/swagger-ui/index.html') {
73-
expand(swaggerUiVersion: swaggerUiVersion)
74-
}
75-
}
76-
77-
tasks.register('verifyDockerAvailable', JavaExec) {
78-
group = 'verification'
79-
description = 'Fails fast when Docker is unavailable for Testcontainers-based integration tests.'
80-
mainClass = 'com.gitranker.api.testsupport.DockerPreflightMain'
81-
classpath = sourceSets.test.runtimeClasspath
82-
83-
dependsOn tasks.named('testClasses')
84-
}
85-
86-
// 통합 테스트: *IT.java만 실행 (Docker/Testcontainers 필요)
87-
// check 라이프사이클에 포함하지 않음 — Docker 없는 환경에서 build가 실패하지 않도록 의도적 제외
88-
// CI에서는 별도 단계로 명시적 실행: ./gradlew integrationTest
68+
// 통합 테스트: Testcontainers 기반 *IT.java만 별도 lane에서 실행
69+
// check 라이프사이클에는 연결하지 않고 CI/deploy verification이 명시적으로 호출한다.
8970
tasks.register('integrationTest', Test) {
71+
group = 'verification'
72+
description = 'Runs Testcontainers-backed integration tests.'
9073
useJUnitPlatform()
9174
include '**/*IT.class'
9275

@@ -95,50 +78,13 @@ tasks.register('integrationTest', Test) {
9578
testClassesDirs = sourceSets.test.output.classesDirs
9679
classpath = sourceSets.test.runtimeClasspath
9780

98-
dependsOn tasks.named('verifyDockerAvailable')
99-
10081
// Docker 29+는 최소 API 1.44를 요구하지만 docker-java 3.4.0은 기본값 1.32로 요청함
10182
systemProperty 'api.version', '1.44'
10283
}
10384

104-
jacoco {
105-
toolVersion = '0.8.12'
106-
}
107-
108-
tasks.named('jacocoTestReport') {
109-
dependsOn tasks.named('test')
110-
reports {
111-
xml.required = true
112-
html.required = true
113-
csv.required = false
114-
}
115-
}
116-
117-
tasks.named('jacocoTestCoverageVerification') {
118-
dependsOn tasks.named('test')
119-
violationRules {
120-
rule {
121-
element = 'BUNDLE'
122-
limit {
123-
counter = 'LINE'
124-
value = 'COVEREDRATIO'
125-
minimum = 0.45
126-
}
127-
}
85+
tasks.named('processResources') {
86+
filteringCharset = 'UTF-8'
87+
filesMatching('static/swagger-ui/index.html') {
88+
expand(swaggerUiVersion: swaggerUiVersion)
12889
}
12990
}
130-
131-
def trackedOpenApiSpec = layout.projectDirectory.file('docs/openapi/openapi.json')
132-
133-
tasks.register('generateOpenApiSpec', Test) {
134-
group = 'documentation'
135-
description = 'Generates the tracked OpenAPI specification snapshot.'
136-
useJUnitPlatform()
137-
include '**/OpenApiDocsTest.class'
138-
testClassesDirs = sourceSets.test.output.classesDirs
139-
classpath = sourceSets.test.runtimeClasspath
140-
systemProperty 'openapi.output', trackedOpenApiSpec.asFile.absolutePath
141-
outputs.file(trackedOpenApiSpec)
142-
143-
dependsOn tasks.named('testClasses')
144-
}

docs/openapi/README.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

docs/openapi/openapi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/test/java/com/gitranker/api/architecture/ArchitectureGuardrailTest.java

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)