summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/completions/completions.py14
-rw-r--r--tests/frontend/cross_junction_workspace.py2
-rw-r--r--tests/frontend/fetch.py16
-rw-r--r--tests/frontend/help.py3
-rw-r--r--tests/frontend/logging.py4
-rw-r--r--tests/frontend/mirror.py30
-rw-r--r--tests/frontend/show.py2
-rw-r--r--tests/frontend/source_checkout.py16
-rw-r--r--tests/frontend/track.py48
-rw-r--r--tests/frontend/track_cross_junction.py11
-rw-r--r--tests/frontend/workspace.py4
-rw-r--r--tests/frontend/yamlcache.py4
-rw-r--r--tests/integration/compose.py2
-rw-r--r--tests/integration/pip_source.py4
-rw-r--r--tests/loader/junctions.py2
-rw-r--r--tests/pipeline/preflight.py2
-rw-r--r--tests/plugins/filter.py10
-rw-r--r--tests/sources/bzr.py2
-rw-r--r--tests/sources/deb.py18
-rw-r--r--tests/sources/git.py44
-rw-r--r--tests/sources/previous_source_access.py4
-rw-r--r--tests/sources/remote.py12
-rw-r--r--tests/sources/tar.py36
-rw-r--r--tests/sources/zip.py22
24 files changed, 160 insertions, 152 deletions
diff --git a/tests/completions/completions.py b/tests/completions/completions.py
index f810c4f08..372ed7840 100644
--- a/tests/completions/completions.py
+++ b/tests/completions/completions.py
@@ -9,15 +9,13 @@ MAIN_COMMANDS = [
'artifact ',
'build ',
'checkout ',
- 'fetch ',
'help ',
'init ',
'pull ',
'push ',
'shell ',
'show ',
- 'source-checkout ',
- 'track ',
+ 'source ',
'workspace '
]
@@ -50,6 +48,12 @@ MAIN_OPTIONS = [
"--version ",
]
+SOURCE_COMMANDS = [
+ 'checkout ',
+ 'fetch ',
+ 'track ',
+]
+
WORKSPACE_COMMANDS = [
'close ',
'list ',
@@ -115,6 +119,7 @@ def assert_completion_failed(cli, cmd, word_idx, expected, cwd=None):
('bst ', 1, MAIN_COMMANDS),
('bst pu', 1, ['pull ', 'push ']),
('bst pul', 1, ['pull ']),
+ ('bst source ', 2, SOURCE_COMMANDS),
('bst w ', 1, ['workspace ']),
('bst workspace ', 2, WORKSPACE_COMMANDS),
])
@@ -267,9 +272,10 @@ 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 fe', 2, ['fetch ']),
+ ('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/cross_junction_workspace.py b/tests/frontend/cross_junction_workspace.py
index ad2a62626..a10eb7421 100644
--- a/tests/frontend/cross_junction_workspace.py
+++ b/tests/frontend/cross_junction_workspace.py
@@ -35,7 +35,7 @@ def prepare_junction_project(cli, tmpdir):
'sources': [sub_repo.source_config(ref=sub_ref)]},
str(main_project.join("sub.bst")))
- args = ['fetch', 'sub.bst']
+ args = ['source', 'fetch', 'sub.bst']
result = cli.run(project=str(main_project), args=args)
result.assert_success()
diff --git a/tests/frontend/fetch.py b/tests/frontend/fetch.py
index e896f4a67..96c4a9335 100644
--- a/tests/frontend/fetch.py
+++ b/tests/frontend/fetch.py
@@ -41,7 +41,7 @@ def test_fetch(cli, tmpdir, datafiles, kind):
assert cli.get_element_state(project, element_name) == 'fetch needed'
# Now try to fetch it
- result = cli.run(project=project, args=['fetch', element_name])
+ result = cli.run(project=project, args=['source', 'fetch', element_name])
result.assert_success()
# Assert that we are now buildable because the source is
@@ -55,7 +55,7 @@ def test_fetch_consistency_error(cli, tmpdir, datafiles):
# When the error occurs outside of the scheduler at load time,
# then the SourceError is reported directly as the main error.
- result = cli.run(project=project, args=['fetch', 'error.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'error.bst'])
result.assert_main_error(ErrorDomain.SOURCE, 'the-consistency-error')
@@ -70,7 +70,7 @@ def test_fetch_consistency_bug(cli, tmpdir, datafiles):
# for a fetch command, we could report this to the user
# more gracefully as a BUG message.
#
- result = cli.run(project=project, args=['fetch', 'bug.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'bug.bst'])
assert result.exc is not None
assert str(result.exc) == "Something went terribly wrong"
@@ -121,7 +121,7 @@ def test_unfetched_junction(cli, tmpdir, datafiles, ref_storage):
# Now try to fetch it, this should automatically result in fetching
# the junction itself.
- result = cli.run(project=project, args=['fetch', 'junction-dep.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'junction-dep.bst'])
result.assert_success()
@@ -155,7 +155,7 @@ def test_inconsistent_junction(cli, tmpdir, datafiles, ref_storage):
# Now try to fetch it, this will bail with the appropriate error
# informing the user to track the junction first
- result = cli.run(project=project, args=['fetch', 'junction-dep.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'junction-dep.bst'])
result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.SUBPROJECT_INCONSISTENT)
@@ -188,10 +188,10 @@ def test_fetch_cross_junction(cli, tmpdir, datafiles, ref_storage, kind):
generate_junction(tmpdir, subproject_path, junction_path, store_ref=(ref_storage == 'inline'))
if ref_storage == 'project.refs':
- result = cli.run(project=project, args=['track', 'junction.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'junction.bst'])
result.assert_success()
- result = cli.run(project=project, args=['track', 'junction.bst:import-etc.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'junction.bst:import-etc.bst'])
result.assert_success()
- result = cli.run(project=project, args=['fetch', 'junction.bst:import-etc.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'junction.bst:import-etc.bst'])
result.assert_success()
diff --git a/tests/frontend/help.py b/tests/frontend/help.py
index 2a0c502e3..e3b406f56 100644
--- a/tests/frontend/help.py
+++ b/tests/frontend/help.py
@@ -20,12 +20,11 @@ def test_help_main(cli):
@pytest.mark.parametrize("command", [
('build'),
('checkout'),
- ('fetch'),
('pull'),
('push'),
('shell'),
('show'),
- ('track'),
+ ('source'),
('workspace')
])
def test_help(cli, command):
diff --git a/tests/frontend/logging.py b/tests/frontend/logging.py
index 733c7e85d..be4b4213b 100644
--- a/tests/frontend/logging.py
+++ b/tests/frontend/logging.py
@@ -38,7 +38,7 @@ def test_default_logging(cli, tmpdir, datafiles):
element_name))
# Now try to fetch it
- result = cli.run(project=project, args=['fetch', element_name])
+ result = cli.run(project=project, args=['source', 'fetch', element_name])
result.assert_success()
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):
element_name))
# Now try to fetch it
- result = cli.run(project=project, args=['fetch', element_name])
+ result = cli.run(project=project, args=['source', 'fetch', element_name])
result.assert_success()
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)
diff --git a/tests/frontend/mirror.py b/tests/frontend/mirror.py
index 91a874335..ccfe2ca30 100644
--- a/tests/frontend/mirror.py
+++ b/tests/frontend/mirror.py
@@ -135,7 +135,7 @@ def test_mirror_fetch(cli, tmpdir, datafiles, kind):
# No obvious ways of checking that the mirror has been fetched
# But at least we can be sure it succeeds
- result = cli.run(project=project_dir, args=['fetch', element_name])
+ result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
result.assert_success()
@@ -211,7 +211,7 @@ def test_mirror_fetch_ref_storage(cli, tmpdir, datafiles, ref_storage, mirror):
project_file = os.path.join(project_dir, 'project.conf')
_yaml.dump(project, project_file)
- result = cli.run(project=project_dir, args=['fetch', element_name])
+ result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
result.assert_success()
@@ -268,7 +268,7 @@ def test_mirror_fetch_upstream_absent(cli, tmpdir, datafiles, kind):
project_file = os.path.join(project_dir, 'project.conf')
_yaml.dump(project, project_file)
- result = cli.run(project=project_dir, args=['fetch', element_name])
+ result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
result.assert_success()
@@ -287,7 +287,7 @@ def test_mirror_fetch_multi(cli, tmpdir, datafiles):
project = generate_project()
_yaml.dump(project, project_file)
- result = cli.run(project=project_dir, args=['fetch', element_name])
+ result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
result.assert_success()
with open(output_file) as f:
contents = f.read()
@@ -310,7 +310,7 @@ def test_mirror_fetch_default_cmdline(cli, tmpdir, datafiles):
project = generate_project()
_yaml.dump(project, project_file)
- result = cli.run(project=project_dir, args=['--default-mirror', 'arrakis', 'fetch', element_name])
+ result = cli.run(project=project_dir, args=['--default-mirror', 'arrakis', 'source', 'fetch', element_name])
result.assert_success()
with open(output_file) as f:
contents = f.read()
@@ -349,7 +349,7 @@ def test_mirror_fetch_default_userconfig(cli, tmpdir, datafiles):
}
cli.configure(userconfig)
- result = cli.run(project=project_dir, args=['fetch', element_name])
+ result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
result.assert_success()
with open(output_file) as f:
contents = f.read()
@@ -388,7 +388,7 @@ def test_mirror_fetch_default_cmdline_overrides_config(cli, tmpdir, datafiles):
}
cli.configure(userconfig)
- result = cli.run(project=project_dir, args=['--default-mirror', 'arrakis', 'fetch', element_name])
+ result = cli.run(project=project_dir, args=['--default-mirror', 'arrakis', 'source', 'fetch', element_name])
result.assert_success()
with open(output_file) as f:
contents = f.read()
@@ -459,7 +459,7 @@ def test_mirror_track_upstream_present(cli, tmpdir, datafiles, kind):
project_file = os.path.join(project_dir, 'project.conf')
_yaml.dump(project, project_file)
- result = cli.run(project=project_dir, args=['track', element_name])
+ result = cli.run(project=project_dir, args=['source', 'track', element_name])
result.assert_success()
# Tracking tries upstream first. Check the ref is from upstream.
@@ -525,7 +525,7 @@ def test_mirror_track_upstream_absent(cli, tmpdir, datafiles, kind):
project_file = os.path.join(project_dir, 'project.conf')
_yaml.dump(project, project_file)
- result = cli.run(project=project_dir, args=['track', element_name])
+ result = cli.run(project=project_dir, args=['source', 'track', element_name])
result.assert_success()
# Check that tracking fell back to the mirror
@@ -604,7 +604,7 @@ def test_mirror_from_includes(cli, tmpdir, datafiles, kind):
# Now make the upstream unavailable.
os.rename(upstream_repo.repo, '{}.bak'.format(upstream_repo.repo))
- result = cli.run(project=project_dir, args=['fetch', element_name])
+ result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
result.assert_success()
@@ -678,11 +678,11 @@ def test_mirror_junction_from_includes(cli, tmpdir, datafiles, kind):
# Now make the upstream unavailable.
os.rename(upstream_repo.repo, '{}.bak'.format(upstream_repo.repo))
- result = cli.run(project=project_dir, args=['fetch', element_name])
+ result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
result.assert_main_error(ErrorDomain.STREAM, None)
# Now make the upstream available again.
os.rename('{}.bak'.format(upstream_repo.repo), upstream_repo.repo)
- result = cli.run(project=project_dir, args=['fetch', element_name])
+ result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
result.assert_success()
@@ -762,7 +762,7 @@ def test_mirror_git_submodule_fetch(cli, tmpdir, datafiles):
project_file = os.path.join(project_dir, 'project.conf')
_yaml.dump(project, project_file)
- result = cli.run(project=project_dir, args=['fetch', element_name])
+ result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
result.assert_success()
@@ -849,7 +849,7 @@ def test_mirror_fallback_git_only_submodules(cli, tmpdir, datafiles):
# Now make the upstream unavailable.
os.rename(upstream_bin_repo.repo, '{}.bak'.format(upstream_bin_repo.repo))
- result = cli.run(project=project_dir, args=['fetch', element_name])
+ result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
result.assert_success()
result = cli.run(project=project_dir, args=['build', element_name])
@@ -945,7 +945,7 @@ def test_mirror_fallback_git_with_submodules(cli, tmpdir, datafiles):
# Now make the upstream unavailable.
os.rename(upstream_main_repo.repo, '{}.bak'.format(upstream_main_repo.repo))
- result = cli.run(project=project_dir, args=['fetch', element_name])
+ result = cli.run(project=project_dir, args=['source', 'fetch', element_name])
result.assert_success()
result = cli.run(project=project_dir, args=['build', element_name])
diff --git a/tests/frontend/show.py b/tests/frontend/show.py
index d6e153e2b..57f04e46d 100644
--- a/tests/frontend/show.py
+++ b/tests/frontend/show.py
@@ -236,7 +236,7 @@ def test_fetched_junction(cli, tmpdir, datafiles, element_name):
_yaml.dump(element, element_path)
result = cli.run(project=project, silent=True, args=[
- 'fetch', 'junction.bst'])
+ 'source', 'fetch', 'junction.bst'])
result.assert_success()
diff --git a/tests/frontend/source_checkout.py b/tests/frontend/source_checkout.py
index f6067498d..d7ff86d70 100644
--- a/tests/frontend/source_checkout.py
+++ b/tests/frontend/source_checkout.py
@@ -50,7 +50,7 @@ def test_source_checkout(datafiles, cli, tmpdir_factory, with_workspace, guess_e
else:
ws_cmd = []
- args = ws_cmd + ['source-checkout', '--deps', 'none'] + elm_cmd + [checkout]
+ args = ws_cmd + ['source', 'checkout', '--deps', 'none'] + elm_cmd + [checkout]
result = cli.run(project=project, args=args)
result.assert_success()
@@ -67,7 +67,7 @@ def test_source_checkout_force(datafiles, cli, force_flag):
os.makedirs(os.path.join(checkout, 'some-thing'))
# Path(os.path.join(checkout, 'some-file')).touch()
- result = cli.run(project=project, args=['source-checkout', force_flag, target, '--deps', 'none', checkout])
+ result = cli.run(project=project, args=['source', 'checkout', force_flag, target, '--deps', 'none', checkout])
result.assert_success()
assert os.path.exists(os.path.join(checkout, 'checkout-deps', 'etc', 'buildstream', 'config'))
@@ -79,7 +79,7 @@ def test_source_checkout_tar(datafiles, cli):
checkout = os.path.join(cli.directory, 'source-checkout.tar')
target = 'checkout-deps.bst'
- result = cli.run(project=project, args=['source-checkout', '--tar', target, '--deps', 'none', checkout])
+ result = cli.run(project=project, args=['source', 'checkout', '--tar', target, '--deps', 'none', checkout])
result.assert_success()
assert os.path.exists(checkout)
@@ -97,7 +97,7 @@ def test_source_checkout_deps(datafiles, cli, deps):
checkout = os.path.join(cli.directory, 'source-checkout')
target = 'checkout-deps.bst'
- result = cli.run(project=project, args=['source-checkout', target, '--deps', deps, checkout])
+ result = cli.run(project=project, args=['source', 'checkout', target, '--deps', deps, checkout])
result.assert_success()
# Sources of the target
@@ -125,7 +125,7 @@ def test_source_checkout_except(datafiles, cli):
checkout = os.path.join(cli.directory, 'source-checkout')
target = 'checkout-deps.bst'
- result = cli.run(project=project, args=['source-checkout', target,
+ result = cli.run(project=project, args=['source', 'checkout', target,
'--deps', 'all',
'--except', 'import-bin.bst',
checkout])
@@ -159,7 +159,7 @@ def test_source_checkout_fetch(datafiles, cli, fetch):
# cached already
assert cli.get_element_state(project, target) == 'fetch needed'
- args = ['source-checkout']
+ args = ['source', 'checkout']
if fetch:
args += ['--fetch']
args += [target, checkout]
@@ -179,7 +179,7 @@ def test_source_checkout_build_scripts(cli, tmpdir, datafiles):
normal_name = 'source-bundle-source-bundle-hello'
checkout = os.path.join(str(tmpdir), 'source-checkout')
- args = ['source-checkout', '--include-build-scripts', element_name, checkout]
+ args = ['source', 'checkout', '--include-build-scripts', element_name, checkout]
result = cli.run(project=project_path, args=args)
result.assert_success()
@@ -196,7 +196,7 @@ def test_source_checkout_tar_buildscripts(cli, tmpdir, datafiles):
normal_name = 'source-bundle-source-bundle-hello'
tar_file = os.path.join(str(tmpdir), 'source-checkout.tar')
- args = ['source-checkout', '--include-build-scripts', '--tar', element_name, tar_file]
+ args = ['source', 'checkout', '--include-build-scripts', '--tar', element_name, tar_file]
result = cli.run(project=project_path, args=args)
result.assert_success()
diff --git a/tests/frontend/track.py b/tests/frontend/track.py
index c7921fe4c..82e8ec4ce 100644
--- a/tests/frontend/track.py
+++ b/tests/frontend/track.py
@@ -52,14 +52,14 @@ def test_track(cli, tmpdir, datafiles, ref_storage, kind):
assert cli.get_element_state(project, element_name) == 'no reference'
# Now first try to track it
- result = cli.run(project=project, args=['track', element_name])
+ result = cli.run(project=project, args=['source', 'track', element_name])
result.assert_success()
# And now fetch it: The Source has probably already cached the
# latest ref locally, but it is not required to have cached
# the associated content of the latest ref at track time, that
# is the job of fetch.
- result = cli.run(project=project, args=['fetch', element_name])
+ result = cli.run(project=project, args=['source', 'fetch', element_name])
result.assert_success()
# Assert that we are now buildable because the source is
@@ -99,7 +99,7 @@ def test_track_recurse(cli, tmpdir, datafiles, kind):
# Now first try to track it
result = cli.run(project=project, args=[
- 'track', '--deps', 'all',
+ 'source', 'track', '--deps', 'all',
element_target_name])
result.assert_success()
@@ -108,7 +108,7 @@ def test_track_recurse(cli, tmpdir, datafiles, kind):
# the associated content of the latest ref at track time, that
# is the job of fetch.
result = cli.run(project=project, args=[
- 'fetch', '--deps', 'all',
+ 'source', 'fetch', '--deps', 'all',
element_target_name])
result.assert_success()
@@ -142,13 +142,13 @@ def test_track_single(cli, tmpdir, datafiles):
# Now first try to track only one element
result = cli.run(project=project, args=[
- 'track', '--deps', 'none',
+ 'source', 'track', '--deps', 'none',
element_target_name])
result.assert_success()
# And now fetch it
result = cli.run(project=project, args=[
- 'fetch', '--deps', 'none',
+ 'source', 'fetch', '--deps', 'none',
element_target_name])
result.assert_success()
@@ -183,7 +183,7 @@ def test_track_recurse_except(cli, tmpdir, datafiles, kind):
# Now first try to track it
result = cli.run(project=project, args=[
- 'track', '--deps', 'all', '--except', element_dep_name,
+ 'source', 'track', '--deps', 'all', '--except', element_dep_name,
element_target_name])
result.assert_success()
@@ -192,7 +192,7 @@ def test_track_recurse_except(cli, tmpdir, datafiles, kind):
# the associated content of the latest ref at track time, that
# is the job of fetch.
result = cli.run(project=project, args=[
- 'fetch', '--deps', 'none',
+ 'source', 'fetch', '--deps', 'none',
element_target_name])
result.assert_success()
@@ -231,9 +231,9 @@ def test_track_optional(cli, tmpdir, datafiles, ref_storage):
#
# We want to track and persist the ref separately in this test
#
- result = cli.run(project=project, args=['--option', 'test', 'False', 'track', 'target.bst'])
+ result = cli.run(project=project, args=['--option', 'test', 'False', 'source', 'track', 'target.bst'])
result.assert_success()
- result = cli.run(project=project, args=['--option', 'test', 'True', 'track', 'target.bst'])
+ result = cli.run(project=project, args=['--option', 'test', 'True', 'source', 'track', 'target.bst'])
result.assert_success()
# Now fetch the key for both options
@@ -309,7 +309,7 @@ def test_track_cross_junction(cli, tmpdir, datafiles, cross_junction, ref_storag
assert get_subproject_element_state() == 'no reference'
# Track recursively across the junction
- args = ['track', '--deps', 'all']
+ args = ['source', 'track', '--deps', 'all']
if cross_junction == 'cross':
args += ['--cross-junctions']
args += ['target.bst']
@@ -350,7 +350,7 @@ def test_track_consistency_error(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
# Track the element causing a consistency error
- result = cli.run(project=project, args=['track', 'error.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'error.bst'])
result.assert_main_error(ErrorDomain.STREAM, None)
result.assert_task_error(ErrorDomain.SOURCE, 'the-consistency-error')
@@ -360,7 +360,7 @@ def test_track_consistency_bug(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
# Track the element causing an unhandled exception
- result = cli.run(project=project, args=['track', 'bug.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'bug.bst'])
# We expect BuildStream to fail gracefully, with no recorded exception.
result.assert_main_error(ErrorDomain.STREAM, None)
@@ -396,7 +396,7 @@ def test_inconsistent_junction(cli, tmpdir, datafiles, ref_storage):
# Now try to track it, this will bail with the appropriate error
# informing the user to track the junction first
- result = cli.run(project=project, args=['track', 'junction-dep.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'junction-dep.bst'])
result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.SUBPROJECT_INCONSISTENT)
@@ -433,7 +433,7 @@ def test_junction_element(cli, tmpdir, datafiles, ref_storage):
result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.SUBPROJECT_INCONSISTENT)
# Now track the junction itself
- result = cli.run(project=project, args=['track', 'junction.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'junction.bst'])
result.assert_success()
# 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):
subproject_path, junction_path, store_ref=False)
# Track the junction itself first.
- result = cli.run(project=project, args=['track', 'junction.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'junction.bst'])
result.assert_success()
assert cli.get_element_state(project, 'junction.bst:import-etc-repo.bst') == 'no reference'
# Track the cross junction element. -J is not given, it is implied.
- result = cli.run(project=project, args=['track', 'junction.bst:import-etc-repo.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'junction.bst:import-etc-repo.bst'])
if ref_storage == 'inline':
# 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):
assert cli.get_element_state(project, element_name) == 'no reference'
# Now first try to track it
- result = cli.run(project=project, args=['track', element_name])
+ result = cli.run(project=project, args=['source', 'track', element_name])
result.assert_success()
# And now fetch it: The Source has probably already cached the
# latest ref locally, but it is not required to have cached
# the associated content of the latest ref at track time, that
# is the job of fetch.
- result = cli.run(project=project, args=['fetch', element_name])
+ result = cli.run(project=project, args=['source', 'fetch', element_name])
result.assert_success()
# 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):
generate_junction(str(tmpdir.join('junction_repo')),
subproject_path, junction_path, store_ref=True)
- result = cli.run(project=project, args=['track', 'junction.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'junction.bst'])
result.assert_success()
# Assert that a fetch is needed
assert cli.get_element_state(project, element_name) == 'no reference'
# Now first try to track it
- result = cli.run(project=project, args=['track', element_name])
+ result = cli.run(project=project, args=['source', 'track', element_name])
# Assert there was a project.refs created, depending on the configuration
if ref_storage == 'inline':
@@ -607,7 +607,7 @@ def test_track_include_junction(cli, tmpdir, datafiles, ref_storage, kind):
# latest ref locally, but it is not required to have cached
# the associated content of the latest ref at track time, that
# is the job of fetch.
- result = cli.run(project=project, args=['fetch', element_name])
+ result = cli.run(project=project, args=['source', 'fetch', element_name])
result.assert_success()
# 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):
generate_junction(str(tmpdir.join('junction_repo')),
subproject_path, junction_path, store_ref=False)
- result = cli.run(project=project, args=['track', 'junction.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'junction.bst'])
result.assert_success()
@@ -663,7 +663,7 @@ def test_track_error_cannot_write_file(cli, tmpdir, datafiles, kind):
read_mask = stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH
os.chmod(element_path, stat.S_IMODE(st.st_mode) & ~read_mask)
- result = cli.run(project=project, args=['track', element_name])
+ result = cli.run(project=project, args=['source', 'track', element_name])
result.assert_main_error(ErrorDomain.STREAM, None)
result.assert_task_error(ErrorDomain.SOURCE, 'save-ref-error')
finally:
diff --git a/tests/frontend/track_cross_junction.py b/tests/frontend/track_cross_junction.py
index 423edbdef..4bbf2db18 100644
--- a/tests/frontend/track_cross_junction.py
+++ b/tests/frontend/track_cross_junction.py
@@ -100,7 +100,7 @@ def test_cross_junction_multiple_projects(cli, tmpdir, datafiles, kind):
generate_junction(tmpdir.join('repo_b'), project_b_path, junction_b_path, store_ref=False)
# Track the junctions.
- result = cli.run(project=project, args=['track', junction_a, junction_b])
+ result = cli.run(project=project, args=['source', 'track', junction_a, junction_b])
result.assert_success()
# Import elements from a and b in to main.
@@ -111,7 +111,10 @@ def test_cross_junction_multiple_projects(cli, tmpdir, datafiles, kind):
all_bst = generate_simple_stack(project, 'all', [imported_a, imported_b, element_c])
# Track without following junctions. But explicitly also track the elements in project a.
- result = cli.run(project=project, args=['track', '--deps', 'all', all_bst, '{}:{}'.format(junction_a, stack_a)])
+ result = cli.run(project=project, args=['source', 'track',
+ '--deps', 'all',
+ all_bst,
+ '{}:{}'.format(junction_a, stack_a)])
result.assert_success()
# 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):
junction_a_path = os.path.join(project, 'elements', junction_a)
generate_junction(tmpdir.join('repo_a'), project_a_path, junction_a_path, store_ref=False)
- result = cli.run(project=project, args=['track', junction_a])
+ result = cli.run(project=project, args=['source', 'track', junction_a])
result.assert_success()
imported_b = generate_cross_element(project, project_a, element_b)
indirection = generate_simple_stack(project, 'indirection', [imported_b])
result = cli.run(project=project,
- args=['track', '--deps', 'all',
+ args=['source', 'track', '--deps', 'all',
'--except', indirection,
'{}:{}'.format(junction_a, all_bst), imported_b])
result.assert_success()
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py
index c95eabccd..00c0bd835 100644
--- a/tests/frontend/workspace.py
+++ b/tests/frontend/workspace.py
@@ -1078,7 +1078,7 @@ def test_external_fetch(cli, datafiles, tmpdir_factory, subdir, guess_element):
else:
call_dir = workspace
- result = cli.run(project=project, args=['-C', call_dir, 'fetch'] + arg_elm)
+ result = cli.run(project=project, args=['-C', call_dir, 'source', 'fetch'] + arg_elm)
result.assert_success()
# We already fetched it by opening the workspace, but we're also checking
@@ -1122,7 +1122,7 @@ def test_external_track(cli, datafiles, tmpdir_factory, guess_element):
# The workspace is necessarily already tracked, so we only care that
# there's no weird errors.
- result = cli.run(project=project, args=['-C', workspace, 'track'] + arg_elm)
+ result = cli.run(project=project, args=['-C', workspace, 'source', 'track'] + arg_elm)
result.assert_success()
diff --git a/tests/frontend/yamlcache.py b/tests/frontend/yamlcache.py
index b6788a07e..20388593e 100644
--- a/tests/frontend/yamlcache.py
+++ b/tests/frontend/yamlcache.py
@@ -82,7 +82,7 @@ def test_yamlcache_used(cli, tmpdir, ref_storage, with_junction, move_project):
# Generate the project
project = generate_project(str(tmpdir), ref_storage, with_junction)
if with_junction == 'junction':
- result = cli.run(project=project, args=['fetch', '--track', 'junction.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', '--track', 'junction.bst'])
result.assert_success()
# bst show to put it in the cache
@@ -118,7 +118,7 @@ def test_yamlcache_changed_file(cli, tmpdir, ref_storage, with_junction):
# Generate the project
project = generate_project(str(tmpdir), ref_storage, with_junction)
if with_junction == 'junction':
- result = cli.run(project=project, args=['fetch', '--track', 'junction.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', '--track', 'junction.bst'])
result.assert_success()
# bst show to put it in the cache
diff --git a/tests/integration/compose.py b/tests/integration/compose.py
index 9d647fae9..36e1da7c4 100644
--- a/tests/integration/compose.py
+++ b/tests/integration/compose.py
@@ -91,7 +91,7 @@ def test_compose_include(cli, tmpdir, datafiles, include_domains,
}
create_compose_element(element_name, element_path, config=config)
- result = cli.run(project=project, args=['track', 'compose/amhello.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'compose/amhello.bst'])
assert result.exit_code == 0
result = cli.run(project=project, args=['build', element_name])
diff --git a/tests/integration/pip_source.py b/tests/integration/pip_source.py
index 709463b7a..d6cbb9893 100644
--- a/tests/integration/pip_source.py
+++ b/tests/integration/pip_source.py
@@ -52,7 +52,7 @@ def test_pip_source_import(cli, tmpdir, datafiles, setup_pypi_repo):
os.makedirs(os.path.dirname(os.path.join(element_path, element_name)), exist_ok=True)
_yaml.dump(element, os.path.join(element_path, element_name))
- result = cli.run(project=project, args=['track', element_name])
+ result = cli.run(project=project, args=['source', 'track', element_name])
assert result.exit_code == 0
result = cli.run(project=project, args=['build', element_name])
@@ -113,7 +113,7 @@ def test_pip_source_build(cli, tmpdir, datafiles, setup_pypi_repo):
os.makedirs(os.path.dirname(os.path.join(element_path, element_name)), exist_ok=True)
_yaml.dump(element, os.path.join(element_path, element_name))
- result = cli.run(project=project, args=['track', element_name])
+ result = cli.run(project=project, args=['source', 'track', element_name])
assert result.exit_code == 0
result = cli.run(project=project, args=['build', element_name])
diff --git a/tests/loader/junctions.py b/tests/loader/junctions.py
index d55d10b3d..66c232b67 100644
--- a/tests/loader/junctions.py
+++ b/tests/loader/junctions.py
@@ -234,7 +234,7 @@ def test_git_show(cli, tmpdir, datafiles):
assert result.exception.reason == LoadErrorReason.SUBPROJECT_FETCH_NEEDED
# Explicitly fetch subproject
- result = cli.run(project=project, args=['fetch', 'base.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'base.bst'])
assert result.exit_code == 0
# Check that bst show succeeds now and the pipeline includes the subproject element
diff --git a/tests/pipeline/preflight.py b/tests/pipeline/preflight.py
index 4692d090e..938f93191 100644
--- a/tests/pipeline/preflight.py
+++ b/tests/pipeline/preflight.py
@@ -15,5 +15,5 @@ def test_load_simple(cli, datafiles, tmpdir):
basedir = os.path.join(datafiles.dirname, datafiles.basename)
# Lets try to fetch it...
- result = cli.run(project=basedir, args=['fetch', 'error.bst'])
+ result = cli.run(project=basedir, args=['source', 'fetch', 'error.bst'])
result.assert_main_error(ErrorDomain.SOURCE, "the-preflight-error")
diff --git a/tests/plugins/filter.py b/tests/plugins/filter.py
index 6dae08544..31b23c124 100644
--- a/tests/plugins/filter.py
+++ b/tests/plugins/filter.py
@@ -227,7 +227,7 @@ def test_filter_track(datafiles, cli, tmpdir):
assert cli.get_element_state(project, input_name) == 'no reference'
# Now try to track it
- result = cli.run(project=project, args=["track", "filter2.bst"])
+ result = cli.run(project=project, args=["source", "track", "filter2.bst"])
result.assert_success()
# Now check that a ref field exists
@@ -280,7 +280,7 @@ def test_filter_track_excepted(datafiles, cli, tmpdir):
assert cli.get_element_state(project, input_name) == 'no reference'
# Now try to track it
- result = cli.run(project=project, args=["track", "filter2.bst", "--except", "input.bst"])
+ result = cli.run(project=project, args=["source", "track", "filter2.bst", "--except", "input.bst"])
result.assert_success()
# Now check that a ref field exists
@@ -333,7 +333,7 @@ def test_filter_track_multi_to_one(datafiles, cli, tmpdir):
assert cli.get_element_state(project, input_name) == 'no reference'
# Now try to track it
- result = cli.run(project=project, args=["track", "filter1.bst", "filter2.bst"])
+ result = cli.run(project=project, args=["source", "track", "filter1.bst", "filter2.bst"])
result.assert_success()
# Now check that a ref field exists
@@ -392,7 +392,7 @@ def test_filter_track_multi(datafiles, cli, tmpdir):
assert cli.get_element_state(project, input2_name) == 'no reference'
# Now try to track it
- result = cli.run(project=project, args=["track", "filter1.bst", "filter2.bst"])
+ result = cli.run(project=project, args=["source", "track", "filter1.bst", "filter2.bst"])
result.assert_success()
# Now check that a ref field exists
@@ -453,7 +453,7 @@ def test_filter_track_multi_exclude(datafiles, cli, tmpdir):
assert cli.get_element_state(project, input2_name) == 'no reference'
# Now try to track it
- result = cli.run(project=project, args=["track", "filter1.bst", "filter2.bst", "--except", input_name])
+ result = cli.run(project=project, args=["source", "track", "filter1.bst", "filter2.bst", "--except", input_name])
result.assert_success()
# Now check that a ref field exists
diff --git a/tests/sources/bzr.py b/tests/sources/bzr.py
index 4675aec05..9895180e0 100644
--- a/tests/sources/bzr.py
+++ b/tests/sources/bzr.py
@@ -32,7 +32,7 @@ def test_fetch_checkout(cli, tmpdir, datafiles):
_yaml.dump(element, os.path.join(project, 'target.bst'))
# Fetch, build, checkout
- result = cli.run(project=project, args=['fetch', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
assert result.exit_code == 0
result = cli.run(project=project, args=['build', 'target.bst'])
assert result.exit_code == 0
diff --git a/tests/sources/deb.py b/tests/sources/deb.py
index b5b031161..b925fc9e9 100644
--- a/tests/sources/deb.py
+++ b/tests/sources/deb.py
@@ -54,7 +54,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)
@@ -72,7 +72,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)
@@ -90,7 +90,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
@@ -108,9 +108,9 @@ def test_stage_default_basedir(cli, tmpdir, datafiles):
_copy_deb(DATA_DIR, tmpdir)
# 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()
@@ -136,9 +136,9 @@ def test_stage_no_basedir(cli, tmpdir, datafiles):
_copy_deb(DATA_DIR, tmpdir)
# 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()
@@ -164,9 +164,9 @@ def test_stage_explicit_basedir(cli, tmpdir, datafiles):
_copy_deb(DATA_DIR, tmpdir)
# 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()
diff --git a/tests/sources/git.py b/tests/sources/git.py
index c9e806269..f9aa62ba4 100644
--- a/tests/sources/git.py
+++ b/tests/sources/git.py
@@ -58,7 +58,7 @@ def test_fetch_bad_ref(cli, tmpdir, datafiles):
# Assert that fetch raises an error here
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)
@@ -91,7 +91,7 @@ def test_submodule_fetch_checkout(cli, tmpdir, datafiles):
_yaml.dump(element, os.path.join(project, 'target.bst'))
# Fetch, build, checkout
- 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()
@@ -130,7 +130,7 @@ def test_submodule_fetch_source_enable_explicit(cli, tmpdir, datafiles):
_yaml.dump(element, os.path.join(project, 'target.bst'))
# Fetch, build, checkout
- 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()
@@ -169,7 +169,7 @@ def test_submodule_fetch_source_disable(cli, tmpdir, datafiles):
_yaml.dump(element, os.path.join(project, 'target.bst'))
# Fetch, build, checkout
- 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()
@@ -208,7 +208,7 @@ def test_submodule_fetch_submodule_does_override(cli, tmpdir, datafiles):
_yaml.dump(element, os.path.join(project, 'target.bst'))
# Fetch, build, checkout
- 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()
@@ -252,7 +252,7 @@ def test_submodule_fetch_submodule_individual_checkout(cli, tmpdir, datafiles):
_yaml.dump(element, os.path.join(project, 'target.bst'))
# Fetch, build, checkout
- 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()
@@ -297,7 +297,7 @@ def test_submodule_fetch_submodule_individual_checkout_explicit(cli, tmpdir, dat
_yaml.dump(element, os.path.join(project, 'target.bst'))
# Fetch, build, checkout
- 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()
@@ -337,7 +337,7 @@ def test_submodule_fetch_project_override(cli, tmpdir, datafiles):
_yaml.dump(element, os.path.join(project, 'target.bst'))
# Fetch, build, checkout
- 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()
@@ -375,11 +375,11 @@ def test_submodule_track_ignore_inconsistent(cli, tmpdir, datafiles):
repo.add_file(os.path.join(project, 'inconsistent-submodule', '.gitmodules'))
# Fetch should work, we're not yet at the offending ref
- result = cli.run(project=project, args=['fetch', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
result.assert_success()
# Track will encounter an inconsistent submodule without any ref
- result = cli.run(project=project, args=['track', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'target.bst'])
result.assert_success()
# Assert that we are just fine without it, and emit a warning to the user.
@@ -508,7 +508,7 @@ def test_unlisted_submodule(cli, tmpdir, datafiles, fail):
# We will notice this directly in fetch, as it will try to fetch
# the submodules it discovers as a result of fetching the primary repo.
- result = cli.run(project=project, args=['fetch', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
# Assert a warning or an error depending on what we're checking
if fail == 'error':
@@ -571,19 +571,19 @@ def test_track_unlisted_submodule(cli, tmpdir, datafiles, fail):
# Fetch the repo, we will not see the warning because we
# are still pointing to a ref which predates the submodules
- result = cli.run(project=project, args=['fetch', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
result.assert_success()
assert "git:unlisted-submodule" not in result.stderr
# We won't get a warning/error when tracking either, the source
# has not become Consistency.CACHED so the opportunity to check
# for the warning has not yet arisen.
- result = cli.run(project=project, args=['track', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'target.bst'])
result.assert_success()
assert "git:unlisted-submodule" not in result.stderr
# Fetching the repo at the new ref will finally reveal the warning
- result = cli.run(project=project, args=['fetch', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
if fail == 'error':
result.assert_main_error(ErrorDomain.STREAM, None)
result.assert_task_error(ErrorDomain.PLUGIN, 'git:unlisted-submodule')
@@ -642,7 +642,7 @@ def test_invalid_submodule(cli, tmpdir, datafiles, fail):
# We will notice this directly in fetch, as it will try to fetch
# the submodules it discovers as a result of fetching the primary repo.
- result = cli.run(project=project, args=['fetch', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
# Assert a warning or an error depending on what we're checking
if fail == 'error':
@@ -706,7 +706,7 @@ def test_track_invalid_submodule(cli, tmpdir, datafiles, fail):
# Fetch the repo, we will not see the warning because we
# are still pointing to a ref which predates the submodules
- result = cli.run(project=project, args=['fetch', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
result.assert_success()
assert "git:invalid-submodule" not in result.stderr
@@ -715,7 +715,7 @@ def test_track_invalid_submodule(cli, tmpdir, datafiles, fail):
# not locally cached, the Source will be CACHED directly after
# tracking and the validations will occur as a result.
#
- result = cli.run(project=project, args=['track', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'target.bst'])
if fail == 'error':
result.assert_main_error(ErrorDomain.STREAM, None)
result.assert_task_error(ErrorDomain.PLUGIN, 'git:invalid-submodule')
@@ -751,7 +751,7 @@ def test_track_fetch(cli, tmpdir, datafiles, ref_format, tag, extra_commit):
_yaml.dump(element, element_path)
# Track it
- result = cli.run(project=project, args=['track', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'target.bst'])
result.assert_success()
element = _yaml.load(element_path)
@@ -767,7 +767,7 @@ def test_track_fetch(cli, tmpdir, datafiles, ref_format, tag, extra_commit):
assert len(new_ref) == 40
# Fetch it
- result = cli.run(project=project, args=['fetch', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'fetch', 'target.bst'])
result.assert_success()
@@ -835,10 +835,10 @@ def test_git_describe(cli, tmpdir, datafiles, ref_storage, tag_type):
_yaml.dump(element, element_path)
if ref_storage == 'inline':
- result = cli.run(project=project, args=['track', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'target.bst'])
result.assert_success()
else:
- result = cli.run(project=project, args=['track', 'target.bst', '--deps', 'all'])
+ result = cli.run(project=project, args=['source', 'track', 'target.bst', '--deps', 'all'])
result.assert_success()
if ref_storage == 'inline':
@@ -916,7 +916,7 @@ def test_default_do_not_track_tags(cli, tmpdir, datafiles):
element_path = os.path.join(project, 'target.bst')
_yaml.dump(element, element_path)
- result = cli.run(project=project, args=['track', 'target.bst'])
+ result = cli.run(project=project, args=['source', 'track', 'target.bst'])
result.assert_success()
element = _yaml.load(element_path)
diff --git a/tests/sources/previous_source_access.py b/tests/sources/previous_source_access.py
index f7045383c..f090ac8a0 100644
--- a/tests/sources/previous_source_access.py
+++ b/tests/sources/previous_source_access.py
@@ -19,13 +19,13 @@ def test_custom_transform_source(cli, tmpdir, datafiles):
# Ensure we can track
result = cli.run(project=project, args=[
- 'track', 'target.bst'
+ 'source', 'track', 'target.bst'
])
result.assert_success()
# Ensure we can fetch
result = cli.run(project=project, args=[
- 'fetch', 'target.bst'
+ 'source', 'fetch', 'target.bst'
])
result.assert_success()
diff --git a/tests/sources/remote.py b/tests/sources/remote.py
index a4a9d5965..6062c9cbc 100644
--- a/tests/sources/remote.py
+++ b/tests/sources/remote.py
@@ -50,7 +50,7 @@ def test_missing_file(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)
@@ -64,7 +64,7 @@ def test_path_in_filename(cli, tmpdir, datafiles):
# Try to fetch it
result = cli.run(project=project, args=[
- 'fetch', 'target.bst'
+ 'source', 'fetch', 'target.bst'
])
# The bst file has a / in the filename param
@@ -79,7 +79,7 @@ def test_simple_file_build(cli, tmpdir, datafiles):
# Try to fetch it
result = cli.run(project=project, args=[
- 'fetch', 'target.bst'
+ 'source', 'fetch', 'target.bst'
])
result.assert_success()
@@ -112,7 +112,7 @@ def test_simple_file_custom_name_build(cli, tmpdir, datafiles):
# Try to fetch it
result = cli.run(project=project, args=[
- 'fetch', 'target.bst'
+ 'source', 'fetch', 'target.bst'
])
result.assert_success()
@@ -141,7 +141,7 @@ def test_unique_key(cli, tmpdir, datafiles):
assert cli.get_element_state(project, 'target-custom-executable.bst') == "fetch needed"
# Try to fetch it
result = cli.run(project=project, args=[
- 'fetch', 'target.bst'
+ 'source', 'fetch', 'target.bst'
])
# We should download the file only once
@@ -198,7 +198,7 @@ def test_use_netrc(cli, datafiles, server_type, tmpdir):
server.start()
- 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()
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)
diff --git a/tests/sources/zip.py b/tests/sources/zip.py
index 6ad6d4077..36e033427 100644
--- a/tests/sources/zip.py
+++ b/tests/sources/zip.py
@@ -62,7 +62,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)
@@ -81,7 +81,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)
@@ -99,7 +99,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
@@ -117,9 +117,9 @@ def test_stage_default_basedir(cli, tmpdir, datafiles):
_assemble_zip(os.path.join(str(datafiles), "content"), src_zip)
# 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()
@@ -145,9 +145,9 @@ def test_stage_no_basedir(cli, tmpdir, datafiles):
_assemble_zip(os.path.join(str(datafiles), "content"), src_zip)
# 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()
@@ -173,9 +173,9 @@ def test_stage_explicit_basedir(cli, tmpdir, datafiles):
_assemble_zip(os.path.join(str(datafiles), "content"), src_zip)
# 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()
@@ -215,9 +215,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()