summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Smith <qinusty@gmail.com>2018-09-20 13:19:18 +0100
committerTristan Maat <tristan.maat@codethink.co.uk>2018-10-03 14:03:25 +0100
commita88396f4f1401d484c7631241927e7599c3e372e (patch)
tree048561e5849f2d02dcabd45b42ee8a53709f8e0e
parente6d37335f4cba910ac030ad42fc09f0288d95aa9 (diff)
downloadbuildstream-Qinusty/634-workspace-failed-builds.tar.gz
testing: Add regression test for workspace bugQinusty/634-workspace-failed-builds
-rw-r--r--tests/frontend/workspace.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py
index 47d3b6a85..51b7d6088 100644
--- a/tests/frontend/workspace.py
+++ b/tests/frontend/workspace.py
@@ -43,7 +43,8 @@ DATA_DIR = os.path.join(
)
-def open_workspace(cli, tmpdir, datafiles, kind, track, suffix='', workspace_dir=None, project_path=None):
+def open_workspace(cli, tmpdir, datafiles, kind, track, suffix='', workspace_dir=None,
+ project_path=None, element_attrs=None):
if not workspace_dir:
workspace_dir = os.path.join(str(tmpdir), 'workspace{}'.format(suffix))
if not project_path:
@@ -69,6 +70,8 @@ def open_workspace(cli, tmpdir, datafiles, kind, track, suffix='', workspace_dir
repo.source_config(ref=ref)
]
}
+ if element_attrs:
+ element = {**element, **element_attrs}
_yaml.dump(element,
os.path.join(element_path,
element_name))
@@ -854,3 +857,22 @@ def test_cache_key_workspace_in_dependencies(cli, tmpdir, datafiles, strict):
# Check that the original /usr/bin/hello is not in the checkout
assert not os.path.exists(os.path.join(checkout, 'usr', 'bin', 'hello'))
+
+
+@pytest.mark.datafiles(DATA_DIR)
+def test_multiple_failed_builds(cli, tmpdir, datafiles):
+ element_config = {
+ "kind": "manual",
+ "config": {
+ "configure-commands": [
+ "unknown_command_that_will_fail"
+ ]
+ }
+ }
+ element_name, project, _ = open_workspace(cli, tmpdir, datafiles,
+ "git", False, element_attrs=element_config)
+
+ for _ in range(2):
+ result = cli.run(project=project, args=["build", element_name])
+ assert "BUG" not in result.stderr
+ assert cli.get_element_state(project, element_name) != "cached"