[Notes] [Git][BuildStream/buildstream][gokcen/add_no_fetch_flag] fixup! Make source-checkout fetch by default



Title: GitLab

Gökçen Nurlu pushed to branch gokcen/add_no_fetch_flag at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • tests/frontend/source_checkout.py
    ... ... @@ -91,8 +91,8 @@ def test_source_checkout_except(datafiles, cli):
    91 91
     
    
    92 92
     
    
    93 93
     @pytest.mark.datafiles(DATA_DIR)
    
    94
    -@pytest.mark.parametrize('fetch', [(False), (True)])
    
    95
    -def test_source_checkout_fetch(datafiles, cli, fetch):
    
    94
    +@pytest.mark.parametrize('no_fetch', [(False), (True)])
    
    95
    +def test_source_checkout_fetch(datafiles, cli, no_fetch):
    
    96 96
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    97 97
         checkout = os.path.join(cli.directory, 'source-checkout')
    
    98 98
         target = 'remote-import-dev.bst'
    
    ... ... @@ -104,18 +104,18 @@ def test_source_checkout_fetch(datafiles, cli, fetch):
    104 104
             'pony.h')
    
    105 105
         _yaml.dump(element, target_path)
    
    106 106
     
    
    107
    -    # Testing --fetch option requires that we do not have the sources
    
    107
    +    # Testing --no-fetch option requires that we do not have the sources
    
    108 108
         # cached already
    
    109 109
         assert cli.get_element_state(project, target) == 'fetch needed'
    
    110 110
     
    
    111 111
         args = ['source-checkout']
    
    112
    -    if fetch:
    
    113
    -        args += ['--fetch']
    
    112
    +    if no_fetch:
    
    113
    +        args += ['--no-fetch']
    
    114 114
         args += [target, checkout]
    
    115 115
         result = cli.run(project=project, args=args)
    
    116 116
     
    
    117
    -    if fetch:
    
    117
    +    if no_fetch:
    
    118
    +        result.assert_main_error(ErrorDomain.PIPELINE, 'uncached-sources')
    
    119
    +    else:
    
    118 120
             result.assert_success()
    
    119 121
             assert os.path.exists(os.path.join(checkout, 'remote-import-dev', 'pony.h'))
    120
    -    else:
    
    121
    -        result.assert_main_error(ErrorDomain.PIPELINE, 'uncached-sources')



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