Generate and convert JUnit report for xunit-viewer
This commit is contained in:
parent
9d8ab4a7bc
commit
86c8cd9956
3 changed files with 32 additions and 4 deletions
3
.github/workflows/bld.yml
vendored
3
.github/workflows/bld.yml
vendored
|
@ -7,7 +7,6 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
java-version: [ 17, 21, 24 ]
|
||||
kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ]
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
@ -36,4 +35,4 @@ jobs:
|
|||
run: ./bld download
|
||||
|
||||
- name: Run tests
|
||||
run: ./bld compile test
|
||||
run: ./bld compile test
|
||||
|
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
|
@ -29,7 +29,7 @@
|
|||
</option>
|
||||
<option name="skipTestSources" value="false" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build" />
|
||||
</component>
|
||||
</project>
|
|
@ -22,6 +22,9 @@ import rife.bld.publish.PublishDeveloper;
|
|||
import rife.bld.publish.PublishLicense;
|
||||
import rife.bld.publish.PublishScm;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -107,6 +110,32 @@ public class CheckstyleOperationBuild extends Project {
|
|||
.command("scripts/cliargs.sh")
|
||||
.execute();
|
||||
}
|
||||
super.test();
|
||||
|
||||
var testResultsDir = "build/test-results/test/";
|
||||
var op = testOperation().fromProject(this);
|
||||
op.testToolOptions().reportsDir(new File(testResultsDir));
|
||||
|
||||
Exception ex = null;
|
||||
try {
|
||||
op.execute();
|
||||
} catch (Exception e) {
|
||||
ex = e;
|
||||
}
|
||||
|
||||
var xunitViewer = new File("/usr/bin/xunit-viewer");
|
||||
if (xunitViewer.exists() && xunitViewer.canExecute()) {
|
||||
var reportsDir = "build/reports/tests/test/";
|
||||
|
||||
Files.createDirectories(Path.of(reportsDir));
|
||||
|
||||
new ExecOperation()
|
||||
.fromProject(this)
|
||||
.command(xunitViewer.getPath(), "-r", testResultsDir, "-o", reportsDir + "index.html")
|
||||
.execute();
|
||||
}
|
||||
|
||||
if (ex != null) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue