diff options
author | James Ennis <james.ennis@codethink.com> | 2019-01-07 18:00:54 +0000 |
---|---|---|
committer | James Ennis <james.ennis@codethink.com> | 2019-01-22 12:32:43 +0000 |
commit | a3fc350fdf64897ae386aa913a55318d6b048276 (patch) | |
tree | 088bfa82769eb6f72262b430f51936a8a9249c16 | |
parent | ac13533300da75472e53d36ec03b4dddf4fe6c73 (diff) | |
download | buildstream-a3fc350fdf64897ae386aa913a55318d6b048276.tar.gz |
Move push and pull to the new artifact subcommand group
This commit also ensures that if we try to use the 'old' commands,
BuildStream will fail and instruct the user to use the new command.
-rw-r--r-- | buildstream/_frontend/cli.py | 178 | ||||
-rw-r--r-- | tests/artifactcache/config.py | 2 | ||||
-rw-r--r-- | tests/artifactcache/junctions.py | 4 | ||||
-rw-r--r-- | tests/frontend/completions.py | 14 | ||||
-rw-r--r-- | tests/frontend/help.py | 3 | ||||
-rw-r--r-- | tests/frontend/pull.py | 12 | ||||
-rw-r--r-- | tests/frontend/push.py | 16 | ||||
-rw-r--r-- | tests/frontend/workspace.py | 4 | ||||
-rw-r--r-- | tests/integration/build-tree.py | 5 | ||||
-rw-r--r-- | tests/integration/pullbuildtrees.py | 34 | ||||
-rw-r--r-- | tests/sandboxes/remote-exec-config.py | 4 |
11 files changed, 156 insertions, 120 deletions
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py index a0a01364d..d0a99ec74 100644 --- a/buildstream/_frontend/cli.py +++ b/buildstream/_frontend/cli.py @@ -369,78 +369,6 @@ def build(app, elements, all_, track_, track_save, track_all, track_except, trac ################################################################## -# Pull Command # -################################################################## -@cli.command(short_help="Pull a built artifact") -@click.option('--deps', '-d', default='none', - type=click.Choice(['none', 'all']), - help='The dependency artifacts to pull (default: none)') -@click.option('--remote', '-r', - help="The URL of the remote cache (defaults to the first configured cache)") -@click.argument('elements', nargs=-1, - type=click.Path(readable=False)) -@click.pass_obj -def pull(app, elements, deps, remote): - """Pull a built artifact from the configured remote artifact cache. - - By default the artifact will be pulled one of the configured caches - if possible, following the usual priority order. If the `--remote` flag - is given, only the specified cache will be queried. - - Specify `--deps` to control which artifacts to pull: - - \b - none: No dependencies, just the element itself - all: All dependencies - """ - - with app.initialized(session_name="Pull"): - if not elements: - guessed_target = app.context.guess_element() - if guessed_target: - elements = (guessed_target,) - - app.stream.pull(elements, selection=deps, remote=remote) - - -################################################################## -# Push Command # -################################################################## -@cli.command(short_help="Push a built artifact") -@click.option('--deps', '-d', default='none', - type=click.Choice(['none', 'all']), - help='The dependencies to push (default: none)') -@click.option('--remote', '-r', default=None, - help="The URL of the remote cache (defaults to the first configured cache)") -@click.argument('elements', nargs=-1, - type=click.Path(readable=False)) -@click.pass_obj -def push(app, elements, deps, remote): - """Push a built artifact to a remote artifact cache. - - The default destination is the highest priority configured cache. You can - override this by passing a different cache URL with the `--remote` flag. - - If bst has been configured to include build trees on artifact pulls, - an attempt will be made to pull any required build trees to avoid the - skipping of partial artifacts being pushed. - - Specify `--deps` to control which artifacts to push: - - \b - none: No dependencies, just the element itself - all: All dependencies - """ - with app.initialized(session_name="Push"): - if not elements: - guessed_target = app.context.guess_element() - if guessed_target: - elements = (guessed_target,) - - app.stream.push(elements, selection=deps, remote=remote) - - -################################################################## # Show Command # ################################################################## @cli.command(short_help="Show elements in the pipeline") @@ -1030,6 +958,78 @@ def artifact(): ################################################################ +# Artifact Pull Command # +################################################################ +@artifact.command(name="pull", short_help="Pull a built artifact") +@click.option('--deps', '-d', default='none', + type=click.Choice(['none', 'all']), + help='The dependency artifacts to pull (default: none)') +@click.option('--remote', '-r', + help="The URL of the remote cache (defaults to the first configured cache)") +@click.argument('elements', nargs=-1, + type=click.Path(readable=False)) +@click.pass_obj +def artifact_pull(app, elements, deps, remote): + """Pull a built artifact from the configured remote artifact cache. + + By default the artifact will be pulled one of the configured caches + if possible, following the usual priority order. If the `--remote` flag + is given, only the specified cache will be queried. + + Specify `--deps` to control which artifacts to pull: + + \b + none: No dependencies, just the element itself + all: All dependencies + """ + + with app.initialized(session_name="Pull"): + if not elements: + guessed_target = app.context.guess_element() + if guessed_target: + elements = (guessed_target,) + + app.stream.pull(elements, selection=deps, remote=remote) + + +################################################################## +# Artifact Push Command # +################################################################## +@artifact.command(name="push", short_help="Push a built artifact") +@click.option('--deps', '-d', default='none', + type=click.Choice(['none', 'all']), + help='The dependencies to push (default: none)') +@click.option('--remote', '-r', default=None, + help="The URL of the remote cache (defaults to the first configured cache)") +@click.argument('elements', nargs=-1, + type=click.Path(readable=False)) +@click.pass_obj +def artifact_push(app, elements, deps, remote): + """Push a built artifact to a remote artifact cache. + + The default destination is the highest priority configured cache. You can + override this by passing a different cache URL with the `--remote` flag. + + If bst has been configured to include build trees on artifact pulls, + an attempt will be made to pull any required build trees to avoid the + skipping of partial artifacts being pushed. + + Specify `--deps` to control which artifacts to push: + + \b + none: No dependencies, just the element itself + all: All dependencies + """ + with app.initialized(session_name="Push"): + if not elements: + guessed_target = app.context.guess_element() + if guessed_target: + elements = (guessed_target,) + + app.stream.push(elements, selection=deps, remote=remote) + + +################################################################ # Artifact Log Command # ################################################################ @artifact.command(name='log', short_help="Show logs of an artifact") @@ -1135,3 +1135,37 @@ def fetch(app, elements, deps, track_, except_, track_cross_junctions): def track(app, elements, deps, except_, cross_junctions): click.echo("This command is now obsolete. Use `bst source track` instead.", err=True) sys.exit(1) + + +################################################################ +# Pull Command # +################################################################ +@cli.command(short_help="Pull a built artifact", hidden=True) +@click.option('--deps', '-d', default='none', + type=click.Choice(['none', 'all']), + help='The dependency artifacts to pull (default: none)') +@click.option('--remote', '-r', + help="The URL of the remote cache (defaults to the first configured cache)") +@click.argument('elements', nargs=-1, + type=click.Path(readable=False)) +@click.pass_obj +def pull(app, elements, deps, remote): + click.echo("This command is now obsolete. Use `bst artifact pull` instead.", err=True) + sys.exit(1) + + +################################################################## +# Push Command # +################################################################## +@cli.command(short_help="Push a built artifact", hidden=True) +@click.option('--deps', '-d', default='none', + type=click.Choice(['none', 'all']), + help='The dependencies to push (default: none)') +@click.option('--remote', '-r', default=None, + help="The URL of the remote cache (defaults to the first configured cache)") +@click.argument('elements', nargs=-1, + type=click.Path(readable=False)) +@click.pass_obj +def push(app, elements, deps, remote): + click.echo("This command is now obsolete. Use `bst artifact push` instead.", err=True) + sys.exit(1) diff --git a/tests/artifactcache/config.py b/tests/artifactcache/config.py index 8c8c4b48c..fecb3dd2e 100644 --- a/tests/artifactcache/config.py +++ b/tests/artifactcache/config.py @@ -137,5 +137,5 @@ def test_missing_certs(cli, datafiles, config_key, config_value): # Use `pull` here to ensure we try to initialize the remotes, triggering the error # # This does not happen for a simple `bst show`. - result = cli.run(project=project, args=['pull', 'element.bst']) + result = cli.run(project=project, args=['artifact', 'pull', 'element.bst']) result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA) diff --git a/tests/artifactcache/junctions.py b/tests/artifactcache/junctions.py index 378d007a0..c6d6921c8 100644 --- a/tests/artifactcache/junctions.py +++ b/tests/artifactcache/junctions.py @@ -58,7 +58,7 @@ def test_push_pull(cli, tmpdir, datafiles): project_set_artifacts(base_project, base_share.repo) # Now try bst push - result = cli.run(project=project, args=['push', '--deps', 'all', 'target.bst']) + result = cli.run(project=project, args=['artifact', 'push', '--deps', 'all', 'target.bst']) assert result.exit_code == 0 # And finally assert that the artifacts are in the right shares @@ -78,7 +78,7 @@ def test_push_pull(cli, tmpdir, datafiles): assert state != 'cached' # Now try bst pull - result = cli.run(project=project, args=['pull', '--deps', 'all', 'target.bst']) + result = cli.run(project=project, args=['artifact', 'pull', '--deps', 'all', 'target.bst']) assert result.exit_code == 0 # And assert that they are again in the local cache, without having built diff --git a/tests/frontend/completions.py b/tests/frontend/completions.py index 0e4c6ad7e..b0e08a3f0 100644 --- a/tests/frontend/completions.py +++ b/tests/frontend/completions.py @@ -14,8 +14,6 @@ MAIN_COMMANDS = [ 'checkout ', 'help ', 'init ', - 'pull ', - 'push ', 'shell ', 'show ', 'source ', @@ -57,6 +55,12 @@ SOURCE_COMMANDS = [ 'track ', ] +ARTIFACT_COMMANDS = [ + 'push ', + 'pull ', + 'log ', +] + WORKSPACE_COMMANDS = [ 'close ', 'list ', @@ -120,8 +124,7 @@ def assert_completion_failed(cli, cmd, word_idx, expected, cwd=None): @pytest.mark.parametrize("cmd,word_idx,expected", [ ('bst', 0, []), ('bst ', 1, MAIN_COMMANDS), - ('bst pu', 1, ['pull ', 'push ']), - ('bst pul', 1, ['pull ']), + ('bst artifact ', 2, ARTIFACT_COMMANDS), ('bst source ', 2, SOURCE_COMMANDS), ('bst w ', 1, ['workspace ']), ('bst workspace ', 2, WORKSPACE_COMMANDS), @@ -275,9 +278,8 @@ def test_argument_element_invalid(datafiles, cli, project, cmd, word_idx, expect @pytest.mark.parametrize("cmd,word_idx,expected", [ ('bst he', 1, ['help ']), ('bst help ', 2, MAIN_COMMANDS), + ('bst help artifact ', 3, ARTIFACT_COMMANDS), ('bst help in', 2, ['init ']), - ('bst help p', 2, ['pull ', 'push ']), - ('bst help p', 2, ['pull ', 'push ']), ('bst help source ', 3, SOURCE_COMMANDS), ('bst help w', 2, ['workspace ']), ('bst help workspace ', 3, WORKSPACE_COMMANDS), diff --git a/tests/frontend/help.py b/tests/frontend/help.py index e3b406f56..331eb43c0 100644 --- a/tests/frontend/help.py +++ b/tests/frontend/help.py @@ -18,10 +18,9 @@ def test_help_main(cli): @pytest.mark.parametrize("command", [ + ('artifact'), ('build'), ('checkout'), - ('pull'), - ('push'), ('shell'), ('show'), ('source'), diff --git a/tests/frontend/pull.py b/tests/frontend/pull.py index c883e2030..254b6d584 100644 --- a/tests/frontend/pull.py +++ b/tests/frontend/pull.py @@ -70,7 +70,7 @@ def test_push_pull_all(cli, tmpdir, datafiles): assert cli.get_element_state(project, element_name) != 'cached' # Now try bst pull - result = cli.run(project=project, args=['pull', '--deps', 'all', 'target.bst']) + result = cli.run(project=project, args=['artifact', 'pull', '--deps', 'all', 'target.bst']) result.assert_success() # And assert that it's again in the local cache, without having built @@ -111,7 +111,7 @@ def test_pull_secondary_cache(cli, tmpdir, datafiles): assert cli.get_element_state(project, 'target.bst') != 'cached' # Now try bst pull - result = cli.run(project=project, args=['pull', 'target.bst']) + result = cli.run(project=project, args=['artifact', 'pull', 'target.bst']) result.assert_success() # And assert that it's again in the local cache, without having built, @@ -146,7 +146,7 @@ def test_push_pull_specific_remote(cli, tmpdir, datafiles): # Now try `bst push` to the good_share. result = cli.run(project=project, args=[ - 'push', 'target.bst', '--remote', good_share.repo + 'artifact', 'push', 'target.bst', '--remote', good_share.repo ]) result.assert_success() @@ -161,7 +161,7 @@ def test_push_pull_specific_remote(cli, tmpdir, datafiles): artifacts = os.path.join(cli.directory, 'artifacts') shutil.rmtree(artifacts) - result = cli.run(project=project, args=['pull', 'target.bst', '--remote', + result = cli.run(project=project, args=['artifact', 'pull', 'target.bst', '--remote', good_share.repo]) result.assert_success() @@ -216,7 +216,7 @@ def test_push_pull_non_strict(cli, tmpdir, datafiles): assert cli.get_element_state(project, 'target.bst') == 'waiting' # Now try bst pull - result = cli.run(project=project, args=['pull', '--deps', 'all', 'target.bst']) + result = cli.run(project=project, args=['artifact', 'pull', '--deps', 'all', 'target.bst']) result.assert_success() # And assert that the target is again in the local cache, without having built @@ -291,7 +291,7 @@ def test_push_pull_cross_junction(cli, tmpdir, datafiles): assert cli.get_element_state(project, 'junction.bst:import-etc.bst') == 'buildable' # Now try bst pull - result = cli.run(project=project, args=['pull', 'junction.bst:import-etc.bst']) + result = cli.run(project=project, args=['artifact', 'pull', 'junction.bst:import-etc.bst']) result.assert_success() # And assert that it's again in the local cache, without having built diff --git a/tests/frontend/push.py b/tests/frontend/push.py index 153d43340..6ed163a93 100644 --- a/tests/frontend/push.py +++ b/tests/frontend/push.py @@ -82,7 +82,7 @@ def test_push(cli, tmpdir, datafiles): with create_artifact_share(os.path.join(str(tmpdir), 'artifactshare2')) as share2: # Try pushing with no remotes configured. This should fail. - result = cli.run(project=project, args=['push', 'target.bst']) + result = cli.run(project=project, args=['artifact', 'push', 'target.bst']) result.assert_main_error(ErrorDomain.STREAM, None) # Configure bst to pull but not push from a cache and run `bst push`. @@ -90,7 +90,7 @@ def test_push(cli, tmpdir, datafiles): cli.configure({ 'artifacts': {'url': share1.repo, 'push': False}, }) - result = cli.run(project=project, args=['push', 'target.bst']) + result = cli.run(project=project, args=['artifact', 'push', 'target.bst']) result.assert_main_error(ErrorDomain.STREAM, None) # Configure bst to push to one of the caches and run `bst push`. This works. @@ -100,7 +100,7 @@ def test_push(cli, tmpdir, datafiles): {'url': share2.repo, 'push': True}, ] }) - result = cli.run(project=project, args=['push', 'target.bst']) + result = cli.run(project=project, args=['artifact', 'push', 'target.bst']) assert_not_shared(cli, share1, project, 'target.bst') assert_shared(cli, share2, project, 'target.bst') @@ -114,7 +114,7 @@ def test_push(cli, tmpdir, datafiles): {'url': share2.repo, 'push': True}, ] }) - result = cli.run(project=project, args=['push', 'target.bst']) + result = cli.run(project=project, args=['artifact', 'push', 'target.bst']) assert_shared(cli, share1, project, 'target.bst') assert_shared(cli, share2, project, 'target.bst') @@ -156,7 +156,7 @@ def test_push_all(cli, tmpdir, datafiles): # Now try bst push all the deps result = cli.run(project=project, args=[ - 'push', 'target.bst', + 'artifact', 'push', 'target.bst', '--deps', 'all' ]) result.assert_success() @@ -346,7 +346,7 @@ def test_recently_pulled_artifact_does_not_expire(cli, datafiles, tmpdir): assert cli.get_element_state(project, 'element1.bst') != 'cached' # Pull the element1 from the remote cache (this should update its mtime) - result = cli.run(project=project, args=['pull', 'element1.bst', '--remote', + result = cli.run(project=project, args=['artifact', 'pull', 'element1.bst', '--remote', share.repo]) result.assert_success() @@ -386,7 +386,7 @@ def test_push_cross_junction(cli, tmpdir, datafiles): cli.configure({ 'artifacts': {'url': share.repo, 'push': True}, }) - result = cli.run(project=project, args=['push', 'junction.bst:import-etc.bst']) + result = cli.run(project=project, args=['artifact', 'push', 'junction.bst:import-etc.bst']) cache_key = cli.get_element_key(project, 'junction.bst:import-etc.bst') assert share.has_artifact('subtest', 'import-etc.bst', cache_key) @@ -407,7 +407,7 @@ def test_push_already_cached(caplog, cli, tmpdir, datafiles): result.assert_success() assert "SKIPPED Push" not in result.stderr - result = cli.run(project=project, args=['push', 'target.bst']) + result = cli.run(project=project, args=['artifact', 'push', 'target.bst']) result.assert_success() assert not result.get_pushed_elements(), "No elements should have been pushed since the cache was populated" diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py index 2995bf967..a6189458c 100644 --- a/tests/frontend/workspace.py +++ b/tests/frontend/workspace.py @@ -1106,10 +1106,10 @@ def test_external_push_pull(cli, datafiles, tmpdir_factory, guess_element): 'artifacts': {'url': share.repo, 'push': True} }) - result = cli.run(project=project, args=['-C', workspace, 'push'] + arg_elm) + result = cli.run(project=project, args=['-C', workspace, 'artifact', 'push'] + arg_elm) result.assert_success() - result = cli.run(project=project, args=['-C', workspace, 'pull', '--deps', 'all'] + arg_elm) + result = cli.run(project=project, args=['-C', workspace, 'artifact', 'pull', '--deps', 'all'] + arg_elm) result.assert_success() diff --git a/tests/integration/build-tree.py b/tests/integration/build-tree.py index 8c0628da8..b50d84152 100644 --- a/tests/integration/build-tree.py +++ b/tests/integration/build-tree.py @@ -130,7 +130,8 @@ def test_buildtree_pulled(cli, tmpdir, datafiles): assert cli.get_element_state(project, element_name) != 'cached' # Pull from cache, ensuring cli options is set to pull the buildtree - result = cli.run(project=project, args=['--pull-buildtrees', 'pull', '--deps', 'all', element_name]) + result = cli.run(project=project, + args=['--pull-buildtrees', 'artifact', 'pull', '--deps', 'all', element_name]) result.assert_success() # Check it's using the cached build tree @@ -164,7 +165,7 @@ def test_buildtree_options(cli, tmpdir, datafiles): assert cli.get_element_state(project, element_name) != 'cached' # Pull from cache, but do not include buildtrees. - result = cli.run(project=project, args=['pull', '--deps', 'all', element_name]) + result = cli.run(project=project, args=['artifact', 'pull', '--deps', 'all', element_name]) result.assert_success() # The above is the simplest way I know to create a local cache without any buildtrees. diff --git a/tests/integration/pullbuildtrees.py b/tests/integration/pullbuildtrees.py index 36ac52885..e7ee90eee 100644 --- a/tests/integration/pullbuildtrees.py +++ b/tests/integration/pullbuildtrees.py @@ -55,12 +55,12 @@ def test_pullbuildtrees(cli, tmpdir, datafiles): # Pull artifact with default config, assert that pulling again # doesn't create a pull job, then assert with buildtrees user # config set creates a pull job. - result = cli.run(project=project, args=['pull', element_name]) + result = cli.run(project=project, args=['artifact', 'pull', element_name]) assert element_name in result.get_pulled_elements() - result = cli.run(project=project, args=['pull', element_name]) + result = cli.run(project=project, args=['artifact', 'pull', element_name]) assert element_name not in result.get_pulled_elements() cli.configure({'cache': {'pull-buildtrees': True}}) - result = cli.run(project=project, args=['pull', element_name]) + result = cli.run(project=project, args=['artifact', 'pull', element_name]) assert element_name in result.get_pulled_elements() default_state(cli, tmpdir, share1) @@ -68,13 +68,13 @@ def test_pullbuildtrees(cli, tmpdir, datafiles): # with buildtrees cli flag set creates a pull job. # Also assert that the buildtree is added to the artifact's # extract dir - result = cli.run(project=project, args=['pull', element_name]) + result = cli.run(project=project, args=['artifact', 'pull', element_name]) assert element_name in result.get_pulled_elements() elementdigest = share1.has_artifact('test', element_name, cli.get_element_key(project, element_name)) buildtreedir = os.path.join(str(tmpdir), 'artifacts', 'extract', 'test', 'autotools-amhello', elementdigest.hash, 'buildtree') assert not os.path.isdir(buildtreedir) - result = cli.run(project=project, args=['--pull-buildtrees', 'pull', element_name]) + result = cli.run(project=project, args=['--pull-buildtrees', 'artifact', 'pull', element_name]) assert element_name in result.get_pulled_elements() assert os.path.isdir(buildtreedir) default_state(cli, tmpdir, share1) @@ -83,21 +83,21 @@ def test_pullbuildtrees(cli, tmpdir, datafiles): # that pulling with the same user config doesn't creates a pull job, # or when buildtrees cli flag is set. cli.configure({'cache': {'pull-buildtrees': True}}) - result = cli.run(project=project, args=['pull', element_name]) + result = cli.run(project=project, args=['artifact', 'pull', element_name]) assert element_name in result.get_pulled_elements() - result = cli.run(project=project, args=['pull', element_name]) + result = cli.run(project=project, args=['artifact', 'pull', element_name]) assert element_name not in result.get_pulled_elements() - result = cli.run(project=project, args=['--pull-buildtrees', 'pull', element_name]) + result = cli.run(project=project, args=['--pull-buildtrees', 'artifact', 'pull', element_name]) assert element_name not in result.get_pulled_elements() default_state(cli, tmpdir, share1) # Pull artifact with default config and buildtrees cli flag set, then assert # that pulling with pullbuildtrees set in user config doesn't create a pull # job. - result = cli.run(project=project, args=['--pull-buildtrees', 'pull', element_name]) + result = cli.run(project=project, args=['--pull-buildtrees', 'artifact', 'pull', element_name]) assert element_name in result.get_pulled_elements() cli.configure({'cache': {'pull-buildtrees': True}}) - result = cli.run(project=project, args=['pull', element_name]) + result = cli.run(project=project, args=['artifact', 'pull', element_name]) assert element_name not in result.get_pulled_elements() default_state(cli, tmpdir, share1) @@ -105,10 +105,10 @@ def test_pullbuildtrees(cli, tmpdir, datafiles): # can't be pushed to an artifact share, then assert that a complete build element # can be. This will attempt a partial pull from share1 and then a partial push # to share2 - result = cli.run(project=project, args=['pull', element_name]) + result = cli.run(project=project, args=['artifact', 'pull', element_name]) assert element_name in result.get_pulled_elements() cli.configure({'artifacts': {'url': share2.repo, 'push': True}}) - result = cli.run(project=project, args=['push', element_name]) + result = cli.run(project=project, args=['artifact', 'push', element_name]) assert element_name not in result.get_pushed_elements() assert not share2.has_artifact('test', element_name, cli.get_element_key(project, element_name)) @@ -116,10 +116,10 @@ def test_pullbuildtrees(cli, tmpdir, datafiles): # successfully pushed to the remote. This will attempt to pull the buildtree # from share1 and then a 'complete' push to share2 cli.configure({'artifacts': {'url': share1.repo, 'push': False}}) - result = cli.run(project=project, args=['--pull-buildtrees', 'pull', element_name]) + result = cli.run(project=project, args=['--pull-buildtrees', 'artifact', 'pull', element_name]) assert element_name in result.get_pulled_elements() cli.configure({'artifacts': {'url': share2.repo, 'push': True}}) - result = cli.run(project=project, args=['push', element_name]) + result = cli.run(project=project, args=['artifact', 'push', element_name]) assert element_name in result.get_pushed_elements() assert share2.has_artifact('test', element_name, cli.get_element_key(project, element_name)) default_state(cli, tmpdir, share1) @@ -128,10 +128,10 @@ def test_pullbuildtrees(cli, tmpdir, datafiles): # if pull-buildtrees is set, however as share3 is the only defined remote and is empty, # assert that no element artifact buildtrees are pulled (no available remote buildtree) and thus the # artifact cannot be pushed. - result = cli.run(project=project, args=['pull', element_name]) + result = cli.run(project=project, args=['artifact', 'pull', element_name]) assert element_name in result.get_pulled_elements() cli.configure({'artifacts': {'url': share3.repo, 'push': True}}) - result = cli.run(project=project, args=['--pull-buildtrees', 'push', element_name]) + result = cli.run(project=project, args=['--pull-buildtrees', 'artifact', 'push', element_name]) assert "Attempting to fetch missing artifact buildtrees" in result.stderr assert element_name not in result.get_pulled_elements() assert not os.path.isdir(buildtreedir) @@ -143,7 +143,7 @@ def test_pullbuildtrees(cli, tmpdir, datafiles): # to the empty share3. This gives the ability to attempt push currently partial artifacts to a remote, # without exlipictly requiring a bst pull. cli.configure({'artifacts': [{'url': share1.repo, 'push': False}, {'url': share3.repo, 'push': True}]}) - result = cli.run(project=project, args=['--pull-buildtrees', 'push', element_name]) + result = cli.run(project=project, args=['--pull-buildtrees', 'artifact', 'push', element_name]) assert "Attempting to fetch missing artifact buildtrees" in result.stderr assert element_name in result.get_pulled_elements() assert os.path.isdir(buildtreedir) diff --git a/tests/sandboxes/remote-exec-config.py b/tests/sandboxes/remote-exec-config.py index 31cb072f2..9cf0a8f08 100644 --- a/tests/sandboxes/remote-exec-config.py +++ b/tests/sandboxes/remote-exec-config.py @@ -42,7 +42,7 @@ def test_old_and_new_configs(cli, datafiles): # Use `pull` here to ensure we try to initialize the remotes, triggering the error # # This does not happen for a simple `bst show`. - result = cli.run(project=project, args=['pull', 'element.bst']) + result = cli.run(project=project, args=['artifact', 'pull', 'element.bst']) result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA, "specify one") @@ -97,5 +97,5 @@ def test_empty_config(cli, datafiles): # Use `pull` here to ensure we try to initialize the remotes, triggering the error # # This does not happen for a simple `bst show`. - result = cli.run(project=project, args=['pull', 'element.bst']) + result = cli.run(project=project, args=['artifact', 'pull', 'element.bst']) result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA, "specify one") |