summaryrefslogtreecommitdiff
path: root/tests/frontend/workspace.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-05 14:58:17 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-05 15:16:15 +0900
commitdaffe49827e1d462a6aa230afcd188645198dfea (patch)
tree783874ca1695ce403fab784ad01e876a2ab1c131 /tests/frontend/workspace.py
parent9012a5ed2f94704a99b3a2ac8f673160fca86668 (diff)
downloadbuildstream-daffe49827e1d462a6aa230afcd188645198dfea.tar.gz
tests/frontend/workspace.py: Exercise the build test in strict and non-strict mode
This test fails without the previous patch fixing issue #316, so this should guard against regressions of building and caching workspace builds in non-strict mode.
Diffstat (limited to 'tests/frontend/workspace.py')
-rw-r--r--tests/frontend/workspace.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py
index db3db3e13..2dc8d2ab5 100644
--- a/tests/frontend/workspace.py
+++ b/tests/frontend/workspace.py
@@ -196,7 +196,8 @@ def test_list(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("kind", repo_kinds)
-def test_build(cli, tmpdir, datafiles, kind):
+@pytest.mark.parametrize("strict", [("strict"), ("non-strict")])
+def test_build(cli, tmpdir, datafiles, kind, strict):
element_name, project, workspace = open_workspace(cli, tmpdir, datafiles, kind, False)
checkout = os.path.join(str(tmpdir), 'checkout')
@@ -206,6 +207,18 @@ def test_build(cli, tmpdir, datafiles, kind):
with open(os.path.join(workspace, 'etc', 'pony.conf'), 'w') as f:
f.write("PONY='pink'")
+ # Configure strict mode
+ strict_mode = True
+ if strict != 'strict':
+ strict_mode = False
+ cli.configure({
+ 'projects': {
+ 'test': {
+ 'strict': strict_mode
+ }
+ }
+ })
+
# Build modified workspace
assert cli.get_element_state(project, element_name) == 'buildable'
assert cli.get_element_key(project, element_name) == "{:?<64}".format('')