From 07275d01416b204bd578c1c3617fcbed8b6e30ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Wed, 3 Jun 2020 11:37:14 +0200 Subject: Drop sandbox selection and BST_FORCE_SANDBOX buildbox-run is the only local sandbox and there are no plans to add other sandboxing backends in the future. New platforms can be supported by new buildbox-run implementations without requiring any changes in BuildStream. --- tests/integration/cachedfail.py | 6 +----- tests/sandboxes/missing_dependencies.py | 4 +--- tests/sandboxes/selection.py | 30 +----------------------------- 3 files changed, 3 insertions(+), 37 deletions(-) (limited to 'tests') diff --git a/tests/integration/cachedfail.py b/tests/integration/cachedfail.py index 68c59569d..f72c315d5 100644 --- a/tests/integration/cachedfail.py +++ b/tests/integration/cachedfail.py @@ -202,11 +202,7 @@ def test_host_tools_errors_are_not_cached(cli, datafiles, tmp_path): _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": str(tmp_path.joinpath("bin")), "BST_FORCE_SANDBOX": None}, - ) + result1 = cli.run(project=project, args=["build", "element.bst"], env={"PATH": str(tmp_path.joinpath("bin"))},) result1.assert_task_error(ErrorDomain.SANDBOX, "unavailable-local-sandbox") assert cli.get_element_state(project, "element.bst") == "buildable" diff --git a/tests/sandboxes/missing_dependencies.py b/tests/sandboxes/missing_dependencies.py index fb9fdafb9..7ac7d7868 100644 --- a/tests/sandboxes/missing_dependencies.py +++ b/tests/sandboxes/missing_dependencies.py @@ -41,8 +41,6 @@ def test_missing_buildbox_run_has_nice_error_message(cli, datafiles, tmp_path): _yaml.roundtrip_dump(element, element_path) # Build without access to host tools, this should fail with a nice error - result = cli.run( - project=project, args=["build", "element.bst"], env={"PATH": str(bin_dir), "BST_FORCE_SANDBOX": None} - ) + result = cli.run(project=project, args=["build", "element.bst"], env={"PATH": str(bin_dir)}) result.assert_task_error(ErrorDomain.SANDBOX, "unavailable-local-sandbox") assert "not found" in result.stderr diff --git a/tests/sandboxes/selection.py b/tests/sandboxes/selection.py index 3e6e1c4f5..0118fb5e0 100644 --- a/tests/sandboxes/selection.py +++ b/tests/sandboxes/selection.py @@ -29,30 +29,6 @@ pytestmark = pytest.mark.integration DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project") -@pytest.mark.datafiles(DATA_DIR) -def test_force_sandbox(cli, datafiles): - project = str(datafiles) - element_path = os.path.join(project, "elements", "element.bst") - - # Write out our test target - element = { - "kind": "script", - "depends": [{"filename": "base.bst", "type": "build",},], - "config": {"commands": ["true",],}, - } - _yaml.roundtrip_dump(element, element_path) - - # Build without access to host tools, this will fail - result = cli.run( - project=project, args=["build", "element.bst"], env={"PATH": "", "BST_FORCE_SANDBOX": "buildbox-run"} - ) - result.assert_main_error(ErrorDomain.PLATFORM, None) - assert "buildbox-run not found" in result.stderr - # we have asked for a spesific sand box, but it is not avalble so - # bst should fail early and the element should be waiting - assert cli.get_element_state(project, "element.bst") == "waiting" - - @pytest.mark.datafiles(DATA_DIR) def test_dummy_sandbox_fallback(cli, datafiles, tmp_path): # Create symlink to buildbox-casd to work with custom PATH @@ -72,11 +48,7 @@ def test_dummy_sandbox_fallback(cli, datafiles, tmp_path): _yaml.roundtrip_dump(element, element_path) # Build without access to host tools, this will fail - result = cli.run( - project=project, - args=["build", "element.bst"], - env={"PATH": str(tmp_path.joinpath("bin")), "BST_FORCE_SANDBOX": None}, - ) + result = cli.run(project=project, args=["build", "element.bst"], env={"PATH": str(tmp_path.joinpath("bin"))},) # But if we dont spesify a sandbox then we fall back to dummy, we still # fail early but only once we know we need a facny sandbox and that # dumy is not enough, there for element gets fetched and so is buildable -- cgit v1.2.1