[Notes] [Git][BuildStream/buildstream][tpollard/386] _frontend: Don't print failure summary on build success



Title: GitLab

Tom Pollard pushed to branch tpollard/386 at BuildStream / buildstream

Commits:

2 changed files:

Changes:

  • buildstream/_frontend/app.py
    ... ... @@ -276,7 +276,7 @@ class App():
    276 276
                 if session_name:
    
    277 277
                     self._message(MessageType.SUCCESS, session_name, elapsed=self.stream.elapsed_time)
    
    278 278
                     if self._started:
    
    279
    -                    self._print_summary()
    
    279
    +                    self._print_summary(success=True)
    
    280 280
     
    
    281 281
         # init_project()
    
    282 282
         #
    
    ... ... @@ -617,11 +617,12 @@ class App():
    617 617
         #
    
    618 618
         # Print a summary of the queues
    
    619 619
         #
    
    620
    -    def _print_summary(self):
    
    620
    +    def _print_summary(self, success=False):
    
    621 621
             click.echo("", err=True)
    
    622 622
             self.logger.print_summary(self.stream,
    
    623 623
                                       self._main_options['log_file'],
    
    624
    -                                  styling=self.colors)
    
    624
    +                                  styling=self.colors,
    
    625
    +                                  success=success)
    
    625 626
     
    
    626 627
         # _error_exit()
    
    627 628
         #
    

  • buildstream/_frontend/widget.py
    ... ... @@ -503,8 +503,9 @@ class LogLine(Widget):
    503 503
         #    stream (Stream): The Stream
    
    504 504
         #    log_file (file): An optional file handle for additional logging
    
    505 505
         #    styling (bool): Whether to enable ansi escape codes in the output
    
    506
    +    #    success (bool): Whether to print failure log in summary
    
    506 507
         #
    
    507
    -    def print_summary(self, stream, log_file, styling=False):
    
    508
    +    def print_summary(self, stream, log_file, styling=False, success=False):
    
    508 509
     
    
    509 510
             # Early silent return if there are no queues, can happen
    
    510 511
             # only in the case that the stream early returned due to
    
    ... ... @@ -521,12 +522,14 @@ class LogLine(Widget):
    521 522
                 text += self.show_pipeline(elements, self.context.log_element_format)
    
    522 523
                 text += "\n\n"
    
    523 524
     
    
    524
    -        if self._failure_messages:
    
    525
    +        if not success and self._failure_messages:
    
    525 526
                 text += self.content_profile.fmt("Failure Summary\n", bold=True)
    
    526 527
                 values = OrderedDict()
    
    527 528
     
    
    528 529
                 for element, messages in sorted(self._failure_messages.items(), key=lambda x: x[0].name):
    
    529
    -                values[element.name] = ''.join(self._render(v) for v in messages)
    
    530
    +                for queue in stream.queues:
    
    531
    +                    if [True for el in queue.failed_elements if el.name == element.name]:
    
    532
    +                        values[element.name] = ''.join(self._render(v) for v in messages)
    
    530 533
                 text += self._format_values(values, style_value=False)
    
    531 534
     
    
    532 535
             text += self.content_profile.fmt("Pipeline Summary\n", bold=True)
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]