summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-03-08 15:08:44 +0900
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-21 11:13:57 +0000
commite3e6bfdc0c2f936209f2e3b87d983aa6e13da15a (patch)
tree0acabac8066d0520d1bba5694f6ae93c3ae5a790
parent53ab9514e312d6fba283eeec6de934181c3c483e (diff)
downloadbuildstream-e3e6bfdc0c2f936209f2e3b87d983aa6e13da15a.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.
-rw-r--r--tests/frontend/workspace.py12
-rw-r--r--tests/frontend/workspaced-runtime-dep/elements/elem1.bst5
-rw-r--r--tests/frontend/workspaced-runtime-dep/elements/elem2.bst9
-rw-r--r--tests/frontend/workspaced-runtime-dep/elements/elem3.bst9
-rw-r--r--tests/frontend/workspaced-runtime-dep/elements/stack.bst4
-rw-r--r--tests/frontend/workspaced-runtime-dep/files/file10
-rw-r--r--tests/frontend/workspaced-runtime-dep/files/file20
-rw-r--r--tests/frontend/workspaced-runtime-dep/files/file30
-rw-r--r--tests/frontend/workspaced-runtime-dep/project.conf8
9 files changed, 41 insertions, 6 deletions
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py
index e5d1a2de5..16ad6e987 100644
--- a/tests/frontend/workspace.py
+++ b/tests/frontend/workspace.py
@@ -1237,16 +1237,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