Skip to content

Commit

Permalink
Ignore empty lines from segment validation output (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy authored Aug 23, 2023
1 parent 600ccff commit 7f3bd7e
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions Utils/segment_validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,32 +588,34 @@ function saveStdErrOutput($representationDirectory, $saveDetailedOutput = true)
} else {
$commonSeverity = "PASS";
foreach ($contentArray as $i => $msg) {
$severity = "PASS";
//Catch both warn and warning
if (stripos($msg, "warn") !== FALSE) {
$severity = "WARN";
if ($commonSeverity == "PASS") {
$commonSeverity = $severity;
if ($msg != "") {
$severity = "PASS";
//Catch both warn and warning
if (stripos($msg, "warn") !== FALSE) {
$severity = "WARN";
if ($commonSeverity == "PASS") {
$commonSeverity = $severity;
}
}
}
//Catch errors
if (stripos($msg, "error") !== FALSE) {
$severity = "FAIL";
if ($commonSeverity != "FAIL") {
$commonSeverity = $severity;
//Catch errors
if (stripos($msg, "error") !== FALSE) {
$severity = "FAIL";
if ($commonSeverity != "FAIL") {
$commonSeverity = $severity;
}
}
}

if ($saveDetailedOutput) {
$logger->test(
"Segment Validation",
"Segment Validation",
"Segment validator output should not contain errors",
$severity == "PASS",
$severity,
$msg,
$msg
);
if ($saveDetailedOutput) {
$logger->test(
"Segment Validation",
"Segment Validation",
"Segment validator output should not contain errors",
$severity == "PASS",
$severity,
$msg,
$msg
);
}
}
}

Expand Down

0 comments on commit 7f3bd7e

Please sign in to comment.