[Notes] [Git][BuildStream/buildstream][chandan/source-subgroup] 2 commits: Introduce new "source" command group



Title: GitLab

Chandan Singh pushed to branch chandan/source-subgroup at BuildStream / buildstream

Commits:

27 changed files:

Changes:

  • NEWS
    ... ... @@ -2,6 +2,12 @@
    2 2
     buildstream 1.3.1
    
    3 3
     =================
    
    4 4
     
    
    5
    +  o BREAKING CHANGE: `bst track` and `bst fetch` commands are now osbolete.
    
    6
    +    Their functionality is provided by `bst source track` and
    
    7
    +    `bst source fetch` respectively.
    
    8
    +
    
    9
    +  o Added new `bst source checkout` command to checkout sources of an element.
    
    10
    +
    
    5 11
       o BREAKING CHANGE: Default strip-commands have been removed as they are too
    
    6 12
         specific. Recommendation if you are building in Linux is to use the
    
    7 13
         ones being used in freedesktop-sdk project, for example
    
    ... ... @@ -69,8 +75,6 @@ buildstream 1.3.1
    69 75
         with cached artifacts, only 'complete' elements can be pushed. If the element
    
    70 76
         is expected to have a populated build tree then it must be cached before pushing.
    
    71 77
     
    
    72
    -  o Added new `bst source-checkout` command to checkout sources of an element.
    
    73
    -
    
    74 78
       o `bst workspace open` now supports the creation of multiple elements and
    
    75 79
         allows the user to set a default location for their creation. This has meant
    
    76 80
         that the new CLI is no longer backwards compatible with buildstream 1.2.
    

  • buildstream/_frontend/cli.py
    ... ... @@ -46,7 +46,8 @@ def search_command(args, *, context=None):
    46 46
     def complete_commands(cmd, args, incomplete):
    
    47 47
         command_ctx = search_command(args[1:])
    
    48 48
         if command_ctx and command_ctx.command and isinstance(command_ctx.command, click.MultiCommand):
    
    49
    -        return [subcommand + " " for subcommand in command_ctx.command.list_commands(command_ctx)]
    
    49
    +        return [subcommand + " " for subcommand in command_ctx.command.list_commands(command_ctx)
    
    50
    +                if not command_ctx.command.get_command(command_ctx, subcommand).hidden]
    
    50 51
     
    
    51 52
         return []
    
    52 53
     
    
    ... ... @@ -336,96 +337,6 @@ def build(app, elements, all_, track_, track_save, track_all, track_except, trac
    336 337
                              build_all=all_)
    
    337 338
     
    
    338 339
     
    
    339
    -##################################################################
    
    340
    -#                          Fetch Command                         #
    
    341
    -##################################################################
    
    342
    -@cli.command(short_help="Fetch sources in a pipeline")
    
    343
    -@click.option('--except', 'except_', multiple=True,
    
    344
    -              type=click.Path(readable=False),
    
    345
    -              help="Except certain dependencies from fetching")
    
    346
    -@click.option('--deps', '-d', default='plan',
    
    347
    -              type=click.Choice(['none', 'plan', 'all']),
    
    348
    -              help='The dependencies to fetch (default: plan)')
    
    349
    -@click.option('--track', 'track_', default=False, is_flag=True,
    
    350
    -              help="Track new source references before fetching")
    
    351
    -@click.option('--track-cross-junctions', '-J', default=False, is_flag=True,
    
    352
    -              help="Allow tracking to cross junction boundaries")
    
    353
    -@click.argument('elements', nargs=-1,
    
    354
    -                type=click.Path(readable=False))
    
    355
    -@click.pass_obj
    
    356
    -def fetch(app, elements, deps, track_, except_, track_cross_junctions):
    
    357
    -    """Fetch sources required to build the pipeline
    
    358
    -
    
    359
    -    By default this will only try to fetch sources which are
    
    360
    -    required for the build plan of the specified target element,
    
    361
    -    omitting sources for any elements which are already built
    
    362
    -    and available in the artifact cache.
    
    363
    -
    
    364
    -    Specify `--deps` to control which sources to fetch:
    
    365
    -
    
    366
    -    \b
    
    367
    -        none:  No dependencies, just the element itself
    
    368
    -        plan:  Only dependencies required for the build plan
    
    369
    -        all:   All dependencies
    
    370
    -    """
    
    371
    -    from .._pipeline import PipelineSelection
    
    372
    -
    
    373
    -    if track_cross_junctions and not track_:
    
    374
    -        click.echo("ERROR: The --track-cross-junctions option can only be used with --track", err=True)
    
    375
    -        sys.exit(-1)
    
    376
    -
    
    377
    -    if track_ and deps == PipelineSelection.PLAN:
    
    378
    -        click.echo("WARNING: --track specified for tracking of a build plan\n\n"
    
    379
    -                   "Since tracking modifies the build plan, all elements will be tracked.", err=True)
    
    380
    -        deps = PipelineSelection.ALL
    
    381
    -
    
    382
    -    with app.initialized(session_name="Fetch"):
    
    383
    -        app.stream.fetch(elements,
    
    384
    -                         selection=deps,
    
    385
    -                         except_targets=except_,
    
    386
    -                         track_targets=track_,
    
    387
    -                         track_cross_junctions=track_cross_junctions)
    
    388
    -
    
    389
    -
    
    390
    -##################################################################
    
    391
    -#                          Track Command                         #
    
    392
    -##################################################################
    
    393
    -@cli.command(short_help="Track new source references")
    
    394
    -@click.option('--except', 'except_', multiple=True,
    
    395
    -              type=click.Path(readable=False),
    
    396
    -              help="Except certain dependencies from tracking")
    
    397
    -@click.option('--deps', '-d', default='none',
    
    398
    -              type=click.Choice(['none', 'all']),
    
    399
    -              help='The dependencies to track (default: none)')
    
    400
    -@click.option('--cross-junctions', '-J', default=False, is_flag=True,
    
    401
    -              help="Allow crossing junction boundaries")
    
    402
    -@click.argument('elements', nargs=-1,
    
    403
    -                type=click.Path(readable=False))
    
    404
    -@click.pass_obj
    
    405
    -def track(app, elements, deps, except_, cross_junctions):
    
    406
    -    """Consults the specified tracking branches for new versions available
    
    407
    -    to build and updates the project with any newly available references.
    
    408
    -
    
    409
    -    By default this will track just the specified element, but you can also
    
    410
    -    update a whole tree of dependencies in one go.
    
    411
    -
    
    412
    -    Specify `--deps` to control which sources to track:
    
    413
    -
    
    414
    -    \b
    
    415
    -        none:  No dependencies, just the specified elements
    
    416
    -        all:   All dependencies of all specified elements
    
    417
    -    """
    
    418
    -    with app.initialized(session_name="Track"):
    
    419
    -        # Substitute 'none' for 'redirect' so that element redirections
    
    420
    -        # will be done
    
    421
    -        if deps == 'none':
    
    422
    -            deps = 'redirect'
    
    423
    -        app.stream.track(elements,
    
    424
    -                         selection=deps,
    
    425
    -                         except_targets=except_,
    
    426
    -                         cross_junctions=cross_junctions)
    
    427
    -
    
    428
    -
    
    429 340
     ##################################################################
    
    430 341
     #                           Pull Command                         #
    
    431 342
     ##################################################################
    
    ... ... @@ -680,10 +591,109 @@ def checkout(app, element, location, force, deps, integrate, hardlinks, tar):
    680 591
                                 tar=tar)
    
    681 592
     
    
    682 593
     
    
    594
    +##################################################################
    
    595
    +#                        Source Command                          #
    
    596
    +##################################################################
    
    597
    +@cli.group(short_help="Manipulate sources for an element")
    
    598
    +def source():
    
    599
    +    """Manipulate sources for an element"""
    
    600
    +    pass
    
    601
    +
    
    602
    +
    
    603
    +##################################################################
    
    604
    +#                     Source Fetch Command                       #
    
    605
    +##################################################################
    
    606
    +@source.command(name="fetch", short_help="Fetch sources in a pipeline")
    
    607
    +@click.option('--except', 'except_', multiple=True,
    
    608
    +              type=click.Path(readable=False),
    
    609
    +              help="Except certain dependencies from fetching")
    
    610
    +@click.option('--deps', '-d', default='plan',
    
    611
    +              type=click.Choice(['none', 'plan', 'all']),
    
    612
    +              help='The dependencies to fetch (default: plan)')
    
    613
    +@click.option('--track', 'track_', default=False, is_flag=True,
    
    614
    +              help="Track new source references before fetching")
    
    615
    +@click.option('--track-cross-junctions', '-J', default=False, is_flag=True,
    
    616
    +              help="Allow tracking to cross junction boundaries")
    
    617
    +@click.argument('elements', nargs=-1,
    
    618
    +                type=click.Path(readable=False))
    
    619
    +@click.pass_obj
    
    620
    +def source_fetch(app, elements, deps, track_, except_, track_cross_junctions):
    
    621
    +    """Fetch sources required to build the pipeline
    
    622
    +
    
    623
    +    By default this will only try to fetch sources which are
    
    624
    +    required for the build plan of the specified target element,
    
    625
    +    omitting sources for any elements which are already built
    
    626
    +    and available in the artifact cache.
    
    627
    +
    
    628
    +    Specify `--deps` to control which sources to fetch:
    
    629
    +
    
    630
    +    \b
    
    631
    +        none:  No dependencies, just the element itself
    
    632
    +        plan:  Only dependencies required for the build plan
    
    633
    +        all:   All dependencies
    
    634
    +    """
    
    635
    +    from .._pipeline import PipelineSelection
    
    636
    +
    
    637
    +    if track_cross_junctions and not track_:
    
    638
    +        click.echo("ERROR: The --track-cross-junctions option can only be used with --track", err=True)
    
    639
    +        sys.exit(-1)
    
    640
    +
    
    641
    +    if track_ and deps == PipelineSelection.PLAN:
    
    642
    +        click.echo("WARNING: --track specified for tracking of a build plan\n\n"
    
    643
    +                   "Since tracking modifies the build plan, all elements will be tracked.", err=True)
    
    644
    +        deps = PipelineSelection.ALL
    
    645
    +
    
    646
    +    with app.initialized(session_name="Fetch"):
    
    647
    +        app.stream.fetch(elements,
    
    648
    +                         selection=deps,
    
    649
    +                         except_targets=except_,
    
    650
    +                         track_targets=track_,
    
    651
    +                         track_cross_junctions=track_cross_junctions)
    
    652
    +
    
    653
    +
    
    654
    +##################################################################
    
    655
    +#                     Source Track Command                       #
    
    656
    +##################################################################
    
    657
    +@source.command(name="track", short_help="Track new source references")
    
    658
    +@click.option('--except', 'except_', multiple=True,
    
    659
    +              type=click.Path(readable=False),
    
    660
    +              help="Except certain dependencies from tracking")
    
    661
    +@click.option('--deps', '-d', default='none',
    
    662
    +              type=click.Choice(['none', 'all']),
    
    663
    +              help='The dependencies to track (default: none)')
    
    664
    +@click.option('--cross-junctions', '-J', default=False, is_flag=True,
    
    665
    +              help="Allow crossing junction boundaries")
    
    666
    +@click.argument('elements', nargs=-1,
    
    667
    +                type=click.Path(readable=False))
    
    668
    +@click.pass_obj
    
    669
    +def source_track(app, elements, deps, except_, cross_junctions):
    
    670
    +    """Consults the specified tracking branches for new versions available
    
    671
    +    to build and updates the project with any newly available references.
    
    672
    +
    
    673
    +    By default this will track just the specified element, but you can also
    
    674
    +    update a whole tree of dependencies in one go.
    
    675
    +
    
    676
    +    Specify `--deps` to control which sources to track:
    
    677
    +
    
    678
    +    \b
    
    679
    +        none:  No dependencies, just the specified elements
    
    680
    +        all:   All dependencies of all specified elements
    
    681
    +    """
    
    682
    +    with app.initialized(session_name="Track"):
    
    683
    +        # Substitute 'none' for 'redirect' so that element redirections
    
    684
    +        # will be done
    
    685
    +        if deps == 'none':
    
    686
    +            deps = 'redirect'
    
    687
    +        app.stream.track(elements,
    
    688
    +                         selection=deps,
    
    689
    +                         except_targets=except_,
    
    690
    +                         cross_junctions=cross_junctions)
    
    691
    +
    
    692
    +
    
    683 693
     ##################################################################
    
    684 694
     #                  Source Checkout Command                      #
    
    685 695
     ##################################################################
    
    686
    -@cli.command(name='source-checkout', short_help='Checkout sources for an element')
    
    696
    +@source.command(name='checkout', short_help='Checkout sources for an element')
    
    687 697
     @click.option('--except', 'except_', multiple=True,
    
    688 698
                   type=click.Path(readable=False),
    
    689 699
                   help="Except certain dependencies")
    
    ... ... @@ -866,3 +876,54 @@ def source_bundle(app, element, force, directory,
    866 876
                                      force=force,
    
    867 877
                                      compression=compression,
    
    868 878
                                      except_targets=except_)
    
    879
    +
    
    880
    +
    
    881
    +##################################################################
    
    882
    +#                      DEPRECATED Commands                       #
    
    883
    +##################################################################
    
    884
    +
    
    885
    +# XXX: The following commands are now obsolete, but they are kept
    
    886
    +# here along with all the options so that we can provide nice error
    
    887
    +# messages when they are called.
    
    888
    +# Also, note that these commands are hidden from the top-level help.
    
    889
    +
    
    890
    +##################################################################
    
    891
    +#                          Fetch Command                         #
    
    892
    +##################################################################
    
    893
    +@cli.command(short_help="Fetch sources in a pipeline", hidden=True)
    
    894
    +@click.option('--except', 'except_', multiple=True,
    
    895
    +              type=click.Path(readable=False),
    
    896
    +              help="Except certain dependencies from fetching")
    
    897
    +@click.option('--deps', '-d', default='plan',
    
    898
    +              type=click.Choice(['none', 'plan', 'all']),
    
    899
    +              help='The dependencies to fetch (default: plan)')
    
    900
    +@click.option('--track', 'track_', default=False, is_flag=True,
    
    901
    +              help="Track new source references before fetching")
    
    902
    +@click.option('--track-cross-junctions', '-J', default=False, is_flag=True,
    
    903
    +              help="Allow tracking to cross junction boundaries")
    
    904
    +@click.argument('elements', nargs=-1,
    
    905
    +                type=click.Path(readable=False))
    
    906
    +@click.pass_obj
    
    907
    +def fetch(app, elements, deps, track_, except_, track_cross_junctions):
    
    908
    +    click.echo("This command is now obsolete. Use `bst source fetch` instead.", err=True)
    
    909
    +    sys.exit(1)
    
    910
    +
    
    911
    +
    
    912
    +##################################################################
    
    913
    +#                          Track Command                         #
    
    914
    +##################################################################
    
    915
    +@cli.command(short_help="Track new source references", hidden=True)
    
    916
    +@click.option('--except', 'except_', multiple=True,
    
    917
    +              type=click.Path(readable=False),
    
    918
    +              help="Except certain dependencies from tracking")
    
    919
    +@click.option('--deps', '-d', default='none',
    
    920
    +              type=click.Choice(['none', 'all']),
    
    921
    +              help='The dependencies to track (default: none)')
    
    922
    +@click.option('--cross-junctions', '-J', default=False, is_flag=True,
    
    923
    +              help="Allow crossing junction boundaries")
    
    924
    +@click.argument('elements', nargs=-1,
    
    925
    +                type=click.Path(readable=False))
    
    926
    +@click.pass_obj
    
    927
    +def track(app, elements, deps, except_, cross_junctions):
    
    928
    +    click.echo("This command is now obsolete. Use `bst source track` instead.", err=True)
    
    929
    +    sys.exit(1)

  • buildstream/_frontend/complete.py
    ... ... @@ -297,12 +297,15 @@ def get_choices(cli, prog_name, args, incomplete, override):
    297 297
     
    
    298 298
         if not found_param and isinstance(ctx.command, MultiCommand):
    
    299 299
             # completion for any subcommands
    
    300
    -        choices.extend([cmd + " " for cmd in ctx.command.list_commands(ctx)])
    
    300
    +        choices.extend([cmd + " " for cmd in ctx.command.list_commands(ctx)
    
    301
    +                        if not ctx.command.get_command(ctx, cmd).hidden])
    
    301 302
     
    
    302 303
         if not start_of_option(incomplete) and ctx.parent is not None \
    
    303 304
            and isinstance(ctx.parent.command, MultiCommand) and ctx.parent.command.chain:
    
    304 305
             # completion for chained commands
    
    305
    -        remaining_comands = set(ctx.parent.command.list_commands(ctx.parent)) - set(ctx.parent.protected_args)
    
    306
    +        visible_commands = [cmd for cmd in ctx.parent.command.list_commands(ctx.parent)
    
    307
    +                            if not ctx.parent.command.get_command(ctx.parent, cmd).hidden]
    
    308
    +        remaining_comands = set(visible_commands) - set(ctx.parent.protected_args)
    
    306 309
             choices.extend([cmd + " " for cmd in remaining_comands])
    
    307 310
     
    
    308 311
         for item in choices:
    

  • setup.py
    ... ... @@ -346,7 +346,7 @@ setup(name='BuildStream',
    346 346
               # See issues #571 and #790.
    
    347 347
               'ruamel.yaml >= 0.15.41, < 0.15.52',
    
    348 348
               'pluginbase',
    
    349
    -          'Click',
    
    349
    +          'Click >= 7.0',
    
    350 350
               'jinja2 >= 2.10',
    
    351 351
               'protobuf >= 3.5',
    
    352 352
               'grpcio >= 1.10',
    

  • tests/completions/completions.py
    ... ... @@ -8,16 +8,14 @@ DATA_DIR = os.path.dirname(os.path.realpath(__file__))
    8 8
     MAIN_COMMANDS = [
    
    9 9
         'build ',
    
    10 10
         'checkout ',
    
    11
    -    'fetch ',
    
    12 11
         'help ',
    
    13 12
         'init ',
    
    14 13
         'pull ',
    
    15 14
         'push ',
    
    16 15
         'shell ',
    
    17 16
         'show ',
    
    18
    -    'source-checkout ',
    
    17
    +    'source ',
    
    19 18
         'source-bundle ',
    
    20
    -    'track ',
    
    21 19
         'workspace '
    
    22 20
     ]
    
    23 21
     
    
    ... ... @@ -50,6 +48,12 @@ MAIN_OPTIONS = [
    50 48
         "--version ",
    
    51 49
     ]
    
    52 50
     
    
    51
    +SOURCE_COMMANDS = [
    
    52
    +    'checkout ',
    
    53
    +    'fetch ',
    
    54
    +    'track ',
    
    55
    +]
    
    56
    +
    
    53 57
     WORKSPACE_COMMANDS = [
    
    54 58
         'close ',
    
    55 59
         'list ',
    
    ... ... @@ -115,6 +119,7 @@ def assert_completion_failed(cli, cmd, word_idx, expected, cwd=None):
    115 119
         ('bst ', 1, MAIN_COMMANDS),
    
    116 120
         ('bst pu', 1, ['pull ', 'push ']),
    
    117 121
         ('bst pul', 1, ['pull ']),
    
    122
    +    ('bst source ', 2, SOURCE_COMMANDS),
    
    118 123
         ('bst w ', 1, ['workspace ']),
    
    119 124
         ('bst workspace ', 2, WORKSPACE_COMMANDS),
    
    120 125
     ])
    
    ... ... @@ -267,9 +272,10 @@ def test_argument_element_invalid(datafiles, cli, project, cmd, word_idx, expect
    267 272
     @pytest.mark.parametrize("cmd,word_idx,expected", [
    
    268 273
         ('bst he', 1, ['help ']),
    
    269 274
         ('bst help ', 2, MAIN_COMMANDS),
    
    270
    -    ('bst help fe', 2, ['fetch ']),
    
    275
    +    ('bst help in', 2, ['init ']),
    
    271 276
         ('bst help p', 2, ['pull ', 'push ']),
    
    272 277
         ('bst help p', 2, ['pull ', 'push ']),
    
    278
    +    ('bst help source ', 3, SOURCE_COMMANDS),
    
    273 279
         ('bst help w', 2, ['workspace ']),
    
    274 280
         ('bst help workspace ', 3, WORKSPACE_COMMANDS),
    
    275 281
     ])
    

  • tests/frontend/cross_junction_workspace.py
    ... ... @@ -35,7 +35,7 @@ def prepare_junction_project(cli, tmpdir):
    35 35
                     'sources': [sub_repo.source_config(ref=sub_ref)]},
    
    36 36
                    str(main_project.join("sub.bst")))
    
    37 37
     
    
    38
    -    args = ['fetch', 'sub.bst']
    
    38
    +    args = ['source', 'fetch', 'sub.bst']
    
    39 39
         result = cli.run(project=str(main_project), args=args)
    
    40 40
         result.assert_success()
    
    41 41
     
    

  • tests/frontend/fetch.py
    ... ... @@ -41,7 +41,7 @@ def test_fetch(cli, tmpdir, datafiles, kind):
    41 41
         assert cli.get_element_state(project, element_name) == 'fetch needed'
    
    42 42
     
    
    43 43
         # Now try to fetch it
    
    44
    -    result = cli.run(project=project, args=['fetch', element_name])
    
    44
    +    result = cli.run(project=project, args=['source', 'fetch', element_name])
    
    45 45
         result.assert_success()
    
    46 46
     
    
    47 47
         # Assert that we are now buildable because the source is
    
    ... ... @@ -55,7 +55,7 @@ def test_fetch_consistency_error(cli, tmpdir, datafiles):
    55 55
     
    
    56 56
         # When the error occurs outside of the scheduler at load time,
    
    57 57
         # then the SourceError is reported directly as the main error.
    
    58
    -    result = cli.run(project=project, args=['fetch', 'error.bst'])
    
    58
    +    result = cli.run(project=project, args=['source', 'fetch', 'error.bst'])
    
    59 59
         result.assert_main_error(ErrorDomain.SOURCE, 'the-consistency-error')
    
    60 60
     
    
    61 61
     
    
    ... ... @@ -70,7 +70,7 @@ def test_fetch_consistency_bug(cli, tmpdir, datafiles):
    70 70
         #    for a fetch command, we could report this to the user
    
    71 71
         #    more gracefully as a BUG message.
    
    72 72
         #
    
    73
    -    result = cli.run(project=project, args=['fetch', 'bug.bst'])
    
    73
    +    result = cli.run(project=project, args=['source', 'fetch', 'bug.bst'])
    
    74 74
         assert result.exc is not None
    
    75 75
         assert str(result.exc) == "Something went terribly wrong"
    
    76 76
     
    
    ... ... @@ -121,7 +121,7 @@ def test_unfetched_junction(cli, tmpdir, datafiles, ref_storage):
    121 121
     
    
    122 122
         # Now try to fetch it, this should automatically result in fetching
    
    123 123
         # the junction itself.
    
    124
    -    result = cli.run(project=project, args=['fetch', 'junction-dep.bst'])
    
    124
    +    result = cli.run(project=project, args=['source', 'fetch', 'junction-dep.bst'])
    
    125 125
         result.assert_success()
    
    126 126
     
    
    127 127
     
    
    ... ... @@ -155,7 +155,7 @@ def test_inconsistent_junction(cli, tmpdir, datafiles, ref_storage):
    155 155
     
    
    156 156
         # Now try to fetch it, this will bail with the appropriate error
    
    157 157
         # informing the user to track the junction first
    
    158
    -    result = cli.run(project=project, args=['fetch', 'junction-dep.bst'])
    
    158
    +    result = cli.run(project=project, args=['source', 'fetch', 'junction-dep.bst'])
    
    159 159
         result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.SUBPROJECT_INCONSISTENT)
    
    160 160
     
    
    161 161
     
    
    ... ... @@ -188,10 +188,10 @@ def test_fetch_cross_junction(cli, tmpdir, datafiles, ref_storage, kind):
    188 188
         generate_junction(tmpdir, subproject_path, junction_path, store_ref=(ref_storage == 'inline'))
    
    189 189
     
    
    190 190
         if ref_storage == 'project.refs':
    
    191
    -        result = cli.run(project=project, args=['track', 'junction.bst'])
    
    191
    +        result = cli.run(project=project, args=['source', 'track', 'junction.bst'])
    
    192 192
             result.assert_success()
    
    193
    -        result = cli.run(project=project, args=['track', 'junction.bst:import-etc.bst'])
    
    193
    +        result = cli.run(project=project, args=['source', 'track', 'junction.bst:import-etc.bst'])
    
    194 194
             result.assert_success()
    
    195 195
     
    
    196
    -    result = cli.run(project=project, args=['fetch', 'junction.bst:import-etc.bst'])
    
    196
    +    result = cli.run(project=project, args=['source', 'fetch', 'junction.bst:import-etc.bst'])
    
    197 197
         result.assert_success()

  • tests/frontend/help.py
    ... ... @@ -20,13 +20,12 @@ def test_help_main(cli):
    20 20
     @pytest.mark.parametrize("command", [
    
    21 21
         ('build'),
    
    22 22
         ('checkout'),
    
    23
    -    ('fetch'),
    
    24 23
         ('pull'),
    
    25 24
         ('push'),
    
    26 25
         ('shell'),
    
    27 26
         ('show'),
    
    27
    +    ('source'),
    
    28 28
         ('source-bundle'),
    
    29
    -    ('track'),
    
    30 29
         ('workspace')
    
    31 30
     ])
    
    32 31
     def test_help(cli, command):
    

  • tests/frontend/logging.py
    ... ... @@ -38,7 +38,7 @@ def test_default_logging(cli, tmpdir, datafiles):
    38 38
                                 element_name))
    
    39 39
     
    
    40 40
         # Now try to fetch it
    
    41
    -    result = cli.run(project=project, args=['fetch', element_name])
    
    41
    +    result = cli.run(project=project, args=['source', 'fetch', element_name])
    
    42 42
         result.assert_success()
    
    43 43
     
    
    44 44
         m = re.search("\[\d\d:\d\d:\d\d\]\[\]\[\] SUCCESS Checking sources", result.stderr)
    
    ... ... @@ -74,7 +74,7 @@ def test_custom_logging(cli, tmpdir, datafiles):
    74 74
                                 element_name))
    
    75 75
     
    
    76 76
         # Now try to fetch it
    
    77
    -    result = cli.run(project=project, args=['fetch', element_name])
    
    77
    +    result = cli.run(project=project, args=['source', 'fetch', element_name])
    
    78 78
         result.assert_success()
    
    79 79
     
    
    80 80
         m = re.search("\d\d:\d\d:\d\d,\d\d:\d\d:\d\d.\d{6},\d\d:\d\d:\d\d,,,SUCCESS,Checking sources", result.stderr)
    

  • tests/frontend/mirror.py
    ... ... @@ -135,7 +135,7 @@ def test_mirror_fetch(cli, tmpdir, datafiles, kind):
    135 135
     
    
    136 136
         # No obvious ways of checking that the mirror has been fetched
    
    137 137
         # But at least we can be sure it succeeds
    
    138
    -    result = cli.run(project=project_dir, args=['fetch', element_name])
    
    138
    +    result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
    
    139 139
         result.assert_success()
    
    140 140
     
    
    141 141
     
    
    ... ... @@ -211,7 +211,7 @@ def test_mirror_fetch_ref_storage(cli, tmpdir, datafiles, ref_storage, mirror):
    211 211
         project_file = os.path.join(project_dir, 'project.conf')
    
    212 212
         _yaml.dump(project, project_file)
    
    213 213
     
    
    214
    -    result = cli.run(project=project_dir, args=['fetch', element_name])
    
    214
    +    result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
    
    215 215
         result.assert_success()
    
    216 216
     
    
    217 217
     
    
    ... ... @@ -268,7 +268,7 @@ def test_mirror_fetch_upstream_absent(cli, tmpdir, datafiles, kind):
    268 268
         project_file = os.path.join(project_dir, 'project.conf')
    
    269 269
         _yaml.dump(project, project_file)
    
    270 270
     
    
    271
    -    result = cli.run(project=project_dir, args=['fetch', element_name])
    
    271
    +    result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
    
    272 272
         result.assert_success()
    
    273 273
     
    
    274 274
     
    
    ... ... @@ -287,7 +287,7 @@ def test_mirror_fetch_multi(cli, tmpdir, datafiles):
    287 287
         project = generate_project()
    
    288 288
         _yaml.dump(project, project_file)
    
    289 289
     
    
    290
    -    result = cli.run(project=project_dir, args=['fetch', element_name])
    
    290
    +    result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
    
    291 291
         result.assert_success()
    
    292 292
         with open(output_file) as f:
    
    293 293
             contents = f.read()
    
    ... ... @@ -310,7 +310,7 @@ def test_mirror_fetch_default_cmdline(cli, tmpdir, datafiles):
    310 310
         project = generate_project()
    
    311 311
         _yaml.dump(project, project_file)
    
    312 312
     
    
    313
    -    result = cli.run(project=project_dir, args=['--default-mirror', 'arrakis', 'fetch', element_name])
    
    313
    +    result = cli.run(project=project_dir, args=['--default-mirror', 'arrakis', 'source', 'fetch', element_name])
    
    314 314
         result.assert_success()
    
    315 315
         with open(output_file) as f:
    
    316 316
             contents = f.read()
    
    ... ... @@ -349,7 +349,7 @@ def test_mirror_fetch_default_userconfig(cli, tmpdir, datafiles):
    349 349
         }
    
    350 350
         cli.configure(userconfig)
    
    351 351
     
    
    352
    -    result = cli.run(project=project_dir, args=['fetch', element_name])
    
    352
    +    result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
    
    353 353
         result.assert_success()
    
    354 354
         with open(output_file) as f:
    
    355 355
             contents = f.read()
    
    ... ... @@ -388,7 +388,7 @@ def test_mirror_fetch_default_cmdline_overrides_config(cli, tmpdir, datafiles):
    388 388
         }
    
    389 389
         cli.configure(userconfig)
    
    390 390
     
    
    391
    -    result = cli.run(project=project_dir, args=['--default-mirror', 'arrakis', 'fetch', element_name])
    
    391
    +    result = cli.run(project=project_dir, args=['--default-mirror', 'arrakis', 'source', 'fetch', element_name])
    
    392 392
         result.assert_success()
    
    393 393
         with open(output_file) as f:
    
    394 394
             contents = f.read()
    
    ... ... @@ -459,7 +459,7 @@ def test_mirror_track_upstream_present(cli, tmpdir, datafiles, kind):
    459 459
         project_file = os.path.join(project_dir, 'project.conf')
    
    460 460
         _yaml.dump(project, project_file)
    
    461 461
     
    
    462
    -    result = cli.run(project=project_dir, args=['track', element_name])
    
    462
    +    result = cli.run(project=project_dir, args=['source', 'track', element_name])
    
    463 463
         result.assert_success()
    
    464 464
     
    
    465 465
         # Tracking tries upstream first. Check the ref is from upstream.
    
    ... ... @@ -525,7 +525,7 @@ def test_mirror_track_upstream_absent(cli, tmpdir, datafiles, kind):
    525 525
         project_file = os.path.join(project_dir, 'project.conf')
    
    526 526
         _yaml.dump(project, project_file)
    
    527 527
     
    
    528
    -    result = cli.run(project=project_dir, args=['track', element_name])
    
    528
    +    result = cli.run(project=project_dir, args=['source', 'track', element_name])
    
    529 529
         result.assert_success()
    
    530 530
     
    
    531 531
         # Check that tracking fell back to the mirror
    
    ... ... @@ -604,7 +604,7 @@ def test_mirror_from_includes(cli, tmpdir, datafiles, kind):
    604 604
     
    
    605 605
         # Now make the upstream unavailable.
    
    606 606
         os.rename(upstream_repo.repo, '{}.bak'.format(upstream_repo.repo))
    
    607
    -    result = cli.run(project=project_dir, args=['fetch', element_name])
    
    607
    +    result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
    
    608 608
         result.assert_success()
    
    609 609
     
    
    610 610
     
    
    ... ... @@ -678,11 +678,11 @@ def test_mirror_junction_from_includes(cli, tmpdir, datafiles, kind):
    678 678
     
    
    679 679
         # Now make the upstream unavailable.
    
    680 680
         os.rename(upstream_repo.repo, '{}.bak'.format(upstream_repo.repo))
    
    681
    -    result = cli.run(project=project_dir, args=['fetch', element_name])
    
    681
    +    result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
    
    682 682
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    683 683
         # Now make the upstream available again.
    
    684 684
         os.rename('{}.bak'.format(upstream_repo.repo), upstream_repo.repo)
    
    685
    -    result = cli.run(project=project_dir, args=['fetch', element_name])
    
    685
    +    result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
    
    686 686
         result.assert_success()
    
    687 687
     
    
    688 688
     
    
    ... ... @@ -762,7 +762,7 @@ def test_mirror_git_submodule_fetch(cli, tmpdir, datafiles):
    762 762
         project_file = os.path.join(project_dir, 'project.conf')
    
    763 763
         _yaml.dump(project, project_file)
    
    764 764
     
    
    765
    -    result = cli.run(project=project_dir, args=['fetch', element_name])
    
    765
    +    result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
    
    766 766
         result.assert_success()
    
    767 767
     
    
    768 768
     
    
    ... ... @@ -849,7 +849,7 @@ def test_mirror_fallback_git_only_submodules(cli, tmpdir, datafiles):
    849 849
     
    
    850 850
         # Now make the upstream unavailable.
    
    851 851
         os.rename(upstream_bin_repo.repo, '{}.bak'.format(upstream_bin_repo.repo))
    
    852
    -    result = cli.run(project=project_dir, args=['fetch', element_name])
    
    852
    +    result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
    
    853 853
         result.assert_success()
    
    854 854
     
    
    855 855
         result = cli.run(project=project_dir, args=['build', element_name])
    
    ... ... @@ -945,7 +945,7 @@ def test_mirror_fallback_git_with_submodules(cli, tmpdir, datafiles):
    945 945
     
    
    946 946
         # Now make the upstream unavailable.
    
    947 947
         os.rename(upstream_main_repo.repo, '{}.bak'.format(upstream_main_repo.repo))
    
    948
    -    result = cli.run(project=project_dir, args=['fetch', element_name])
    
    948
    +    result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
    
    949 949
         result.assert_success()
    
    950 950
     
    
    951 951
         result = cli.run(project=project_dir, args=['build', element_name])
    

  • tests/frontend/show.py
    ... ... @@ -236,7 +236,7 @@ def test_fetched_junction(cli, tmpdir, datafiles, element_name):
    236 236
         _yaml.dump(element, element_path)
    
    237 237
     
    
    238 238
         result = cli.run(project=project, silent=True, args=[
    
    239
    -        'fetch', 'junction.bst'])
    
    239
    +        'source', 'fetch', 'junction.bst'])
    
    240 240
     
    
    241 241
         result.assert_success()
    
    242 242
     
    

  • tests/frontend/source_checkout.py
    ... ... @@ -40,7 +40,7 @@ def test_source_checkout(datafiles, tmpdir_factory, cli, with_workspace):
    40 40
             result = cli.run(project=project, args=['workspace', 'open', '--directory', workspace, target])
    
    41 41
             result.assert_success()
    
    42 42
     
    
    43
    -    result = cli.run(project=project, args=['source-checkout', target, '--deps', 'none', checkout])
    
    43
    +    result = cli.run(project=project, args=['source', 'checkout', target, '--deps', 'none', checkout])
    
    44 44
         result.assert_success()
    
    45 45
     
    
    46 46
         assert os.path.exists(os.path.join(checkout, 'checkout-deps', 'etc', 'buildstream', 'config'))
    
    ... ... @@ -53,7 +53,7 @@ def test_source_checkout_deps(datafiles, cli, deps):
    53 53
         checkout = os.path.join(cli.directory, 'source-checkout')
    
    54 54
         target = 'checkout-deps.bst'
    
    55 55
     
    
    56
    -    result = cli.run(project=project, args=['source-checkout', target, '--deps', deps, checkout])
    
    56
    +    result = cli.run(project=project, args=['source', 'checkout', target, '--deps', deps, checkout])
    
    57 57
         result.assert_success()
    
    58 58
     
    
    59 59
         # Sources of the target
    
    ... ... @@ -81,7 +81,7 @@ def test_source_checkout_except(datafiles, cli):
    81 81
         checkout = os.path.join(cli.directory, 'source-checkout')
    
    82 82
         target = 'checkout-deps.bst'
    
    83 83
     
    
    84
    -    result = cli.run(project=project, args=['source-checkout', target,
    
    84
    +    result = cli.run(project=project, args=['source', 'checkout', target,
    
    85 85
                                                 '--deps', 'all',
    
    86 86
                                                 '--except', 'import-bin.bst',
    
    87 87
                                                 checkout])
    
    ... ... @@ -115,7 +115,7 @@ def test_source_checkout_fetch(datafiles, cli, fetch):
    115 115
         # cached already
    
    116 116
         assert cli.get_element_state(project, target) == 'fetch needed'
    
    117 117
     
    
    118
    -    args = ['source-checkout']
    
    118
    +    args = ['source', 'checkout']
    
    119 119
         if fetch:
    
    120 120
             args += ['--fetch']
    
    121 121
         args += [target, checkout]
    

  • tests/frontend/track.py
    ... ... @@ -52,14 +52,14 @@ def test_track(cli, tmpdir, datafiles, ref_storage, kind):
    52 52
         assert cli.get_element_state(project, element_name) == 'no reference'
    
    53 53
     
    
    54 54
         # Now first try to track it
    
    55
    -    result = cli.run(project=project, args=['track', element_name])
    
    55
    +    result = cli.run(project=project, args=['source', 'track', element_name])
    
    56 56
         result.assert_success()
    
    57 57
     
    
    58 58
         # And now fetch it: The Source has probably already cached the
    
    59 59
         # latest ref locally, but it is not required to have cached
    
    60 60
         # the associated content of the latest ref at track time, that
    
    61 61
         # is the job of fetch.
    
    62
    -    result = cli.run(project=project, args=['fetch', element_name])
    
    62
    +    result = cli.run(project=project, args=['source', 'fetch', element_name])
    
    63 63
         result.assert_success()
    
    64 64
     
    
    65 65
         # Assert that we are now buildable because the source is
    
    ... ... @@ -99,7 +99,7 @@ def test_track_recurse(cli, tmpdir, datafiles, kind):
    99 99
     
    
    100 100
         # Now first try to track it
    
    101 101
         result = cli.run(project=project, args=[
    
    102
    -        'track', '--deps', 'all',
    
    102
    +        'source', 'track', '--deps', 'all',
    
    103 103
             element_target_name])
    
    104 104
         result.assert_success()
    
    105 105
     
    
    ... ... @@ -108,7 +108,7 @@ def test_track_recurse(cli, tmpdir, datafiles, kind):
    108 108
         # the associated content of the latest ref at track time, that
    
    109 109
         # is the job of fetch.
    
    110 110
         result = cli.run(project=project, args=[
    
    111
    -        'fetch', '--deps', 'all',
    
    111
    +        'source', 'fetch', '--deps', 'all',
    
    112 112
             element_target_name])
    
    113 113
         result.assert_success()
    
    114 114
     
    
    ... ... @@ -142,13 +142,13 @@ def test_track_single(cli, tmpdir, datafiles):
    142 142
     
    
    143 143
         # Now first try to track only one element
    
    144 144
         result = cli.run(project=project, args=[
    
    145
    -        'track', '--deps', 'none',
    
    145
    +        'source', 'track', '--deps', 'none',
    
    146 146
             element_target_name])
    
    147 147
         result.assert_success()
    
    148 148
     
    
    149 149
         # And now fetch it
    
    150 150
         result = cli.run(project=project, args=[
    
    151
    -        'fetch', '--deps', 'none',
    
    151
    +        'source', 'fetch', '--deps', 'none',
    
    152 152
             element_target_name])
    
    153 153
         result.assert_success()
    
    154 154
     
    
    ... ... @@ -183,7 +183,7 @@ def test_track_recurse_except(cli, tmpdir, datafiles, kind):
    183 183
     
    
    184 184
         # Now first try to track it
    
    185 185
         result = cli.run(project=project, args=[
    
    186
    -        'track', '--deps', 'all', '--except', element_dep_name,
    
    186
    +        'source', 'track', '--deps', 'all', '--except', element_dep_name,
    
    187 187
             element_target_name])
    
    188 188
         result.assert_success()
    
    189 189
     
    
    ... ... @@ -192,7 +192,7 @@ def test_track_recurse_except(cli, tmpdir, datafiles, kind):
    192 192
         # the associated content of the latest ref at track time, that
    
    193 193
         # is the job of fetch.
    
    194 194
         result = cli.run(project=project, args=[
    
    195
    -        'fetch', '--deps', 'none',
    
    195
    +        'source', 'fetch', '--deps', 'none',
    
    196 196
             element_target_name])
    
    197 197
         result.assert_success()
    
    198 198
     
    
    ... ... @@ -231,9 +231,9 @@ def test_track_optional(cli, tmpdir, datafiles, ref_storage):
    231 231
         #
    
    232 232
         # We want to track and persist the ref separately in this test
    
    233 233
         #
    
    234
    -    result = cli.run(project=project, args=['--option', 'test', 'False', 'track', 'target.bst'])
    
    234
    +    result = cli.run(project=project, args=['--option', 'test', 'False', 'source', 'track', 'target.bst'])
    
    235 235
         result.assert_success()
    
    236
    -    result = cli.run(project=project, args=['--option', 'test', 'True', 'track', 'target.bst'])
    
    236
    +    result = cli.run(project=project, args=['--option', 'test', 'True', 'source', 'track', 'target.bst'])
    
    237 237
         result.assert_success()
    
    238 238
     
    
    239 239
         # Now fetch the key for both options
    
    ... ... @@ -309,7 +309,7 @@ def test_track_cross_junction(cli, tmpdir, datafiles, cross_junction, ref_storag
    309 309
         assert get_subproject_element_state() == 'no reference'
    
    310 310
     
    
    311 311
         # Track recursively across the junction
    
    312
    -    args = ['track', '--deps', 'all']
    
    312
    +    args = ['source', 'track', '--deps', 'all']
    
    313 313
         if cross_junction == 'cross':
    
    314 314
             args += ['--cross-junctions']
    
    315 315
         args += ['target.bst']
    
    ... ... @@ -350,7 +350,7 @@ def test_track_consistency_error(cli, tmpdir, datafiles):
    350 350
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    351 351
     
    
    352 352
         # Track the element causing a consistency error
    
    353
    -    result = cli.run(project=project, args=['track', 'error.bst'])
    
    353
    +    result = cli.run(project=project, args=['source', 'track', 'error.bst'])
    
    354 354
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    355 355
         result.assert_task_error(ErrorDomain.SOURCE, 'the-consistency-error')
    
    356 356
     
    
    ... ... @@ -360,7 +360,7 @@ def test_track_consistency_bug(cli, tmpdir, datafiles):
    360 360
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    361 361
     
    
    362 362
         # Track the element causing an unhandled exception
    
    363
    -    result = cli.run(project=project, args=['track', 'bug.bst'])
    
    363
    +    result = cli.run(project=project, args=['source', 'track', 'bug.bst'])
    
    364 364
     
    
    365 365
         # We expect BuildStream to fail gracefully, with no recorded exception.
    
    366 366
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    ... ... @@ -396,7 +396,7 @@ def test_inconsistent_junction(cli, tmpdir, datafiles, ref_storage):
    396 396
     
    
    397 397
         # Now try to track it, this will bail with the appropriate error
    
    398 398
         # informing the user to track the junction first
    
    399
    -    result = cli.run(project=project, args=['track', 'junction-dep.bst'])
    
    399
    +    result = cli.run(project=project, args=['source', 'track', 'junction-dep.bst'])
    
    400 400
         result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.SUBPROJECT_INCONSISTENT)
    
    401 401
     
    
    402 402
     
    
    ... ... @@ -433,7 +433,7 @@ def test_junction_element(cli, tmpdir, datafiles, ref_storage):
    433 433
         result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.SUBPROJECT_INCONSISTENT)
    
    434 434
     
    
    435 435
         # Now track the junction itself
    
    436
    -    result = cli.run(project=project, args=['track', 'junction.bst'])
    
    436
    +    result = cli.run(project=project, args=['source', 'track', 'junction.bst'])
    
    437 437
         result.assert_success()
    
    438 438
     
    
    439 439
         # Now assert element state (via bst show under the hood) of the dep again
    
    ... ... @@ -464,13 +464,13 @@ def test_cross_junction(cli, tmpdir, datafiles, ref_storage, kind):
    464 464
                           subproject_path, junction_path, store_ref=False)
    
    465 465
     
    
    466 466
         # Track the junction itself first.
    
    467
    -    result = cli.run(project=project, args=['track', 'junction.bst'])
    
    467
    +    result = cli.run(project=project, args=['source', 'track', 'junction.bst'])
    
    468 468
         result.assert_success()
    
    469 469
     
    
    470 470
         assert cli.get_element_state(project, 'junction.bst:import-etc-repo.bst') == 'no reference'
    
    471 471
     
    
    472 472
         # Track the cross junction element. -J is not given, it is implied.
    
    473
    -    result = cli.run(project=project, args=['track', 'junction.bst:import-etc-repo.bst'])
    
    473
    +    result = cli.run(project=project, args=['source', 'track', 'junction.bst:import-etc-repo.bst'])
    
    474 474
     
    
    475 475
         if ref_storage == 'inline':
    
    476 476
             # This is not allowed to track cross junction without project.refs.
    
    ... ... @@ -520,14 +520,14 @@ def test_track_include(cli, tmpdir, datafiles, ref_storage, kind):
    520 520
         assert cli.get_element_state(project, element_name) == 'no reference'
    
    521 521
     
    
    522 522
         # Now first try to track it
    
    523
    -    result = cli.run(project=project, args=['track', element_name])
    
    523
    +    result = cli.run(project=project, args=['source', 'track', element_name])
    
    524 524
         result.assert_success()
    
    525 525
     
    
    526 526
         # And now fetch it: The Source has probably already cached the
    
    527 527
         # latest ref locally, but it is not required to have cached
    
    528 528
         # the associated content of the latest ref at track time, that
    
    529 529
         # is the job of fetch.
    
    530
    -    result = cli.run(project=project, args=['fetch', element_name])
    
    530
    +    result = cli.run(project=project, args=['source', 'fetch', element_name])
    
    531 531
         result.assert_success()
    
    532 532
     
    
    533 533
         # Assert that we are now buildable because the source is
    
    ... ... @@ -585,14 +585,14 @@ def test_track_include_junction(cli, tmpdir, datafiles, ref_storage, kind):
    585 585
         generate_junction(str(tmpdir.join('junction_repo')),
    
    586 586
                           subproject_path, junction_path, store_ref=True)
    
    587 587
     
    
    588
    -    result = cli.run(project=project, args=['track', 'junction.bst'])
    
    588
    +    result = cli.run(project=project, args=['source', 'track', 'junction.bst'])
    
    589 589
         result.assert_success()
    
    590 590
     
    
    591 591
         # Assert that a fetch is needed
    
    592 592
         assert cli.get_element_state(project, element_name) == 'no reference'
    
    593 593
     
    
    594 594
         # Now first try to track it
    
    595
    -    result = cli.run(project=project, args=['track', element_name])
    
    595
    +    result = cli.run(project=project, args=['source', 'track', element_name])
    
    596 596
     
    
    597 597
         # Assert there was a project.refs created, depending on the configuration
    
    598 598
         if ref_storage == 'inline':
    
    ... ... @@ -607,7 +607,7 @@ def test_track_include_junction(cli, tmpdir, datafiles, ref_storage, kind):
    607 607
             # latest ref locally, but it is not required to have cached
    
    608 608
             # the associated content of the latest ref at track time, that
    
    609 609
             # is the job of fetch.
    
    610
    -        result = cli.run(project=project, args=['fetch', element_name])
    
    610
    +        result = cli.run(project=project, args=['source', 'fetch', element_name])
    
    611 611
             result.assert_success()
    
    612 612
     
    
    613 613
             # Assert that we are now buildable because the source is
    
    ... ... @@ -633,7 +633,7 @@ def test_track_junction_included(cli, tmpdir, datafiles, ref_storage, kind):
    633 633
         generate_junction(str(tmpdir.join('junction_repo')),
    
    634 634
                           subproject_path, junction_path, store_ref=False)
    
    635 635
     
    
    636
    -    result = cli.run(project=project, args=['track', 'junction.bst'])
    
    636
    +    result = cli.run(project=project, args=['source', 'track', 'junction.bst'])
    
    637 637
         result.assert_success()
    
    638 638
     
    
    639 639
     
    
    ... ... @@ -663,7 +663,7 @@ def test_track_error_cannot_write_file(cli, tmpdir, datafiles, kind):
    663 663
             read_mask = stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH
    
    664 664
             os.chmod(element_path, stat.S_IMODE(st.st_mode) & ~read_mask)
    
    665 665
     
    
    666
    -        result = cli.run(project=project, args=['track', element_name])
    
    666
    +        result = cli.run(project=project, args=['source', 'track', element_name])
    
    667 667
             result.assert_main_error(ErrorDomain.STREAM, None)
    
    668 668
             result.assert_task_error(ErrorDomain.SOURCE, 'save-ref-error')
    
    669 669
         finally:
    

  • tests/frontend/track_cross_junction.py
    ... ... @@ -100,7 +100,7 @@ def test_cross_junction_multiple_projects(cli, tmpdir, datafiles, kind):
    100 100
         generate_junction(tmpdir.join('repo_b'), project_b_path, junction_b_path, store_ref=False)
    
    101 101
     
    
    102 102
         # Track the junctions.
    
    103
    -    result = cli.run(project=project, args=['track', junction_a, junction_b])
    
    103
    +    result = cli.run(project=project, args=['source', 'track', junction_a, junction_b])
    
    104 104
         result.assert_success()
    
    105 105
     
    
    106 106
         # Import elements from a and b in to main.
    
    ... ... @@ -111,7 +111,10 @@ def test_cross_junction_multiple_projects(cli, tmpdir, datafiles, kind):
    111 111
         all_bst = generate_simple_stack(project, 'all', [imported_a, imported_b, element_c])
    
    112 112
     
    
    113 113
         # Track without following junctions. But explicitly also track the elements in project a.
    
    114
    -    result = cli.run(project=project, args=['track', '--deps', 'all', all_bst, '{}:{}'.format(junction_a, stack_a)])
    
    114
    +    result = cli.run(project=project, args=['source', 'track',
    
    115
    +                                            '--deps', 'all',
    
    116
    +                                            all_bst,
    
    117
    +                                            '{}:{}'.format(junction_a, stack_a)])
    
    115 118
         result.assert_success()
    
    116 119
     
    
    117 120
         # Elements in project b should not be tracked. But elements in project a and main should.
    
    ... ... @@ -137,14 +140,14 @@ def test_track_exceptions(cli, tmpdir, datafiles, kind):
    137 140
         junction_a_path = os.path.join(project, 'elements', junction_a)
    
    138 141
         generate_junction(tmpdir.join('repo_a'), project_a_path, junction_a_path, store_ref=False)
    
    139 142
     
    
    140
    -    result = cli.run(project=project, args=['track', junction_a])
    
    143
    +    result = cli.run(project=project, args=['source', 'track', junction_a])
    
    141 144
         result.assert_success()
    
    142 145
     
    
    143 146
         imported_b = generate_cross_element(project, project_a, element_b)
    
    144 147
         indirection = generate_simple_stack(project, 'indirection', [imported_b])
    
    145 148
     
    
    146 149
         result = cli.run(project=project,
    
    147
    -                     args=['track', '--deps', 'all',
    
    150
    +                     args=['source', 'track', '--deps', 'all',
    
    148 151
                                '--except', indirection,
    
    149 152
                                '{}:{}'.format(junction_a, all_bst), imported_b])
    
    150 153
         result.assert_success()
    

  • tests/frontend/yamlcache.py
    ... ... @@ -82,7 +82,7 @@ def test_yamlcache_used(cli, tmpdir, ref_storage, with_junction, move_project):
    82 82
         # Generate the project
    
    83 83
         project = generate_project(str(tmpdir), ref_storage, with_junction)
    
    84 84
         if with_junction == 'junction':
    
    85
    -        result = cli.run(project=project, args=['fetch', '--track', 'junction.bst'])
    
    85
    +        result = cli.run(project=project, args=['source', 'fetch', '--track', 'junction.bst'])
    
    86 86
             result.assert_success()
    
    87 87
     
    
    88 88
         # bst show to put it in the cache
    
    ... ... @@ -118,7 +118,7 @@ def test_yamlcache_changed_file(cli, tmpdir, ref_storage, with_junction):
    118 118
         # Generate the project
    
    119 119
         project = generate_project(str(tmpdir), ref_storage, with_junction)
    
    120 120
         if with_junction == 'junction':
    
    121
    -        result = cli.run(project=project, args=['fetch', '--track', 'junction.bst'])
    
    121
    +        result = cli.run(project=project, args=['source', 'fetch', '--track', 'junction.bst'])
    
    122 122
             result.assert_success()
    
    123 123
     
    
    124 124
         # bst show to put it in the cache
    

  • tests/integration/compose.py
    ... ... @@ -91,7 +91,7 @@ def test_compose_include(cli, tmpdir, datafiles, include_domains,
    91 91
         }
    
    92 92
         create_compose_element(element_name, element_path, config=config)
    
    93 93
     
    
    94
    -    result = cli.run(project=project, args=['track', 'compose/amhello.bst'])
    
    94
    +    result = cli.run(project=project, args=['source', 'track', 'compose/amhello.bst'])
    
    95 95
         assert result.exit_code == 0
    
    96 96
     
    
    97 97
         result = cli.run(project=project, args=['build', element_name])
    

  • tests/integration/pip_source.py
    ... ... @@ -52,7 +52,7 @@ def test_pip_source_import(cli, tmpdir, datafiles, setup_pypi_repo):
    52 52
         os.makedirs(os.path.dirname(os.path.join(element_path, element_name)), exist_ok=True)
    
    53 53
         _yaml.dump(element, os.path.join(element_path, element_name))
    
    54 54
     
    
    55
    -    result = cli.run(project=project, args=['track', element_name])
    
    55
    +    result = cli.run(project=project, args=['source', 'track', element_name])
    
    56 56
         assert result.exit_code == 0
    
    57 57
     
    
    58 58
         result = cli.run(project=project, args=['build', element_name])
    
    ... ... @@ -113,7 +113,7 @@ def test_pip_source_build(cli, tmpdir, datafiles, setup_pypi_repo):
    113 113
         os.makedirs(os.path.dirname(os.path.join(element_path, element_name)), exist_ok=True)
    
    114 114
         _yaml.dump(element, os.path.join(element_path, element_name))
    
    115 115
     
    
    116
    -    result = cli.run(project=project, args=['track', element_name])
    
    116
    +    result = cli.run(project=project, args=['source', 'track', element_name])
    
    117 117
         assert result.exit_code == 0
    
    118 118
     
    
    119 119
         result = cli.run(project=project, args=['build', element_name])
    

  • tests/loader/junctions.py
    ... ... @@ -234,7 +234,7 @@ def test_git_show(cli, tmpdir, datafiles):
    234 234
         assert result.exception.reason == LoadErrorReason.SUBPROJECT_FETCH_NEEDED
    
    235 235
     
    
    236 236
         # Explicitly fetch subproject
    
    237
    -    result = cli.run(project=project, args=['fetch', 'base.bst'])
    
    237
    +    result = cli.run(project=project, args=['source', 'fetch', 'base.bst'])
    
    238 238
         assert result.exit_code == 0
    
    239 239
     
    
    240 240
         # Check that bst show succeeds now and the pipeline includes the subproject element
    

  • tests/pipeline/preflight.py
    ... ... @@ -15,5 +15,5 @@ def test_load_simple(cli, datafiles, tmpdir):
    15 15
         basedir = os.path.join(datafiles.dirname, datafiles.basename)
    
    16 16
     
    
    17 17
         # Lets try to fetch it...
    
    18
    -    result = cli.run(project=basedir, args=['fetch', 'error.bst'])
    
    18
    +    result = cli.run(project=basedir, args=['source', 'fetch', 'error.bst'])
    
    19 19
         result.assert_main_error(ErrorDomain.SOURCE, "the-preflight-error")

  • tests/plugins/filter.py
    ... ... @@ -227,7 +227,7 @@ def test_filter_track(datafiles, cli, tmpdir):
    227 227
         assert cli.get_element_state(project, input_name) == 'no reference'
    
    228 228
     
    
    229 229
         # Now try to track it
    
    230
    -    result = cli.run(project=project, args=["track", "filter2.bst"])
    
    230
    +    result = cli.run(project=project, args=["source", "track", "filter2.bst"])
    
    231 231
         result.assert_success()
    
    232 232
     
    
    233 233
         # Now check that a ref field exists
    
    ... ... @@ -280,7 +280,7 @@ def test_filter_track_excepted(datafiles, cli, tmpdir):
    280 280
         assert cli.get_element_state(project, input_name) == 'no reference'
    
    281 281
     
    
    282 282
         # Now try to track it
    
    283
    -    result = cli.run(project=project, args=["track", "filter2.bst", "--except", "input.bst"])
    
    283
    +    result = cli.run(project=project, args=["source", "track", "filter2.bst", "--except", "input.bst"])
    
    284 284
         result.assert_success()
    
    285 285
     
    
    286 286
         # Now check that a ref field exists
    
    ... ... @@ -333,7 +333,7 @@ def test_filter_track_multi_to_one(datafiles, cli, tmpdir):
    333 333
         assert cli.get_element_state(project, input_name) == 'no reference'
    
    334 334
     
    
    335 335
         # Now try to track it
    
    336
    -    result = cli.run(project=project, args=["track", "filter1.bst", "filter2.bst"])
    
    336
    +    result = cli.run(project=project, args=["source", "track", "filter1.bst", "filter2.bst"])
    
    337 337
         result.assert_success()
    
    338 338
     
    
    339 339
         # Now check that a ref field exists
    
    ... ... @@ -392,7 +392,7 @@ def test_filter_track_multi(datafiles, cli, tmpdir):
    392 392
         assert cli.get_element_state(project, input2_name) == 'no reference'
    
    393 393
     
    
    394 394
         # Now try to track it
    
    395
    -    result = cli.run(project=project, args=["track", "filter1.bst", "filter2.bst"])
    
    395
    +    result = cli.run(project=project, args=["source", "track", "filter1.bst", "filter2.bst"])
    
    396 396
         result.assert_success()
    
    397 397
     
    
    398 398
         # Now check that a ref field exists
    
    ... ... @@ -453,7 +453,7 @@ def test_filter_track_multi_exclude(datafiles, cli, tmpdir):
    453 453
         assert cli.get_element_state(project, input2_name) == 'no reference'
    
    454 454
     
    
    455 455
         # Now try to track it
    
    456
    -    result = cli.run(project=project, args=["track", "filter1.bst", "filter2.bst", "--except", input_name])
    
    456
    +    result = cli.run(project=project, args=["source", "track", "filter1.bst", "filter2.bst", "--except", input_name])
    
    457 457
         result.assert_success()
    
    458 458
     
    
    459 459
         # Now check that a ref field exists
    

  • tests/sources/bzr.py
    ... ... @@ -32,7 +32,7 @@ def test_fetch_checkout(cli, tmpdir, datafiles):
    32 32
         _yaml.dump(element, os.path.join(project, 'target.bst'))
    
    33 33
     
    
    34 34
         # Fetch, build, checkout
    
    35
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    35
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    36 36
         assert result.exit_code == 0
    
    37 37
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    38 38
         assert result.exit_code == 0
    

  • tests/sources/deb.py
    ... ... @@ -54,7 +54,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles):
    54 54
     
    
    55 55
         # Try to fetch it
    
    56 56
         result = cli.run(project=project, args=[
    
    57
    -        'fetch', 'target.bst'
    
    57
    +        'source', 'fetch', 'target.bst'
    
    58 58
         ])
    
    59 59
         assert "FAILURE Try #" in result.stderr
    
    60 60
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    ... ... @@ -72,7 +72,7 @@ def test_fetch_bad_ref(cli, tmpdir, datafiles):
    72 72
     
    
    73 73
         # Try to fetch it
    
    74 74
         result = cli.run(project=project, args=[
    
    75
    -        'fetch', 'target.bst'
    
    75
    +        'source', 'fetch', 'target.bst'
    
    76 76
         ])
    
    77 77
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    78 78
         result.assert_task_error(ErrorDomain.SOURCE, None)
    
    ... ... @@ -90,7 +90,7 @@ def test_track_warning(cli, tmpdir, datafiles):
    90 90
     
    
    91 91
         # Track it
    
    92 92
         result = cli.run(project=project, args=[
    
    93
    -        'track', 'target.bst'
    
    93
    +        'source', 'track', 'target.bst'
    
    94 94
         ])
    
    95 95
         result.assert_success()
    
    96 96
         assert "Potential man-in-the-middle attack!" in result.stderr
    
    ... ... @@ -108,9 +108,9 @@ def test_stage_default_basedir(cli, tmpdir, datafiles):
    108 108
         _copy_deb(DATA_DIR, tmpdir)
    
    109 109
     
    
    110 110
         # Track, fetch, build, checkout
    
    111
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    111
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    112 112
         result.assert_success()
    
    113
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    113
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    114 114
         result.assert_success()
    
    115 115
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    116 116
         result.assert_success()
    
    ... ... @@ -136,9 +136,9 @@ def test_stage_no_basedir(cli, tmpdir, datafiles):
    136 136
         _copy_deb(DATA_DIR, tmpdir)
    
    137 137
     
    
    138 138
         # Track, fetch, build, checkout
    
    139
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    139
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    140 140
         result.assert_success()
    
    141
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    141
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    142 142
         result.assert_success()
    
    143 143
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    144 144
         result.assert_success()
    
    ... ... @@ -164,9 +164,9 @@ def test_stage_explicit_basedir(cli, tmpdir, datafiles):
    164 164
         _copy_deb(DATA_DIR, tmpdir)
    
    165 165
     
    
    166 166
         # Track, fetch, build, checkout
    
    167
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    167
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    168 168
         result.assert_success()
    
    169
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    169
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    170 170
         result.assert_success()
    
    171 171
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    172 172
         result.assert_success()
    

  • tests/sources/git.py
    ... ... @@ -57,7 +57,7 @@ def test_fetch_bad_ref(cli, tmpdir, datafiles):
    57 57
     
    
    58 58
         # Assert that fetch raises an error here
    
    59 59
         result = cli.run(project=project, args=[
    
    60
    -        'fetch', 'target.bst'
    
    60
    +        'source', 'fetch', 'target.bst'
    
    61 61
         ])
    
    62 62
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    63 63
         result.assert_task_error(ErrorDomain.SOURCE, None)
    
    ... ... @@ -90,7 +90,7 @@ def test_submodule_fetch_checkout(cli, tmpdir, datafiles):
    90 90
         _yaml.dump(element, os.path.join(project, 'target.bst'))
    
    91 91
     
    
    92 92
         # Fetch, build, checkout
    
    93
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    93
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    94 94
         result.assert_success()
    
    95 95
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    96 96
         result.assert_success()
    
    ... ... @@ -129,7 +129,7 @@ def test_submodule_fetch_source_enable_explicit(cli, tmpdir, datafiles):
    129 129
         _yaml.dump(element, os.path.join(project, 'target.bst'))
    
    130 130
     
    
    131 131
         # Fetch, build, checkout
    
    132
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    132
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    133 133
         result.assert_success()
    
    134 134
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    135 135
         result.assert_success()
    
    ... ... @@ -168,7 +168,7 @@ def test_submodule_fetch_source_disable(cli, tmpdir, datafiles):
    168 168
         _yaml.dump(element, os.path.join(project, 'target.bst'))
    
    169 169
     
    
    170 170
         # Fetch, build, checkout
    
    171
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    171
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    172 172
         result.assert_success()
    
    173 173
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    174 174
         result.assert_success()
    
    ... ... @@ -207,7 +207,7 @@ def test_submodule_fetch_submodule_does_override(cli, tmpdir, datafiles):
    207 207
         _yaml.dump(element, os.path.join(project, 'target.bst'))
    
    208 208
     
    
    209 209
         # Fetch, build, checkout
    
    210
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    210
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    211 211
         result.assert_success()
    
    212 212
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    213 213
         result.assert_success()
    
    ... ... @@ -251,7 +251,7 @@ def test_submodule_fetch_submodule_individual_checkout(cli, tmpdir, datafiles):
    251 251
         _yaml.dump(element, os.path.join(project, 'target.bst'))
    
    252 252
     
    
    253 253
         # Fetch, build, checkout
    
    254
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    254
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    255 255
         result.assert_success()
    
    256 256
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    257 257
         result.assert_success()
    
    ... ... @@ -296,7 +296,7 @@ def test_submodule_fetch_submodule_individual_checkout_explicit(cli, tmpdir, dat
    296 296
         _yaml.dump(element, os.path.join(project, 'target.bst'))
    
    297 297
     
    
    298 298
         # Fetch, build, checkout
    
    299
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    299
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    300 300
         result.assert_success()
    
    301 301
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    302 302
         result.assert_success()
    
    ... ... @@ -336,7 +336,7 @@ def test_submodule_fetch_project_override(cli, tmpdir, datafiles):
    336 336
         _yaml.dump(element, os.path.join(project, 'target.bst'))
    
    337 337
     
    
    338 338
         # Fetch, build, checkout
    
    339
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    339
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    340 340
         result.assert_success()
    
    341 341
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    342 342
         result.assert_success()
    
    ... ... @@ -374,11 +374,11 @@ def test_submodule_track_ignore_inconsistent(cli, tmpdir, datafiles):
    374 374
         repo.add_file(os.path.join(project, 'inconsistent-submodule', '.gitmodules'))
    
    375 375
     
    
    376 376
         # Fetch should work, we're not yet at the offending ref
    
    377
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    377
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    378 378
         result.assert_success()
    
    379 379
     
    
    380 380
         # Track will encounter an inconsistent submodule without any ref
    
    381
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    381
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    382 382
         result.assert_success()
    
    383 383
     
    
    384 384
         # Assert that we are just fine without it, and emit a warning to the user.
    
    ... ... @@ -507,7 +507,7 @@ def test_unlisted_submodule(cli, tmpdir, datafiles, fail):
    507 507
     
    
    508 508
         # We will notice this directly in fetch, as it will try to fetch
    
    509 509
         # the submodules it discovers as a result of fetching the primary repo.
    
    510
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    510
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    511 511
     
    
    512 512
         # Assert a warning or an error depending on what we're checking
    
    513 513
         if fail == 'error':
    
    ... ... @@ -570,19 +570,19 @@ def test_track_unlisted_submodule(cli, tmpdir, datafiles, fail):
    570 570
     
    
    571 571
         # Fetch the repo, we will not see the warning because we
    
    572 572
         # are still pointing to a ref which predates the submodules
    
    573
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    573
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    574 574
         result.assert_success()
    
    575 575
         assert "git:unlisted-submodule" not in result.stderr
    
    576 576
     
    
    577 577
         # We won't get a warning/error when tracking either, the source
    
    578 578
         # has not become Consistency.CACHED so the opportunity to check
    
    579 579
         # for the warning has not yet arisen.
    
    580
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    580
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    581 581
         result.assert_success()
    
    582 582
         assert "git:unlisted-submodule" not in result.stderr
    
    583 583
     
    
    584 584
         # Fetching the repo at the new ref will finally reveal the warning
    
    585
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    585
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    586 586
         if fail == 'error':
    
    587 587
             result.assert_main_error(ErrorDomain.STREAM, None)
    
    588 588
             result.assert_task_error(ErrorDomain.PLUGIN, 'git:unlisted-submodule')
    
    ... ... @@ -641,7 +641,7 @@ def test_invalid_submodule(cli, tmpdir, datafiles, fail):
    641 641
     
    
    642 642
         # We will notice this directly in fetch, as it will try to fetch
    
    643 643
         # the submodules it discovers as a result of fetching the primary repo.
    
    644
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    644
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    645 645
     
    
    646 646
         # Assert a warning or an error depending on what we're checking
    
    647 647
         if fail == 'error':
    
    ... ... @@ -705,7 +705,7 @@ def test_track_invalid_submodule(cli, tmpdir, datafiles, fail):
    705 705
     
    
    706 706
         # Fetch the repo, we will not see the warning because we
    
    707 707
         # are still pointing to a ref which predates the submodules
    
    708
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    708
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    709 709
         result.assert_success()
    
    710 710
         assert "git:invalid-submodule" not in result.stderr
    
    711 711
     
    
    ... ... @@ -714,7 +714,7 @@ def test_track_invalid_submodule(cli, tmpdir, datafiles, fail):
    714 714
         # not locally cached, the Source will be CACHED directly after
    
    715 715
         # tracking and the validations will occur as a result.
    
    716 716
         #
    
    717
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    717
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    718 718
         if fail == 'error':
    
    719 719
             result.assert_main_error(ErrorDomain.STREAM, None)
    
    720 720
             result.assert_task_error(ErrorDomain.PLUGIN, 'git:invalid-submodule')
    
    ... ... @@ -750,7 +750,7 @@ def test_track_fetch(cli, tmpdir, datafiles, ref_format, tag, extra_commit):
    750 750
         _yaml.dump(element, element_path)
    
    751 751
     
    
    752 752
         # Track it
    
    753
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    753
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    754 754
         result.assert_success()
    
    755 755
     
    
    756 756
         element = _yaml.load(element_path)
    
    ... ... @@ -766,7 +766,7 @@ def test_track_fetch(cli, tmpdir, datafiles, ref_format, tag, extra_commit):
    766 766
         assert len(new_ref) == 40
    
    767 767
     
    
    768 768
         # Fetch it
    
    769
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    769
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    770 770
         result.assert_success()
    
    771 771
     
    
    772 772
     
    
    ... ... @@ -834,10 +834,10 @@ def test_git_describe(cli, tmpdir, datafiles, ref_storage, tag_type):
    834 834
         _yaml.dump(element, element_path)
    
    835 835
     
    
    836 836
         if ref_storage == 'inline':
    
    837
    -        result = cli.run(project=project, args=['track', 'target.bst'])
    
    837
    +        result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    838 838
             result.assert_success()
    
    839 839
         else:
    
    840
    -        result = cli.run(project=project, args=['track', 'target.bst', '--deps', 'all'])
    
    840
    +        result = cli.run(project=project, args=['source', 'track', 'target.bst', '--deps', 'all'])
    
    841 841
             result.assert_success()
    
    842 842
     
    
    843 843
         if ref_storage == 'inline':
    
    ... ... @@ -915,7 +915,7 @@ def test_default_do_not_track_tags(cli, tmpdir, datafiles):
    915 915
         element_path = os.path.join(project, 'target.bst')
    
    916 916
         _yaml.dump(element, element_path)
    
    917 917
     
    
    918
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    918
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    919 919
         result.assert_success()
    
    920 920
     
    
    921 921
         element = _yaml.load(element_path)
    

  • tests/sources/previous_source_access.py
    ... ... @@ -19,13 +19,13 @@ def test_custom_transform_source(cli, tmpdir, datafiles):
    19 19
     
    
    20 20
         # Ensure we can track
    
    21 21
         result = cli.run(project=project, args=[
    
    22
    -        'track', 'target.bst'
    
    22
    +        'source', 'track', 'target.bst'
    
    23 23
         ])
    
    24 24
         result.assert_success()
    
    25 25
     
    
    26 26
         # Ensure we can fetch
    
    27 27
         result = cli.run(project=project, args=[
    
    28
    -        'fetch', 'target.bst'
    
    28
    +        'source', 'fetch', 'target.bst'
    
    29 29
         ])
    
    30 30
         result.assert_success()
    
    31 31
     
    

  • tests/sources/remote.py
    ... ... @@ -50,7 +50,7 @@ def test_missing_file(cli, tmpdir, datafiles):
    50 50
     
    
    51 51
         # Try to fetch it
    
    52 52
         result = cli.run(project=project, args=[
    
    53
    -        'fetch', 'target.bst'
    
    53
    +        'source', 'fetch', 'target.bst'
    
    54 54
         ])
    
    55 55
     
    
    56 56
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    ... ... @@ -64,7 +64,7 @@ def test_path_in_filename(cli, tmpdir, datafiles):
    64 64
     
    
    65 65
         # Try to fetch it
    
    66 66
         result = cli.run(project=project, args=[
    
    67
    -        'fetch', 'target.bst'
    
    67
    +        'source', 'fetch', 'target.bst'
    
    68 68
         ])
    
    69 69
     
    
    70 70
         # The bst file has a / in the filename param
    
    ... ... @@ -79,7 +79,7 @@ def test_simple_file_build(cli, tmpdir, datafiles):
    79 79
     
    
    80 80
         # Try to fetch it
    
    81 81
         result = cli.run(project=project, args=[
    
    82
    -        'fetch', 'target.bst'
    
    82
    +        'source', 'fetch', 'target.bst'
    
    83 83
         ])
    
    84 84
         result.assert_success()
    
    85 85
     
    
    ... ... @@ -112,7 +112,7 @@ def test_simple_file_custom_name_build(cli, tmpdir, datafiles):
    112 112
     
    
    113 113
         # Try to fetch it
    
    114 114
         result = cli.run(project=project, args=[
    
    115
    -        'fetch', 'target.bst'
    
    115
    +        'source', 'fetch', 'target.bst'
    
    116 116
         ])
    
    117 117
         result.assert_success()
    
    118 118
     
    
    ... ... @@ -141,7 +141,7 @@ def test_unique_key(cli, tmpdir, datafiles):
    141 141
         assert cli.get_element_state(project, 'target-custom-executable.bst') == "fetch needed"
    
    142 142
         # Try to fetch it
    
    143 143
         result = cli.run(project=project, args=[
    
    144
    -        'fetch', 'target.bst'
    
    144
    +        'source', 'fetch', 'target.bst'
    
    145 145
         ])
    
    146 146
     
    
    147 147
         # We should download the file only once
    
    ... ... @@ -198,7 +198,7 @@ def test_use_netrc(cli, datafiles, server_type, tmpdir):
    198 198
     
    
    199 199
             server.start()
    
    200 200
     
    
    201
    -        result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    201
    +        result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    202 202
             result.assert_success()
    
    203 203
             result = cli.run(project=project, args=['build', 'target.bst'])
    
    204 204
             result.assert_success()
    

  • tests/sources/tar.py
    ... ... @@ -77,7 +77,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles):
    77 77
     
    
    78 78
         # Try to fetch it
    
    79 79
         result = cli.run(project=project, args=[
    
    80
    -        'fetch', 'target.bst'
    
    80
    +        'source', 'fetch', 'target.bst'
    
    81 81
         ])
    
    82 82
         assert "FAILURE Try #" in result.stderr
    
    83 83
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    ... ... @@ -96,7 +96,7 @@ def test_fetch_bad_ref(cli, tmpdir, datafiles):
    96 96
     
    
    97 97
         # Try to fetch it
    
    98 98
         result = cli.run(project=project, args=[
    
    99
    -        'fetch', 'target.bst'
    
    99
    +        'source', 'fetch', 'target.bst'
    
    100 100
         ])
    
    101 101
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    102 102
         result.assert_task_error(ErrorDomain.SOURCE, None)
    
    ... ... @@ -114,7 +114,7 @@ def test_track_warning(cli, tmpdir, datafiles):
    114 114
     
    
    115 115
         # Track it
    
    116 116
         result = cli.run(project=project, args=[
    
    117
    -        'track', 'target.bst'
    
    117
    +        'source', 'track', 'target.bst'
    
    118 118
         ])
    
    119 119
         result.assert_success()
    
    120 120
         assert "Potential man-in-the-middle attack!" in result.stderr
    
    ... ... @@ -133,9 +133,9 @@ def test_stage_default_basedir(cli, tmpdir, datafiles, srcdir):
    133 133
         _assemble_tar(os.path.join(str(datafiles), "content"), srcdir, src_tar)
    
    134 134
     
    
    135 135
         # Track, fetch, build, checkout
    
    136
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    136
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    137 137
         result.assert_success()
    
    138
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    138
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    139 139
         result.assert_success()
    
    140 140
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    141 141
         result.assert_success()
    
    ... ... @@ -162,9 +162,9 @@ def test_stage_no_basedir(cli, tmpdir, datafiles, srcdir):
    162 162
         _assemble_tar(os.path.join(str(datafiles), "content"), srcdir, src_tar)
    
    163 163
     
    
    164 164
         # Track, fetch, build, checkout
    
    165
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    165
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    166 166
         result.assert_success()
    
    167
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    167
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    168 168
         result.assert_success()
    
    169 169
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    170 170
         result.assert_success()
    
    ... ... @@ -191,9 +191,9 @@ def test_stage_explicit_basedir(cli, tmpdir, datafiles, srcdir):
    191 191
         _assemble_tar(os.path.join(str(datafiles), "content"), srcdir, src_tar)
    
    192 192
     
    
    193 193
         # Track, fetch, build, checkout
    
    194
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    194
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    195 195
         result.assert_success()
    
    196
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    196
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    197 197
         result.assert_success()
    
    198 198
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    199 199
         result.assert_success()
    
    ... ... @@ -227,9 +227,9 @@ def test_stage_contains_links(cli, tmpdir, datafiles):
    227 227
         _assemble_tar(os.path.join(str(datafiles), "content"), "base-directory", src_tar)
    
    228 228
     
    
    229 229
         # Track, fetch, build, checkout
    
    230
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    230
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    231 231
         result.assert_success()
    
    232
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    232
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    233 233
         result.assert_success()
    
    234 234
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    235 235
         result.assert_success()
    
    ... ... @@ -256,9 +256,9 @@ def test_stage_default_basedir_lzip(cli, tmpdir, datafiles, srcdir):
    256 256
         _assemble_tar_lz(os.path.join(str(datafiles), "content"), srcdir, src_tar)
    
    257 257
     
    
    258 258
         # Track, fetch, build, checkout
    
    259
    -    result = cli.run(project=project, args=['track', 'target-lz.bst'])
    
    259
    +    result = cli.run(project=project, args=['source', 'track', 'target-lz.bst'])
    
    260 260
         result.assert_success()
    
    261
    -    result = cli.run(project=project, args=['fetch', 'target-lz.bst'])
    
    261
    +    result = cli.run(project=project, args=['source', 'fetch', 'target-lz.bst'])
    
    262 262
         result.assert_success()
    
    263 263
         result = cli.run(project=project, args=['build', 'target-lz.bst'])
    
    264 264
         result.assert_success()
    
    ... ... @@ -297,9 +297,9 @@ def test_read_only_dir(cli, tmpdir, datafiles):
    297 297
             env = {"TMP": tmpdir_str}
    
    298 298
     
    
    299 299
             # Track, fetch, build, checkout
    
    300
    -        result = cli.run(project=project, args=['track', 'target.bst'], env=env)
    
    300
    +        result = cli.run(project=project, args=['source', 'track', 'target.bst'], env=env)
    
    301 301
             result.assert_success()
    
    302
    -        result = cli.run(project=project, args=['fetch', 'target.bst'], env=env)
    
    302
    +        result = cli.run(project=project, args=['source', 'fetch', 'target.bst'], env=env)
    
    303 303
             result.assert_success()
    
    304 304
             result = cli.run(project=project, args=['build', 'target.bst'], env=env)
    
    305 305
             result.assert_success()
    
    ... ... @@ -342,9 +342,9 @@ def test_use_netrc(cli, datafiles, server_type, tmpdir):
    342 342
     
    
    343 343
             server.start()
    
    344 344
     
    
    345
    -        result = cli.run(project=project, args=['track', 'target.bst'])
    
    345
    +        result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    346 346
             result.assert_success()
    
    347
    -        result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    347
    +        result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    348 348
             result.assert_success()
    
    349 349
             result = cli.run(project=project, args=['build', 'target.bst'])
    
    350 350
             result.assert_success()
    
    ... ... @@ -385,6 +385,6 @@ def test_netrc_already_specified_user(cli, datafiles, server_type, tmpdir):
    385 385
     
    
    386 386
             server.start()
    
    387 387
     
    
    388
    -        result = cli.run(project=project, args=['track', 'target.bst'])
    
    388
    +        result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    389 389
             result.assert_main_error(ErrorDomain.STREAM, None)
    
    390 390
             result.assert_task_error(ErrorDomain.SOURCE, None)

  • tests/sources/zip.py
    ... ... @@ -62,7 +62,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles):
    62 62
     
    
    63 63
         # Try to fetch it
    
    64 64
         result = cli.run(project=project, args=[
    
    65
    -        'fetch', 'target.bst'
    
    65
    +        'source', 'fetch', 'target.bst'
    
    66 66
         ])
    
    67 67
         assert "FAILURE Try #" in result.stderr
    
    68 68
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    ... ... @@ -81,7 +81,7 @@ def test_fetch_bad_ref(cli, tmpdir, datafiles):
    81 81
     
    
    82 82
         # Try to fetch it
    
    83 83
         result = cli.run(project=project, args=[
    
    84
    -        'fetch', 'target.bst'
    
    84
    +        'source', 'fetch', 'target.bst'
    
    85 85
         ])
    
    86 86
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    87 87
         result.assert_task_error(ErrorDomain.SOURCE, None)
    
    ... ... @@ -99,7 +99,7 @@ def test_track_warning(cli, tmpdir, datafiles):
    99 99
     
    
    100 100
         # Track it
    
    101 101
         result = cli.run(project=project, args=[
    
    102
    -        'track', 'target.bst'
    
    102
    +        'source', 'track', 'target.bst'
    
    103 103
         ])
    
    104 104
         result.assert_success()
    
    105 105
         assert "Potential man-in-the-middle attack!" in result.stderr
    
    ... ... @@ -117,9 +117,9 @@ def test_stage_default_basedir(cli, tmpdir, datafiles):
    117 117
         _assemble_zip(os.path.join(str(datafiles), "content"), src_zip)
    
    118 118
     
    
    119 119
         # Track, fetch, build, checkout
    
    120
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    120
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    121 121
         result.assert_success()
    
    122
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    122
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    123 123
         result.assert_success()
    
    124 124
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    125 125
         result.assert_success()
    
    ... ... @@ -145,9 +145,9 @@ def test_stage_no_basedir(cli, tmpdir, datafiles):
    145 145
         _assemble_zip(os.path.join(str(datafiles), "content"), src_zip)
    
    146 146
     
    
    147 147
         # Track, fetch, build, checkout
    
    148
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    148
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    149 149
         result.assert_success()
    
    150
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    150
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    151 151
         result.assert_success()
    
    152 152
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    153 153
         result.assert_success()
    
    ... ... @@ -173,9 +173,9 @@ def test_stage_explicit_basedir(cli, tmpdir, datafiles):
    173 173
         _assemble_zip(os.path.join(str(datafiles), "content"), src_zip)
    
    174 174
     
    
    175 175
         # Track, fetch, build, checkout
    
    176
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    176
    +    result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    177 177
         result.assert_success()
    
    178
    -    result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    178
    +    result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    179 179
         result.assert_success()
    
    180 180
         result = cli.run(project=project, args=['build', 'target.bst'])
    
    181 181
         result.assert_success()
    
    ... ... @@ -215,9 +215,9 @@ def test_use_netrc(cli, datafiles, server_type, tmpdir):
    215 215
     
    
    216 216
             server.start()
    
    217 217
     
    
    218
    -        result = cli.run(project=project, args=['track', 'target.bst'])
    
    218
    +        result = cli.run(project=project, args=['source', 'track', 'target.bst'])
    
    219 219
             result.assert_success()
    
    220
    -        result = cli.run(project=project, args=['fetch', 'target.bst'])
    
    220
    +        result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
    
    221 221
             result.assert_success()
    
    222 222
             result = cli.run(project=project, args=['build', 'target.bst'])
    
    223 223
             result.assert_success()
    



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