SelfTest false positive vermeiden
authorJan Büren <jan@kivitendo-premium.de>
Mon, 4 Jun 2018 09:04:57 +0000 (11:04 +0200)
committerJan Büren <jan@kivitendo-premium.de>
Mon, 4 Jun 2018 09:04:57 +0000 (11:04 +0200)
$self->all_passed enthält nicht mehr den Zustand, ob alle
Tests erfolgreich waren. Als Workaround auf zwei negativ
Status-Meldungen prüfen, die bei Problemen gesetzt sind.

SL/BackgroundJob/SelfTest.pm

index b34b71d..d446572 100644 (file)
@@ -63,8 +63,9 @@ sub run {
              $self->aggreg->failed,
              $self->aggreg->todo_passed,
   );
-
-  if (!$self->aggreg->all_passed || $self->config->{send_email_on_success}) {
+  # if (!$self->aggreg->all_passed || $self->config->{send_email_on_success}) {
+  # all_passed is not set or calculated (anymore). it is safe to check only for probs or errors
+  if ($self->aggreg->has_problems || $self->aggreg->has_errors || $self->config->{send_email_on_success}) {
     $self->_send_email;
   }