Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7903819: jcstress do not print structuralised results #158

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0ca6629
xml results initial shot
judovana Nov 17, 2024
1e9699e
Removed cpuMap from detailed test output
judovana Nov 18, 2024
49f1a4d
hidden constructor used methods
judovana Nov 18, 2024
2466f64
Unhappy experiemnts to try traces from subtests
judovana Nov 19, 2024
ee5c33a
use name of proeprty
judovana Nov 22, 2024
17e8cc5
Changed approach to iterate ower merged results.
judovana Nov 22, 2024
73e04b6
Reorganized and cleaned up as it finally do what it should
judovana Nov 25, 2024
0d758a7
FIXME Added fast fake results generator REMOVE IT
judovana Jan 7, 2025
4451c44
Various changes.. bad day
judovana Jan 9, 2025
05365af
aded possibility to merge stdout/err to failure only
judovana Jan 10, 2025
54a2e4d
Small code improvements
judovana Jan 11, 2025
93e3773
Removed most of the duplicated code
judovana Jan 11, 2025
c09b48f
Refactored exporter proeprties to method
judovana Jan 11, 2025
a141869
Next gandidate to soon be removed code
judovana Jan 12, 2025
c5be2ad
No longer pritning empty properties
judovana Jan 13, 2025
7bb346c
Not printing the seed argument
judovana Jan 13, 2025
ae9d943
<testsuite> now prints correct summary
judovana Jan 15, 2025
3a20636
Support for time attribute and removed some dnagling code
judovana Jan 16, 2025
077393b
Unifide testcase print
judovana Jan 16, 2025
7d49f5c
changed comments proeprty to comment out non-standart elements
judovana Jan 16, 2025
1361ef1
made default output xsd valid again
judovana Jan 18, 2025
5c77eae
Fixed few noted comments/variables
judovana Jan 25, 2025
80f3586
Revert "FIXME Added fast fake results generator REMOVE IT"
judovana Jan 25, 2025
96b4e81
Started migration to proepr DOM
judovana Jan 25, 2025
910b6ba
Dropped the dom-based generation
judovana Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions jcstress-core/src/main/java/org/openjdk/jcstress/JCStress.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.openjdk.jcstress.infra.grading.ExceptionReportPrinter;
import org.openjdk.jcstress.infra.grading.TextReportPrinter;
import org.openjdk.jcstress.infra.grading.HTMLReportPrinter;
import org.openjdk.jcstress.infra.grading.XMLReportPrinter;
import org.openjdk.jcstress.infra.runners.TestConfig;
import org.openjdk.jcstress.infra.runners.TestList;
import org.openjdk.jcstress.os.*;
Expand Down Expand Up @@ -157,11 +158,18 @@ public void parseResults() throws Exception {
drc.dump();
drc.close();

new TextReportPrinter(opts, collector).work();
new HTMLReportPrinter(opts, collector, out).work();
new TextReportPrinter(opts.verbosity(), collector).work();
new HTMLReportPrinter(opts.getResultDest(), collector, out).work();
if (XMLReportPrinter.getSparse(out)!=null) {
new XMLReportPrinter(opts.getResultDest(), collector, out, XMLReportPrinter.getSparse(out)).work();
} else {
new XMLReportPrinter(opts.getResultDest(), collector, out, false).work();
new XMLReportPrinter(opts.getResultDest(), collector, out, true).work();
}
new ExceptionReportPrinter(collector).work();
}


