summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-03-08 15:08:44 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-03-08 15:08:44 +0900
commitea34b8c5b4c0bcfc945dbb8a31d9f65dd00f3fec (patch)
treeded28a6b829ce29f3a2f93a6c998c3338d0bdbdb
parentdca7b6352dba00b9b8819ea4f765e19096c1e637 (diff)
downloadbuildstream-ea34b8c5b4c0bcfc945dbb8a31d9f65dd00f3fec.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 08fffbd55..b4866650c 100644
--- a/tests/frontend/workspace.py
+++ b/tests/frontend/workspace.py
@@ -1242,16 +1242,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