Follow us on Google+ Follow us on Facebook Follow us on Twitter

Changeset ci,43


Ignore:
Timestamp:
2017-09-05T14:39:41Z (6 weeks ago)
Author:
Vojtech Horky <vojtechhorky@…>
branch-nick:
ci
revision id:
vojtechhorky@users.sourceforge.net-20170905143941-5xl4ihal0nckmqyh
Message:

Add —inline-log-lines option

Location:
ci
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ci/build.py

    r32 r43  
    9696    help='How much memory to give the virtual machine running the tests.'
    9797)
     98args.add_argument('--inline-log-lines', default=10, dest='inline_log_lines',
     99    type=int,
     100    metavar='LINES',
     101    help='How many lines of log to show on the web page.'
     102)
    98103args.add_argument('--archive-format', default='tar.xz', dest='archive_format',
    99104    choices=['tar.xz', 'tar.gz'],
     
    132137    build_id=config.build_id,
    133138    printer=printer,
     139    inline_log_lines=config.inline_log_lines,
    134140    debug=config.debug
    135141)
  • ci/hbuild/scheduler.py

    r12 r43  
    9898
    9999class TaskController:
    100     def __init__(self, name, data, build_directory, artefact_directory, printer, print_debug = False):
     100    def __init__(self, name, data, build_directory, artefact_directory, printer, kept_log_lines, print_debug = False):
    101101        self.name = name
    102102        self.data = data
     
    107107        self.artefact_directory = artefact_directory
    108108        self.printer = printer
     109        self.kept_log_lines = kept_log_lines
    109110        self.print_debug_messages = print_debug
    110111   
    111112    def derive(self, name, data):
    112         return TaskController(name, data, self.build_directory, self.artefact_directory, self.printer, self.print_debug_messages)
     113        return TaskController(name, data, self.build_directory, self.artefact_directory,
     114            self.printer, self.kept_log_lines, self.print_debug_messages)
    113115   
    114116    def dprint(self, str, *args):
     
    177179            self.log.write(line + '\n')
    178180        self.log_tail.append(line)
    179         self.log_tail = self.log_tail[-10:]
     181        self.log_tail = self.log_tail[-self.kept_log_lines:]
    180182   
    181183    def get_artefact_absolute_path(self, relative_name, create_dirs=False):
     
    275277
    276278class BuildScheduler:
    277     def __init__(self, max_workers, build, artefact, build_id, printer, debug = False):
     279    def __init__(self, max_workers, build, artefact, build_id, printer, inline_log_lines = 10, debug = False):
    278280        self.config = {
    279281            'build-directory': build,
     
    287289
    288290        # Parent task controller
    289         self.ctl = TaskController('scheduler', {}, build, artefact, self.printer, debug)
     291        self.ctl = TaskController('scheduler', {}, build, artefact, self.printer, inline_log_lines, debug)
    290292
    291293        # Start the log file
Note: See TracChangeset for help on using the changeset viewer.