summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/artifactcache/basics.py11
-rw-r--r--tests/context/context.py17
-rw-r--r--tests/project/plugins.py2
-rw-r--r--tests/variables/variables.py2
4 files changed, 13 insertions, 19 deletions
diff --git a/tests/artifactcache/basics.py b/tests/artifactcache/basics.py
index d8c17618b..298ea2a80 100644
--- a/tests/artifactcache/basics.py
+++ b/tests/artifactcache/basics.py
@@ -16,9 +16,8 @@ DATA_DIR = os.path.join(
def pipeline(tmpdir):
context = Context('x86_64')
project = Project(DATA_DIR, 'x86_64')
-
- context.deploydir = os.path.join(str(tmpdir), 'deploy')
context.artifactdir = os.path.join(str(tmpdir), 'artifact')
+ context.builddir = os.path.join(str(tmpdir), 'build')
return Pipeline(context, project, "simple.bst", None)
@@ -34,16 +33,16 @@ def test_empty_extract(pipeline):
def test_commit_extract(pipeline):
- os.makedirs(pipeline.context.deploydir, exist_ok=True)
- with tempfile.TemporaryDirectory(dir=pipeline.context.deploydir) as deploydir:
+ os.makedirs(pipeline.context.builddir, exist_ok=True)
+ with tempfile.TemporaryDirectory(dir=pipeline.context.builddir) as builddir:
# create file as mock build output
- bindir = os.path.join(deploydir, 'bin')
+ bindir = os.path.join(builddir, 'bin')
os.mkdir(bindir)
with open(os.path.join(bindir, 'baz'), 'w') as f:
f.write('hello, world')
# commit build output to artifact cache
- pipeline.artifacts.commit(pipeline.target, deploydir)
+ pipeline.artifacts.commit(pipeline.target, builddir)
assert(pipeline.artifacts.contains(pipeline.target))
diff --git a/tests/context/context.py b/tests/context/context.py
index 121f76fea..76b05acb1 100644
--- a/tests/context/context.py
+++ b/tests/context/context.py
@@ -1,5 +1,6 @@
import os
import pytest
+from xdg import XDG_CACHE_HOME
from buildstream import Context
from buildstream import LoadError, LoadErrorReason
@@ -35,11 +36,10 @@ def test_context_load(context_fixture):
assert(isinstance(context, Context))
context.load()
- assert(context.sourcedir == os.path.expanduser('~/buildstream/sources'))
- assert(context.builddir == os.path.expanduser('~/buildstream/build'))
- assert(context.deploydir == os.path.expanduser('~/buildstream/deploy'))
- assert(context.artifactdir == os.path.expanduser('~/buildstream/artifacts'))
- assert(context.ccachedir == os.path.expanduser('~/buildstream/ccache'))
+ assert(context.sourcedir == os.path.join(XDG_CACHE_HOME, 'buildstream', 'sources'))
+ assert(context.builddir == os.path.join(XDG_CACHE_HOME, 'buildstream', 'build'))
+ assert(context.artifactdir == os.path.join(XDG_CACHE_HOME, 'buildstream', 'artifacts'))
+ assert(context.logdir == os.path.join(XDG_CACHE_HOME, 'buildstream', 'logs'))
# Test that values in a user specified config file
@@ -55,10 +55,9 @@ def test_context_load_user_config(context_fixture, datafiles):
context.load(conf_file)
assert(context.sourcedir == os.path.expanduser('~/pony'))
- assert(context.builddir == os.path.expanduser('~/buildstream/build'))
- assert(context.deploydir == os.path.expanduser('~/buildstream/deploy'))
- assert(context.artifactdir == os.path.expanduser('~/buildstream/artifacts'))
- assert(context.ccachedir == os.path.expanduser('~/buildstream/ccache'))
+ assert(context.builddir == os.path.join(XDG_CACHE_HOME, 'buildstream', 'build'))
+ assert(context.artifactdir == os.path.join(XDG_CACHE_HOME, 'buildstream', 'artifacts'))
+ assert(context.logdir == os.path.join(XDG_CACHE_HOME, 'buildstream', 'logs'))
#######################################
diff --git a/tests/project/plugins.py b/tests/project/plugins.py
index ca6c1ba80..8bc94da9a 100644
--- a/tests/project/plugins.py
+++ b/tests/project/plugins.py
@@ -13,8 +13,6 @@ DATA_DIR = os.path.join(
def create_pipeline(tmpdir, basedir, target, variant):
context = Context('x86_64')
project = Project(basedir, 'x86_64')
-
- context.deploydir = os.path.join(str(tmpdir), 'deploy')
context.artifactdir = os.path.join(str(tmpdir), 'artifact')
return Pipeline(context, project, target, variant)
diff --git a/tests/variables/variables.py b/tests/variables/variables.py
index 90df54120..9f1e1864f 100644
--- a/tests/variables/variables.py
+++ b/tests/variables/variables.py
@@ -12,8 +12,6 @@ DATA_DIR = os.path.join(
def create_pipeline(tmpdir, basedir, target, variant):
context = Context('x86_64')
project = Project(basedir, 'x86_64')
-
- context.deploydir = os.path.join(str(tmpdir), 'deploy')
context.artifactdir = os.path.join(str(tmpdir), 'artifact')
return Pipeline(context, project, target, variant)