summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbst-marge-bot <marge-bot@buildstream.build>2019-09-13 08:20:43 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-09-13 08:20:43 +0000
commita6574793018107df79404298308721e9b9ef826c (patch)
treecb318f0b4a41dc8f6b8ea24f92eed7d65012ef14
parentc30993ebc677bc665425c8f6810628e1302a6f9e (diff)
parent5a778ca352f2e1e5d4837e826656107db26cff34 (diff)
downloadbuildstream-a6574793018107df79404298308721e9b9ef826c.tar.gz
Merge branch 'jennis/add_deps_all_to_checkout' into 'master'
Support `--deps all` in `artifact checkout` See merge request BuildStream/buildstream!1598
-rw-r--r--src/buildstream/_frontend/cli.py4
-rw-r--r--tests/frontend/buildcheckout.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py
index d657ec76d..f9c3e9546 100644
--- a/src/buildstream/_frontend/cli.py
+++ b/src/buildstream/_frontend/cli.py
@@ -1052,7 +1052,7 @@ def artifact_show(app, deps, artifacts):
@click.option('--force', '-f', is_flag=True,
help="Allow files to be overwritten")
@click.option('--deps', '-d', default='run', show_default=True,
- type=click.Choice(['run', 'build', 'none']),
+ type=click.Choice(['run', 'build', 'none', 'all']),
help='The dependencies to checkout')
@click.option('--integrate/--no-integrate', default=None, is_flag=True,
help="Whether to run integration commands")
@@ -1121,7 +1121,7 @@ def artifact_checkout(app, force, deps, integrate, hardlinks, tar, compression,
if not target:
raise AppError('Missing argument "ELEMENT".')
- scope = {'run': Scope.RUN, 'build': Scope.BUILD, 'none': Scope.NONE}
+ scope = {'run': Scope.RUN, 'build': Scope.BUILD, 'none': Scope.NONE, 'all': Scope.ALL}
app.stream.checkout(target,
location=location,
force=force,
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py
index c9a42239a..7044739a1 100644
--- a/tests/frontend/buildcheckout.py
+++ b/tests/frontend/buildcheckout.py
@@ -158,7 +158,7 @@ def test_build_invalid_filename_chars_dep(datafiles, cli):
@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.parametrize("deps", [("run"), ("none"), ("build")])
+@pytest.mark.parametrize("deps", [("run"), ("none"), ("build"), ("all")])
def test_build_checkout_deps(datafiles, cli, deps):
project = str(datafiles)
checkout = os.path.join(cli.directory, 'checkout')
@@ -187,14 +187,14 @@ def test_build_checkout_deps(datafiles, cli, deps):
# Verify output of this element's build dependencies
filename = os.path.join(checkout, 'usr', 'include', 'pony.h')
- if deps == "build":
+ if deps in ["build", "all"]:
assert os.path.exists(filename)
else:
assert not os.path.exists(filename)
# Verify output of this element's runtime dependencies
filename = os.path.join(checkout, 'usr', 'bin', 'hello')
- if deps == "run":
+ if deps in ["run", "all"]:
assert os.path.exists(filename)
else:
assert not os.path.exists(filename)