Skip to content

Commit

Permalink
Merge pull request #77 from getsource/port-7227
Browse files Browse the repository at this point in the history
Only report result status when tests were actually run.

Props @danielbachhuber.
  • Loading branch information
getsource authored May 15, 2020
2 parents a132352 + 0db3c98 commit dfb2bd6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion parts/result-set.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$status = 'Errored';
$status_title = 'No results found for test.';
$results = get_post_meta( $report->ID, 'results', true );
if ( isset( $results['failures'] ) ) {
if ( isset( $results['failures'] ) && ! empty( $results['tests'] ) ) {
$status = 0 === (int) $results['failures'] && 0 === (int) $results['errors'] ? 'Passed' : 'Failed';
$status_title = (int) $results['tests'] . ' tests, ' . (int) $results['failures'] . ' failed, ' . (int) $results['errors'] . ' errors';
}
Expand Down
2 changes: 1 addition & 1 deletion parts/single-result.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$status = 'Errored';
$status_title = 'No results found for test.';
$results = get_post_meta( $report->ID, 'results', true );
if ( isset( $results['failures'] ) ) {
if ( isset( $results['failures'] ) && ! empty( $results['tests'] ) ) {
$status = 0 === (int) $results['failures'] && 0 === (int) $results['errors'] ? 'Passed' : 'Failed';
$status_title = (int) $results['tests'] . ' tests, ' . (int) $results['failures'] . ' failed, ' . (int) $results['errors'] . ' errors';
}
Expand Down

0 comments on commit dfb2bd6

Please sign in to comment.