Skip to content

Commit 1b41f1a

Browse files
author
Piotr Kubicki
committed
fix(ci): improve test report handling and fix Failsafe HTML generation
- Ensure Failsafe plugin generates an HTML report like Surefire - Remove redundant Surefire report generation step - Improve artifact storage for easier access to test results
1 parent f4e0e11 commit 1b41f1a

File tree

3 files changed

+29
-42
lines changed

3 files changed

+29
-42
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,16 @@ jobs:
2525
java-version: '21'
2626
cache: 'maven'
2727

28-
- name: Build and Run Tests with Allure
29-
run: mvn clean verify -DtrimStackTrace=false -Dorg.slf4j.simpleLogger.defaultLogLevel=debug
28+
- name: Build and Run Tests
29+
run: mvn clean verify
3030

31-
- name: Generate Surefire and Allure Reports
32-
run: mvn site allure:report
31+
- name: Generate Test Reports (Surefire & Failsafe)
32+
run: mvn surefire-report:report-only
3333

34-
- name: Upload Test Reports (Surefire + Allure)
34+
- name: Upload HTML Test Reports (Surefire + Failsafe)
3535
if: always()
3636
uses: actions/upload-artifact@v4
3737
with:
38-
name: test-reports
39-
path: |
40-
target/surefire-reports/
41-
target/failsafe-reports/
42-
target/site/
43-
target/allure-report/
38+
name: surefire-failsafe-html-report
39+
path: target/site/surefire-report.html
4440
retention-days: 90
45-
46-
- name: Publish Allure Report
47-
if: always()
48-
uses: actions/upload-pages-artifact@v3
49-
with:
50-
path: target/allure-report/
51-
52-
deploy-allure:
53-
needs: build
54-
runs-on: ubuntu-latest
55-
permissions:
56-
pages: write
57-
id-token: write
58-
steps:
59-
- name: Deploy Allure Report to GitHub Pages
60-
uses: actions/deploy-pages@v4

pom.xml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@
7676
<artifactId>spring-security-test</artifactId>
7777
<scope>test</scope>
7878
</dependency>
79-
<dependency>
80-
<groupId>io.qameta.allure</groupId>
81-
<artifactId>allure-junit5</artifactId>
82-
<version>2.29.1</version>
83-
</dependency>
8479
</dependencies>
8580

8681
<build>
@@ -110,26 +105,38 @@
110105
</configuration>
111106
</plugin>
112107
<plugin>
113-
<groupId>io.qameta.allure</groupId>
114-
<artifactId>allure-maven</artifactId>
115-
<version>2.15.2</version>
108+
<groupId>org.apache.maven.plugins</groupId>
109+
<artifactId>maven-surefire-plugin</artifactId>
110+
<version>3.5.2</version>
111+
</plugin>
112+
<plugin>
113+
<groupId>org.apache.maven.plugins</groupId>
114+
<artifactId>maven-failsafe-plugin</artifactId>
115+
<version>3.5.2</version>
116116
<executions>
117117
<execution>
118118
<goals>
119-
<goal>report</goal>
120-
<goal>serve</goal>
119+
<goal>integration-test</goal>
120+
<goal>verify</goal>
121121
</goals>
122122
</execution>
123123
</executions>
124124
</plugin>
125125
<plugin>
126126
<groupId>org.apache.maven.plugins</groupId>
127-
<artifactId>maven-surefire-plugin</artifactId>
127+
<artifactId>maven-surefire-report-plugin</artifactId>
128128
<version>3.5.2</version>
129+
<executions>
130+
<execution>
131+
<phase>verify</phase>
132+
<goals>
133+
<goal>report-only</goal>
134+
</goals>
135+
</execution>
136+
</executions>
129137
<configuration>
130-
<systemPropertyVariables>
131-
<allure.results.directory>${project.build.directory}/allure-results</allure.results.directory>
132-
</systemPropertyVariables>
138+
<reportName>Test Report</reportName>
139+
<aggregate>true</aggregate>
133140
</configuration>
134141
</plugin>
135142
</plugins>

src/test/java/com/capgemini/training/appointment_booking_app/AppointmentBookingAppApplicationTests.java renamed to src/test/java/com/capgemini/training/appointment_booking_app/AppointmentBookingAppApplicationIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.springframework.boot.test.context.SpringBootTest;
55

66
@SpringBootTest
7-
class AppointmentBookingAppApplicationTests {
7+
class AppointmentBookingAppApplicationIT {
88

99
@Test
1010
void contextLoads() {

0 commit comments

Comments
 (0)