diff options
author | Chandan Singh <csingh43@bloomberg.net> | 2018-12-07 17:36:00 +0000 |
---|---|---|
committer | Chandan Singh <csingh43@bloomberg.net> | 2018-12-14 19:34:20 +0000 |
commit | 629a6e52410f97edb386e59c48b7a7c28b3bf30a (patch) | |
tree | 43cb5c3c94db5a6bb014d5f61a49c0b571caf6f6 /tests/sources/tar.py | |
parent | 13eb7ed2f356e1f42a8d379e313d55c5d3875d34 (diff) | |
download | buildstream-629a6e52410f97edb386e59c48b7a7c28b3bf30a.tar.gz |
Introduce new "source" command group
Following the message thread
https://mail.gnome.org/archives/buildstream-list/2018-November/msg00106.html,
implement a new command group called `source`. Move existing `track`,
`fetch`, and the recently added `source-checkout` commands under this
group.
For `track` and `fetch`, this is a BREAKING change, as the old commands
have been marked as obsolete. Using them will result in an error message
that refers people to use the new versions, like `bst source fetch`
instead of old `bst fetch`. `source-checkout` will now become
`source checkout` (the dash has turned into a space), and is not a
breaking change as it was added in the current development cycle.
Note that the functionality to hide commands from help output was added
only recently in Click, so the minimum version of Click that we now
require is 7.0.
Summary of changes:
* _frontend/cli.py: Add `source` command group, mark previous versions
as obsolete and hide them from the help output.
* _frontend/complete.py: Fix completion for hidden commands.
* setup.py: Bump Click minimum version to 7.0.
* tests: Update to cope with the new command names.
Fixes #814.
Diffstat (limited to 'tests/sources/tar.py')
-rw-r--r-- | tests/sources/tar.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/sources/tar.py b/tests/sources/tar.py index 1a1f54f87..dc7c85e80 100644 --- a/tests/sources/tar.py +++ b/tests/sources/tar.py @@ -77,7 +77,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles): # Try to fetch it result = cli.run(project=project, args=[ - 'fetch', 'target.bst' + 'source', 'fetch', 'target.bst' ]) assert "FAILURE Try #" in result.stderr result.assert_main_error(ErrorDomain.STREAM, None) @@ -96,7 +96,7 @@ def test_fetch_bad_ref(cli, tmpdir, datafiles): # Try to fetch it result = cli.run(project=project, args=[ - 'fetch', 'target.bst' + 'source', 'fetch', 'target.bst' ]) result.assert_main_error(ErrorDomain.STREAM, None) result.assert_task_error(ErrorDomain.SOURCE, None) @@ -114,7 +114,7 @@ def test_track_warning(cli, tmpdir, datafiles): # Track it result = cli.run(project=project, args=[ - 'track', 'target.bst' + 'source', 'track', 'target.bst' ]) result.assert_success() assert "Potential man-in-the-middle attack!" in result.stderr @@ -133,9 +133,9 @@ def test_stage_default_basedir(cli, tmpdir, datafiles, srcdir): _assemble_tar(os.path.join(str(datafiles), "content"), srcdir, src_tar) # Track, fetch, build, checkout - result = cli.run(project=project, args=['track', 'target.bst']) + result = cli.run(project=project, args=['source', 'track', 'target.bst']) result.assert_success() - result = cli.run(project=project, args=['fetch', 'target.bst']) + result = cli.run(project=project, args=['source', 'fetch', 'target.bst']) result.assert_success() result = cli.run(project=project, args=['build', 'target.bst']) result.assert_success() @@ -162,9 +162,9 @@ def test_stage_no_basedir(cli, tmpdir, datafiles, srcdir): _assemble_tar(os.path.join(str(datafiles), "content"), srcdir, src_tar) # Track, fetch, build, checkout - result = cli.run(project=project, args=['track', 'target.bst']) + result = cli.run(project=project, args=['source', 'track', 'target.bst']) result.assert_success() - result = cli.run(project=project, args=['fetch', 'target.bst']) + result = cli.run(project=project, args=['source', 'fetch', 'target.bst']) result.assert_success() result = cli.run(project=project, args=['build', 'target.bst']) result.assert_success() @@ -191,9 +191,9 @@ def test_stage_explicit_basedir(cli, tmpdir, datafiles, srcdir): _assemble_tar(os.path.join(str(datafiles), "content"), srcdir, src_tar) # Track, fetch, build, checkout - result = cli.run(project=project, args=['track', 'target.bst']) + result = cli.run(project=project, args=['source', 'track', 'target.bst']) result.assert_success() - result = cli.run(project=project, args=['fetch', 'target.bst']) + result = cli.run(project=project, args=['source', 'fetch', 'target.bst']) result.assert_success() result = cli.run(project=project, args=['build', 'target.bst']) result.assert_success() @@ -227,9 +227,9 @@ def test_stage_contains_links(cli, tmpdir, datafiles): _assemble_tar(os.path.join(str(datafiles), "content"), "base-directory", src_tar) # Track, fetch, build, checkout - result = cli.run(project=project, args=['track', 'target.bst']) + result = cli.run(project=project, args=['source', 'track', 'target.bst']) result.assert_success() - result = cli.run(project=project, args=['fetch', 'target.bst']) + result = cli.run(project=project, args=['source', 'fetch', 'target.bst']) result.assert_success() result = cli.run(project=project, args=['build', 'target.bst']) result.assert_success() @@ -256,9 +256,9 @@ def test_stage_default_basedir_lzip(cli, tmpdir, datafiles, srcdir): _assemble_tar_lz(os.path.join(str(datafiles), "content"), srcdir, src_tar) # Track, fetch, build, checkout - result = cli.run(project=project, args=['track', 'target-lz.bst']) + result = cli.run(project=project, args=['source', 'track', 'target-lz.bst']) result.assert_success() - result = cli.run(project=project, args=['fetch', 'target-lz.bst']) + result = cli.run(project=project, args=['source', 'fetch', 'target-lz.bst']) result.assert_success() result = cli.run(project=project, args=['build', 'target-lz.bst']) result.assert_success() @@ -297,9 +297,9 @@ def test_read_only_dir(cli, tmpdir, datafiles): env = {"TMP": tmpdir_str} # Track, fetch, build, checkout - result = cli.run(project=project, args=['track', 'target.bst'], env=env) + result = cli.run(project=project, args=['source', 'track', 'target.bst'], env=env) result.assert_success() - result = cli.run(project=project, args=['fetch', 'target.bst'], env=env) + result = cli.run(project=project, args=['source', 'fetch', 'target.bst'], env=env) result.assert_success() result = cli.run(project=project, args=['build', 'target.bst'], env=env) result.assert_success() @@ -342,9 +342,9 @@ def test_use_netrc(cli, datafiles, server_type, tmpdir): server.start() - result = cli.run(project=project, args=['track', 'target.bst']) + result = cli.run(project=project, args=['source', 'track', 'target.bst']) result.assert_success() - result = cli.run(project=project, args=['fetch', 'target.bst']) + result = cli.run(project=project, args=['source', 'fetch', 'target.bst']) result.assert_success() result = cli.run(project=project, args=['build', 'target.bst']) result.assert_success() @@ -385,6 +385,6 @@ def test_netrc_already_specified_user(cli, datafiles, server_type, tmpdir): server.start() - result = cli.run(project=project, args=['track', 'target.bst']) + result = cli.run(project=project, args=['source', 'track', 'target.bst']) result.assert_main_error(ErrorDomain.STREAM, None) result.assert_task_error(ErrorDomain.SOURCE, None) |