summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2018-09-28 17:52:01 +0100
committerJonathan Maw <jonathan.maw@codethink.co.uk>2018-10-30 15:42:05 +0000
commit09ef8b254342638e828378c2f785963bcf9487da (patch)
tree4132093d332c34110e5725fe27527a73d41798cf
parentbaf6b57823dd49565d7c39ca33d07949e97ccaf2 (diff)
downloadbuildstream-09ef8b254342638e828378c2f785963bcf9487da.tar.gz
element.py: Always clean up the rootdir
We shouldn't need it to persist now that we cache failed build dirs. This change breaks the test `tests/integration/shell.py::test_sysroot_workspace_visible`. I can no longer see a use-case for this test. AIUI, it tested that the failed build sysroot stored in the builddir has the workspace's files in, despite the workspace being unmounted. I believe this behaviour is made redundant by cached buildtrees. This fixes part of #539
-rw-r--r--buildstream/element.py4
-rw-r--r--tests/integration/shell.py42
2 files changed, 2 insertions, 44 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 4d3e1bc75..848730529 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1683,8 +1683,8 @@ class Element(Plugin):
"unable to collect artifact contents"
.format(collect))
- # Finally cleanup the build dir
- cleanup_rootdir()
+ # Finally cleanup the build dir
+ cleanup_rootdir()
return artifact_size
diff --git a/tests/integration/shell.py b/tests/integration/shell.py
index 947650ff1..cd3c1a977 100644
--- a/tests/integration/shell.py
+++ b/tests/integration/shell.py
@@ -302,48 +302,6 @@ def test_workspace_visible(cli, tmpdir, datafiles):
assert result.output == workspace_hello
-# Test that we can see the workspace files in a shell
-@pytest.mark.integration
-@pytest.mark.datafiles(DATA_DIR)
-def test_sysroot_workspace_visible(cli, tmpdir, datafiles):
- project = os.path.join(datafiles.dirname, datafiles.basename)
- workspace = os.path.join(cli.directory, 'workspace')
- element_name = 'workspace/workspace-mount-fail.bst'
-
- # Open a workspace on our build failing element
- #
- res = cli.run(project=project, args=['workspace', 'open', element_name, workspace])
- assert res.exit_code == 0
-
- # Ensure the dependencies of our build failing element are built
- result = cli.run(project=project, args=['build', element_name])
- result.assert_main_error(ErrorDomain.STREAM, None)
-
- # Discover the sysroot of the failed build directory, after one
- # failed build, there should be only one directory there.
- #
- build_base = os.path.join(cli.directory, 'build')
- build_dirs = os.listdir(path=build_base)
- assert len(build_dirs) == 1
- build_dir = os.path.join(build_base, build_dirs[0])
-
- # Obtain a copy of the hello.c content from the workspace
- #
- workspace_hello_path = os.path.join(cli.directory, 'workspace', 'hello.c')
- assert os.path.exists(workspace_hello_path)
- with open(workspace_hello_path, 'r') as f:
- workspace_hello = f.read()
-
- # Cat the hello.c file from a bst shell command, and assert
- # that we got the same content here
- #
- result = cli.run(project=project, args=[
- 'shell', '--build', '--sysroot', build_dir, element_name, '--', 'cat', 'hello.c'
- ])
- assert result.exit_code == 0
- assert result.output == workspace_hello
-
-
# Test system integration commands can access devices in /dev
@pytest.mark.datafiles(DATA_DIR)
def test_integration_devices(cli, tmpdir, datafiles):