diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-03-15 12:08:54 +0000 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-03-16 13:46:16 +0000 |
commit | cc3e0c1ba4c97b62f407daf75b81012a6b341430 (patch) | |
tree | 306f52b0c0e29f609520e047a472b59209483a5f /tests/frontend/workspace.py | |
parent | 05667cd8ec522da9b62ce37cc3e9ba66109ed520 (diff) | |
download | buildstream-bschubert/pipeline-next.tar.gz |
tests:workspace: make deeper tests when trying to build allbschubert/pipeline-next
Diffstat (limited to 'tests/frontend/workspace.py')
-rw-r--r-- | tests/frontend/workspace.py | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py index 662ef728d..516ef114a 100644 --- a/tests/frontend/workspace.py +++ b/tests/frontend/workspace.py @@ -1236,11 +1236,18 @@ TEST_DIR = os.path.join( @pytest.mark.datafiles(TEST_DIR) -@pytest.mark.parametrize("case", [("workspaced-build-dep"), ("workspaced-runtime-dep")]) +@pytest.mark.parametrize( + ["case", "non_workspaced_elements_state"], + [ + ("workspaced-build-dep", ["waiting", "waiting", "waiting", "waiting"]), + ("workspaced-runtime-dep", ["buildable", "buildable", "waiting", "waiting"]) + ], +) @pytest.mark.parametrize("strict", [("strict"), ("non-strict")]) -def test_build_all(cli, tmpdir, datafiles, case, strict): +def test_build_all(cli, tmpdir, datafiles, case, strict, non_workspaced_elements_state): project = os.path.join(str(datafiles), case) workspace = os.path.join(str(tmpdir), 'workspace') + non_leaf_elements = ["elem2.bst", "elem3.bst", "stack.bst", "elem4.bst"] # Configure strict mode strict_mode = True @@ -1258,9 +1265,19 @@ def test_build_all(cli, tmpdir, datafiles, case, strict): result = cli.run(project=project, args=['workspace', 'open', '--directory', workspace, 'elem1.bst']) result.assert_success() + # Ensure all elements are waiting build the first + assert cli.get_element_state(project, 'elem1.bst') == 'buildable' + assert [ + cli.get_element_state(project, element) + for element in non_leaf_elements + ] == non_workspaced_elements_state + # Now build the target elem3.bst - result = cli.run(project=project, args=['build', 'elem3.bst']) + result = cli.run(project=project, args=['build', 'elem4.bst']) result.assert_success() # Assert that the target is built - assert cli.get_element_state(project, 'elem3.bst') == 'cached' + assert [ + cli.get_element_state(project, element) + for element in ["elem1.bst", *non_leaf_elements] + ] == ["cached"] * (len(non_leaf_elements) + 1) |