Skip to content

Commit 738079a

Browse files
committed
Develocity build scans: link directly to failing tests when there are any
1 parent 827d798 commit 738079a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/main/java/org/hibernate/infra/bot/develocity/DevelocityReportFormatter.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.util.stream.Collectors;
1313

1414
import jakarta.enterprise.context.ApplicationScoped;
15+
import jakarta.ws.rs.core.UriBuilder;
1516

1617
import org.hibernate.infra.bot.config.RepositoryConfig;
1718

@@ -113,6 +114,13 @@ static URI statusUri(DevelocityCIBuildScan buildScan) {
113114
};
114115
}
115116

117+
static URI testStatusUri(DevelocityCIBuildScan buildScan) {
118+
return switch ( buildScan.testStatus() ) {
119+
case SUCCESS -> buildScan.testsUri();
120+
case FAILURE -> UriBuilder.fromUri( buildScan.testsUri() ).queryParam( "outcome", "FAILED,FLAKY" ).build();
121+
};
122+
}
123+
116124
static String circleEmoji(DevelocityCIBuildScan.Status status) {
117125
return switch ( status ) {
118126
case SUCCESS -> ":green_circle:";

src/main/resources/templates/DevelocityReportFormatter/summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ No build scan found for this CI run.
1616
!}{/for}{!
1717
!}|{buildScan.goals.spaceDelimited.backQuoted}{!
1818
!}|[{buildScan.status.circleEmoji}]({buildScan.statusUri} "Build Scan"){!
19-
!} [{buildScan.testStatus.checkEmoji}]({buildScan.testsUri} "Tests"){!
19+
!} [{buildScan.testStatus.checkEmoji}]({buildScan.testStatusUri} "Tests"){!
2020
!} [:page_with_curl:]({buildScan.logsUri} "Logs"){!
2121
!}|
2222
{/for}

src/test/java/org/hibernate/infra/bot/develocity/DevelocityReportFormatterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void summary_simple() {
107107
|`Linux` `elasticsearch` `elasticsearch-8.13` `h2` `hibernate-search` `jdk-17` `lucene`\
108108
|`clean verify`\
109109
|[:red_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy/failures "Build Scan")\
110-
[:x:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
110+
[:x:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests?outcome=FAILED%2CFLAKY "Tests")\
111111
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
112112
|
113113
""" );
@@ -236,7 +236,7 @@ void summary_tagsConfig() {
236236
|`Linux`|`17`|`es-8.13` `lucene`|`h2`\
237237
|`clean verify`\
238238
|[:red_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy/failures "Build Scan")\
239-
[:x:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
239+
[:x:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests?outcome=FAILED%2CFLAKY "Tests")\
240240
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
241241
|
242242
""" );

0 commit comments

Comments
 (0)