[Notes] [Git][BuildStream/buildstream][Qinusty/retries-should-fail] 6 commits: buildstream/_project.py: Report if project.conf is missing name



Title: GitLab

Qinusty pushed to branch Qinusty/retries-should-fail at BuildStream / buildstream

Commits:

6 changed files:

Changes:

  • buildstream/_message.py
    ... ... @@ -78,3 +78,6 @@ class Message():
    78 78
             self.creation_time = datetime.datetime.now()
    
    79 79
             if message_type in (MessageType.SUCCESS, MessageType.FAIL):
    
    80 80
                 assert elapsed is not None
    
    81
    +        # logfile should always be associated with these messages
    
    82
    +        if message_type in (MessageType.START, MessageType.SUCCESS, MessageType.FAIL, MessageType.SKIPPED):
    
    83
    +            assert self.logfile, "START, SUCCESS, FAIL messages require logfile to be provided."

  • buildstream/_project.py
    ... ... @@ -398,6 +398,17 @@ class Project():
    398 398
                     "Project requested format version {}, but BuildStream {}.{} only supports up until format version {}"
    
    399 399
                     .format(format_version, major, minor, BST_FORMAT_VERSION))
    
    400 400
     
    
    401
    +        # FIXME:
    
    402
    +        #
    
    403
    +        #   Performing this check manually in the absense
    
    404
    +        #   of proper support from _yaml.node_get(), this should
    
    405
    +        #   be removed in favor of a proper accessor function
    
    406
    +        #   from the _yaml module when #591 is fixed.
    
    407
    +        #
    
    408
    +        if self._project_conf.get('name') is None:
    
    409
    +            raise LoadError(LoadErrorReason.INVALID_DATA,
    
    410
    +                            "{}: project.conf does not contain expected key '{}'".format(projectfile, 'name'))
    
    411
    +
    
    401 412
             # The project name, element path and option declarations
    
    402 413
             # are constant and cannot be overridden by option conditional statements
    
    403 414
             self.name = _yaml.node_get(pre_config_node, str, 'name')
    

  • buildstream/_scheduler/jobs/job.py
    ... ... @@ -430,7 +430,8 @@ class Job():
    430 430
                     self.message(MessageType.BUG, self.action_name,
    
    431 431
                                  elapsed=elapsed, detail=detail,
    
    432 432
                                  logfile=filename)
    
    433
    -                self._child_shutdown(RC_FAIL)
    
    433
    +                # Unhandled exceptions should permenantly fail
    
    434
    +                self._child_shutdown(RC_PERM_FAIL)
    
    434 435
     
    
    435 436
                 else:
    
    436 437
                     # No exception occurred in the action
    
    ... ... @@ -509,11 +510,6 @@ class Job():
    509 510
             message.action_name = self.action_name
    
    510 511
             message.task_id = self._task_id
    
    511 512
     
    
    512
    -        if (message.message_type == MessageType.FAIL and
    
    513
    -                self._tries <= self._max_retries and self._retry_flag):
    
    514
    -            # Job will be retried, display failures as warnings in the frontend
    
    515
    -            message.message_type = MessageType.WARN
    
    516
    -
    
    517 513
             # Send to frontend if appropriate
    
    518 514
             if context.silent_messages() and (message.message_type not in unconditional_messages):
    
    519 515
                 return
    

  • tests/sources/deb.py
    ... ... @@ -56,7 +56,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles):
    56 56
         result = cli.run(project=project, args=[
    
    57 57
             'fetch', 'target.bst'
    
    58 58
         ])
    
    59
    -    assert "Try #" in result.stderr
    
    59
    +    assert "FAILURE Try #" in result.stderr
    
    60 60
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    61 61
         result.assert_task_error(ErrorDomain.SOURCE, None)
    
    62 62
     
    

  • tests/sources/tar.py
    ... ... @@ -67,7 +67,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles):
    67 67
         result = cli.run(project=project, args=[
    
    68 68
             'fetch', 'target.bst'
    
    69 69
         ])
    
    70
    -    assert "Try #" in result.stderr
    
    70
    +    assert "FAILURE Try #" in result.stderr
    
    71 71
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    72 72
         result.assert_task_error(ErrorDomain.SOURCE, None)
    
    73 73
     
    

  • tests/sources/zip.py
    ... ... @@ -53,7 +53,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles):
    53 53
         result = cli.run(project=project, args=[
    
    54 54
             'fetch', 'target.bst'
    
    55 55
         ])
    
    56
    -    assert "Try #" in result.stderr
    
    56
    +    assert "FAILURE Try #" in result.stderr
    
    57 57
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    58 58
         result.assert_task_error(ErrorDomain.SOURCE, None)
    
    59 59
     
    



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