summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2020-10-09 10:53:24 +0000
committerBenjamin Schubert <1593324-BenjaminSchubert@users.noreply.gitlab.com>2020-10-26 14:22:00 +0000
commit82e026543d218df258faaa7a2b2ff3f725b5f415 (patch)
tree905932b1e238c55274e53ea3fc53acc989a879eb
parent1263d86e06390d49a92666ed31a36a5d6338eea0 (diff)
downloadbuildstream-bschubert/simplify-workspace-test.tar.gz
workspace.py: Don't use the same directory for everythingbschubert/simplify-workspace-test
-rw-r--r--src/buildstream/testing/_sourcetests/workspace.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/buildstream/testing/_sourcetests/workspace.py b/src/buildstream/testing/_sourcetests/workspace.py
index 64b59d865..9edd9d994 100644
--- a/src/buildstream/testing/_sourcetests/workspace.py
+++ b/src/buildstream/testing/_sourcetests/workspace.py
@@ -33,7 +33,7 @@ DATA_DIR = os.path.join(TOP_DIR, "project")
@pytest.mark.datafiles(DATA_DIR)
-def test_open(cli, tmpdir, datafiles, kind):
+def test_open(cli, tmpdir_factory, datafiles, kind):
project_path = str(datafiles)
bin_files_path = os.path.join(project_path, "files", "bin-files")
@@ -42,7 +42,7 @@ def test_open(cli, tmpdir, datafiles, kind):
# Create our repo object of the given source type with
# the bin files, and then collect the initial ref.
- repo = create_repo(kind, str(tmpdir))
+ repo = create_repo(kind, str(tmpdir_factory.mktemp("repo-{}".format(kind))))
ref = repo.create(bin_files_path)
# Write out our test target
@@ -52,10 +52,7 @@ def test_open(cli, tmpdir, datafiles, kind):
# Assert that there is no reference, a fetch is needed
assert cli.get_element_state(project_path, element_name) == "fetch needed"
- workspace_cmd = os.path.join(project_path, "workspace_cmd")
- os.makedirs(workspace_cmd, exist_ok=True)
- # remove the '.bst' at the end of the element
- workspace_dir = os.path.join(workspace_cmd, element_name[:-4])
+ workspace_dir = os.path.join(tmpdir_factory.mktemp("opened_workspace"))
# Now open the workspace, this should have the effect of automatically
# fetching the source from the repo.