[Notes] [Git][BuildStream/buildstream][valentindavid/post_tracking_errors] Report processing errors from tracking



Title: GitLab

Valentin David pushed to branch valentindavid/post_tracking_errors at BuildStream / buildstream

Commits:

2 changed files:

Changes:

  • buildstream/_scheduler/queues/trackqueue.py
    ... ... @@ -58,18 +58,9 @@ class TrackQueue(Queue):
    58 58
             # Set the new refs in the main process one by one as they complete
    
    59 59
             for unique_id, new_ref in result:
    
    60 60
                 source = _plugin_lookup(unique_id)
    
    61
    -            try:
    
    62
    -                # We appear processed if at least one source has changed
    
    63
    -                if source._save_ref(new_ref):
    
    64
    -                    changed = True
    
    65
    -            except SourceError as e:
    
    66
    -                # FIXME: We currently dont have a clear path to
    
    67
    -                #        fail the scheduler from the main process, so
    
    68
    -                #        this will just warn and BuildStream will exit
    
    69
    -                #        with a success code.
    
    70
    -                #
    
    71
    -                source.warn("Failed to update project file",
    
    72
    -                            detail="{}".format(e))
    
    61
    +            # We appear processed if at least one source has changed
    
    62
    +            if source._save_ref(new_ref):
    
    63
    +                changed = True
    
    73 64
     
    
    74 65
             element._tracking_done()
    
    75 66
     
    

  • tests/frontend/track.py
    1
    +import stat
    
    1 2
     import os
    
    2 3
     import pytest
    
    3 4
     from tests.testutils import cli, create_repo, ALL_REPO_KINDS, generate_junction
    
    ... ... @@ -634,3 +635,32 @@ def test_track_junction_included(cli, tmpdir, datafiles, ref_storage, kind):
    634 635
     
    
    635 636
         result = cli.run(project=project, args=['track', 'junction.bst'])
    
    636 637
         result.assert_success()
    
    638
    +
    
    639
    +
    
    640
    +@pytest.mark.datafiles(DATA_DIR)
    
    641
    +@pytest.mark.parametrize("kind", [(kind) for kind in ALL_REPO_KINDS])
    
    642
    +def test_track_error_cannot_write_file(cli, tmpdir, datafiles, kind):
    
    643
    +    project = str(datafiles)
    
    644
    +    dev_files_path = os.path.join(project, 'files', 'dev-files')
    
    645
    +    element_path = os.path.join(project, 'elements')
    
    646
    +    element_name = 'track-test-{}.bst'.format(kind)
    
    647
    +
    
    648
    +    configure_project(project, {
    
    649
    +        'ref-storage': 'inline'
    
    650
    +    })
    
    651
    +
    
    652
    +    repo = create_repo(kind, str(tmpdir))
    
    653
    +    ref = repo.create(dev_files_path)
    
    654
    +
    
    655
    +    element_full_path = os.path.join(element_path, element_name)
    
    656
    +    generate_element(repo, element_full_path)
    
    657
    +
    
    658
    +    st = os.stat(element_path)
    
    659
    +    try:
    
    660
    +        read_mask = stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH
    
    661
    +        os.chmod(element_path, stat.S_IMODE(st.st_mode) & ~read_mask)
    
    662
    +
    
    663
    +        result = cli.run(project=project, args=['track', element_name])
    
    664
    +        result.assert_main_error(ErrorDomain.STREAM, None)
    
    665
    +    finally:
    
    666
    +        os.chmod(element_path, stat.S_IMODE(st.st_mode))



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