diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-03-08 15:08:44 +0900 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-03-17 18:42:37 +0000 |
commit | d265fa5415941eef5b7f7b529e232c3bd2f23161 (patch) | |
tree | 0ee7065d763f54b8e8edeba8bc3abe1ec8f4bc80 | |
parent | 293fd377b5c0ab17cccadc3e0a2fbab451046a59 (diff) | |
download | buildstream-d265fa5415941eef5b7f7b529e232c3bd2f23161.tar.gz |
tests/frontend/workspaces.py: Extended test that all elements get built in the same session
This extends the existing test which catches failures only
in build-only dependency chains, with a similar test for runtime-only
dependency chains.
9 files changed, 41 insertions, 6 deletions
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py index 96347f28c..662ef728d 100644 --- a/tests/frontend/workspace.py +++ b/tests/frontend/workspace.py @@ -1230,16 +1230,16 @@ def test_external_list(cli, datafiles, tmpdir_factory): # but just successfully builds the workspaced element and happily # exits without completing the build. # -BUILD_ALL_DIR = os.path.join( - os.path.dirname(os.path.realpath(__file__)), - "workspaced-build-dep", +TEST_DIR = os.path.join( + os.path.dirname(os.path.realpath(__file__)) ) -@pytest.mark.datafiles(BUILD_ALL_DIR) +@pytest.mark.datafiles(TEST_DIR) +@pytest.mark.parametrize("case", [("workspaced-build-dep"), ("workspaced-runtime-dep")]) @pytest.mark.parametrize("strict", [("strict"), ("non-strict")]) -def test_build_all(cli, tmpdir, datafiles, strict): - project = str(datafiles) +def test_build_all(cli, tmpdir, datafiles, case, strict): + project = os.path.join(str(datafiles), case) workspace = os.path.join(str(tmpdir), 'workspace') # Configure strict mode diff --git a/tests/frontend/workspaced-runtime-dep/elements/elem1.bst b/tests/frontend/workspaced-runtime-dep/elements/elem1.bst new file mode 100644 index 000000000..eed39a95a --- /dev/null +++ b/tests/frontend/workspaced-runtime-dep/elements/elem1.bst @@ -0,0 +1,5 @@ +kind: import + +sources: +- kind: local + path: files/file1 diff --git a/tests/frontend/workspaced-runtime-dep/elements/elem2.bst b/tests/frontend/workspaced-runtime-dep/elements/elem2.bst new file mode 100644 index 000000000..5fb90dfc0 --- /dev/null +++ b/tests/frontend/workspaced-runtime-dep/elements/elem2.bst @@ -0,0 +1,9 @@ +kind: import + +depends: +- filename: elem1.bst + type: runtime + +sources: +- kind: local + path: files/file2 diff --git a/tests/frontend/workspaced-runtime-dep/elements/elem3.bst b/tests/frontend/workspaced-runtime-dep/elements/elem3.bst new file mode 100644 index 000000000..4c9bf899c --- /dev/null +++ b/tests/frontend/workspaced-runtime-dep/elements/elem3.bst @@ -0,0 +1,9 @@ +kind: import + +depends: +- filename: stack.bst + type: build + +sources: +- kind: local + path: files/file3 diff --git a/tests/frontend/workspaced-runtime-dep/elements/stack.bst b/tests/frontend/workspaced-runtime-dep/elements/stack.bst new file mode 100644 index 000000000..3e1ea7920 --- /dev/null +++ b/tests/frontend/workspaced-runtime-dep/elements/stack.bst @@ -0,0 +1,4 @@ +kind: stack + +depends: +- elem2.bst diff --git a/tests/frontend/workspaced-runtime-dep/files/file1 b/tests/frontend/workspaced-runtime-dep/files/file1 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/frontend/workspaced-runtime-dep/files/file1 diff --git a/tests/frontend/workspaced-runtime-dep/files/file2 b/tests/frontend/workspaced-runtime-dep/files/file2 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/frontend/workspaced-runtime-dep/files/file2 diff --git a/tests/frontend/workspaced-runtime-dep/files/file3 b/tests/frontend/workspaced-runtime-dep/files/file3 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/frontend/workspaced-runtime-dep/files/file3 diff --git a/tests/frontend/workspaced-runtime-dep/project.conf b/tests/frontend/workspaced-runtime-dep/project.conf new file mode 100644 index 000000000..e017957da --- /dev/null +++ b/tests/frontend/workspaced-runtime-dep/project.conf @@ -0,0 +1,8 @@ +# Unique project name +name: test + +# Required BuildStream format version +format-version: 12 + +# Subdirectory where elements are stored +element-path: elements |