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

Add failed testcase name in tap file #367

Merged
merged 3 commits into from
Nov 16, 2022
Merged
Changes from 1 commit
Commits
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
20 changes: 19 additions & 1 deletion scripts/resultsSum.pl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,25 @@ sub resultReporter {
$tapString .= "not ok " . $numOfTotal . " - " . $result . "\n";
$tapString .= " ---\n";
if (($diagnostic eq 'failure') || ($diagnostic eq 'all')) {
$tapString .= $output;
if ($buildList =~ /openjdk/) {
my @lines = split('\\n', $output);
my $failureTests = "";
foreach my $line (@lines)
{
if ( $line =~ /TEST: /) {
Copy link
Contributor

@renfeiw renfeiw Nov 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to match the 50 hyphens before and then the TEST:

11:44:10  --------------------------------------------------
11:44:12  TEST: java/util/stream/test/org/openjdk/tests/java/util/stream/FilterOpTest.java

This could be more reliable compared to only TEST:. In an extreme case, if we have not only openjdk but also other folders in the buildlist, TEST: is too general.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Trying with multiple line query doesn't work well ( works in my local environment and failed with builds). Decided just using the simple loop, which works and feels simple and straightforward.

$failureTests .= $line . "\n";
}
}
if ( $failureTests eq "" ) {
# Output of dump or other non-test failures
$tapString .= $output;
} else {
$tapString .= " output:\n |\n";
$tapString .= " Failed test cases: \n" . $failureTests;
}
} else {
$tapString .= $output;
}
}
if ($spec =~ /zos/) {
my $dmpDir = dirname($resultFile).'/'.$testName;
Expand Down