summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2018-12-06 17:46:33 +0000
committerJonathan Maw <jonathan.maw@codethink.co.uk>2018-12-06 17:46:33 +0000
commit2a6879a540ef28f4298f10e19924992bd179aea1 (patch)
treeef029c0c2c9ad24ddf8cb7cfdfcb79669fc94be0
parent60e9678117183b3a7762dd592fc3be16f1ea57ce (diff)
parent7fe5514349ba7c70dc6129b4cc05dcb371527800 (diff)
downloadbuildstream-2a6879a540ef28f4298f10e19924992bd179aea1.tar.gz
Merge branch 'jonathan/source-checkout-workspace' into 'master'
Fix bst source-checkout not working with open workspaces Closes #807 See merge request BuildStream/buildstream!997
-rw-r--r--buildstream/_stream.py2
-rw-r--r--tests/frontend/source_checkout.py9
2 files changed, 9 insertions, 2 deletions
diff --git a/buildstream/_stream.py b/buildstream/_stream.py
index 6a3d2c7fc..6f298c259 100644
--- a/buildstream/_stream.py
+++ b/buildstream/_stream.py
@@ -1199,7 +1199,7 @@ class Stream():
element_source_dir = self._get_element_dirname(directory, element)
if list(element.sources()):
os.makedirs(element_source_dir)
- element._stage_sources_at(element_source_dir)
+ element._stage_sources_at(element_source_dir, mount_workspaces=False)
# Write a master build script to the sandbox
def _write_build_script(self, directory, elements):
diff --git a/tests/frontend/source_checkout.py b/tests/frontend/source_checkout.py
index 58dfdbd42..4e7541a31 100644
--- a/tests/frontend/source_checkout.py
+++ b/tests/frontend/source_checkout.py
@@ -28,10 +28,17 @@ def generate_remote_import_element(input_path, output_path):
@pytest.mark.datafiles(DATA_DIR)
-def test_source_checkout(datafiles, cli):
+@pytest.mark.parametrize('with_workspace', [('workspace'), ('no-workspace')])
+def test_source_checkout(datafiles, tmpdir_factory, cli, with_workspace):
+ tmpdir = tmpdir_factory.mktemp("")
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'source-checkout')
target = 'checkout-deps.bst'
+ workspace = os.path.join(str(tmpdir), 'workspace')
+
+ if with_workspace == "workspace":
+ result = cli.run(project=project, args=['workspace', 'open', '--directory', workspace, target])
+ result.assert_success()
result = cli.run(project=project, args=['source-checkout', target, '--deps', 'none', checkout])
result.assert_success()