diff options
author | Jürg Billeter <j@bitron.ch> | 2019-06-06 12:34:16 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-08-20 08:09:52 +0200 |
commit | e54883ba1fa6a0f4466f2781c148a7744b075a0b (patch) | |
tree | 75e6f619c8fc4dc2a8bc4950c26c8107c071e4c5 /tests/integration | |
parent | 9f36c46a35221b9b1dfeda46048aaeaa0a6d7afa (diff) | |
download | buildstream-e54883ba1fa6a0f4466f2781c148a7744b075a0b.tar.gz |
cascache.py: Start buildbox-casd and set up channel
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/cachedfail.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/integration/cachedfail.py b/tests/integration/cachedfail.py index e3b5b2796..f8dd52aa6 100644 --- a/tests/integration/cachedfail.py +++ b/tests/integration/cachedfail.py @@ -20,7 +20,7 @@ import os import pytest -from buildstream import _yaml +from buildstream import utils, _yaml from buildstream._exceptions import ErrorDomain from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing._utils.site import HAVE_SANDBOX @@ -185,7 +185,12 @@ def test_push_cached_fail(cli, tmpdir, datafiles, on_error): @pytest.mark.skipif(HAVE_SANDBOX != 'bwrap', reason='Only available with bubblewrap on Linux') @pytest.mark.datafiles(DATA_DIR) -def test_host_tools_errors_are_not_cached(cli, datafiles): +def test_host_tools_errors_are_not_cached(cli, datafiles, tmp_path): + # Create symlink to buildbox-casd to work with custom PATH + buildbox_casd = tmp_path.joinpath('bin/buildbox-casd') + buildbox_casd.parent.mkdir() + os.symlink(utils.get_host_tool('buildbox-casd'), str(buildbox_casd)) + project = str(datafiles) element_path = os.path.join(project, 'elements', 'element.bst') @@ -207,7 +212,11 @@ def test_host_tools_errors_are_not_cached(cli, datafiles): _yaml.roundtrip_dump(element, element_path) # Build without access to host tools, this will fail - result1 = cli.run(project=project, args=['build', 'element.bst'], env={'PATH': '', 'BST_FORCE_SANDBOX': None}) + result1 = cli.run( + project=project, + args=['build', 'element.bst'], + env={'PATH': str(tmp_path.joinpath('bin')), + 'BST_FORCE_SANDBOX': None}) result1.assert_task_error(ErrorDomain.SANDBOX, 'unavailable-local-sandbox') assert cli.get_element_state(project, 'element.bst') == 'buildable' |