private SortedSet<Integer> computeActorCounts(Set<String> tests) {
SortedSet<Integer> counts = new TreeSet<>();
for (String test : tests) {
Expand Down Expand Up @@ -232,7 +240,7 @@ public int listTests(Options opts) {
Set<String> testsToPrint = new TreeSet<>();
for (TestConfig test : configsWithScheduler.configs) {
if (opts.verbosity().printAllTests()) {
testsToPrint.add(test.toDetailedTest());
testsToPrint.add(test.toDetailedTest(true));
} else {
testsToPrint.add(test.name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
package org.openjdk.jcstress.infra.grading;


import org.openjdk.jcstress.Options;
import org.openjdk.jcstress.annotations.Expect;
import org.openjdk.jcstress.infra.Status;
import org.openjdk.jcstress.infra.TestInfo;
Expand Down Expand Up @@ -57,19 +56,23 @@ public class HTMLReportPrinter {
private final InProcessCollector collector;
private int cellStyle = 1;

public HTMLReportPrinter(Options opts, InProcessCollector collector, PrintStream out) {
public HTMLReportPrinter(String resultDir, InProcessCollector collector, PrintStream out) {
this.collector = collector;
this.resultDir = opts.getResultDest();
this.resultDir = resultDir;
File dir = new File(resultDir);
dir.mkdirs();
out.println(" HTML report generated at " + dir.getAbsolutePath() + File.separator + "index.html");
out.println(" HTML report generated at " + dir.getAbsolutePath() + File.separator + getMainFileName());
}

private String getMainFileName() {
return "index.html";
}

public void work() throws FileNotFoundException {
List<TestResult> byName = ReportUtils.mergedByName(collector.getTestResults());
Collections.sort(byName, Comparator.comparing(TestResult::getName));

PrintWriter output = new PrintWriter(resultDir + "/index.html");
PrintWriter output = new PrintWriter(resultDir + File.separator + getMainFileName());

printHeader(output);

Expand Down Expand Up @@ -171,7 +174,7 @@ public void work() throws FileNotFoundException {
emitTestReports(ReportUtils.byName(collector.getTestResults()));
}

private SortedMap<String, String> getEnv(List<TestResult> ts) {
static SortedMap<String, String> getEnv(List<TestResult> ts) {
SortedMap<String, String> env = new TreeMap<>();
for (TestResult result : ts) {
if (result != null) {
Expand Down Expand Up @@ -353,10 +356,7 @@ public void emitTestReport(PrintWriter o, Collection<TestResult> results, TestIn
}

List<TestResult> sorted = new ArrayList<>(results);
sorted.sort(Comparator
.comparing((TestResult t) -> t.getConfig().getCompileMode())
.thenComparing((TestResult t) -> t.getConfig().getSchedulingClass().toString())
.thenComparing((TestResult t) -> StringUtils.join(t.getConfig().jvmArgs, ",")));
resultsOrder(sorted);

o.println("<h3>Environment</h3>");
o.println("<table>");
Expand Down Expand Up @@ -492,6 +492,13 @@ public void emitTestReport(PrintWriter o, Collection<TestResult> results, TestIn
printFooter(o);
}

static void resultsOrder(List<TestResult> sorted) {
sorted.sort(Comparator
.comparing((TestResult t) -> t.getConfig().getCompileMode())
.thenComparing((TestResult t) -> t.getConfig().getSchedulingClass().toString())
.thenComparing((TestResult t) -> StringUtils.join(t.getConfig().jvmArgs, ",")));
}

private void resultHeader(PrintWriter o, TestResult r) {
TestConfig cfg = r.getConfig();
o.println("<p><b>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ public static Multimap<String, TestResult> byName(Collection<TestResult> src) {
}
return result;
}
public static Multimap<String, TestResult> byDetailedName(Collection<TestResult> src) {
Multimap<String, TestResult> result = new HashMultimap<>();
for (TestResult r : mergedByConfig(src)) {
result.put(r.getConfig().toDetailedTest(false), r);
}
return result;
}

private static TestResult merged(TestConfig config, Collection<TestResult> mergeable) {
Counter<String> counter = new Counter<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public class TextReportPrinter {
private final PrintWriter pw;
private final Set<TestResult> emittedTests;

public TextReportPrinter(Options opts, InProcessCollector collector) {
public TextReportPrinter(Verbosity verbosity, InProcessCollector collector) {
this.collector = collector;
this.pw = new PrintWriter(System.out, true);
this.verbosity = opts.verbosity();
this.verbosity = verbosity;
this.emittedTests = new HashSet<>();
}

Expand Down
Loading