summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-07-31 16:26:27 +0100
committerBenjamin Schubert <contact@benschubert.me>2019-07-31 17:26:37 +0100
commitdf50bf766070449211540d69c851aad18e868847 (patch)
tree2c7dee262ba9692bead84b03994f791ba648b7a0
parent78a48653ea9c0701e4a6a774af49a1d35df8135a (diff)
downloadbuildstream-bschubert/bug-artifact-log-workspace.tar.gz
workspace: Add test to ensure we can show logs from a workspaced buildbschubert/bug-artifact-log-workspace
-rw-r--r--tests/frontend/project/elements/manual.bst9
-rw-r--r--tests/frontend/workspace.py32
2 files changed, 41 insertions, 0 deletions
diff --git a/tests/frontend/project/elements/manual.bst b/tests/frontend/project/elements/manual.bst
new file mode 100644
index 000000000..142409a08
--- /dev/null
+++ b/tests/frontend/project/elements/manual.bst
@@ -0,0 +1,9 @@
+kind: manual
+
+config:
+ build-commands:
+ - echo "hello"
+
+sources:
+ - kind: local
+ path: elements/manual.bst
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py
index ad0fc7371..037a1a970 100644
--- a/tests/frontend/workspace.py
+++ b/tests/frontend/workspace.py
@@ -1333,3 +1333,35 @@ def test_build_all(cli, tmpdir, datafiles, case, strict, non_workspaced_elements
# Assert that the target is built
assert cli.get_element_states(project, all_elements) == \
{elem: "cached" for elem in all_elements}
+
+
+@pytest.mark.datafiles(DATA_DIR)
+@pytest.mark.parametrize('strict', ['strict', 'non-strict'])
+def test_show_workspace_logs(cli, tmpdir, datafiles, strict):
+ project = str(datafiles)
+ workspace = os.path.join(str(tmpdir), 'workspace')
+ target = 'manual.bst'
+
+ # Configure strict mode
+ strict_mode = True
+ if strict != 'strict':
+ strict_mode = False
+ cli.configure({
+ 'projects': {
+ 'test': {
+ 'strict': strict_mode
+ }
+ }
+ })
+
+ # First open the workspace
+ result = cli.run(project=project, args=['workspace', 'open', '--directory', workspace, target])
+ result.assert_success()
+
+ # Build the element
+ result = cli.run(project=project, args=['build', target])
+ result.assert_task_error(ErrorDomain.SANDBOX, 'missing-command')
+
+ result = cli.run(project=project, args=['artifact', 'log', target])
+ result.assert_success()
+ assert result.output == ""