summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTristan van Berkom <tristan@codethink.co.uk>2020-09-07 19:45:50 +0900
committerTristan van Berkom <tristan@codethink.co.uk>2020-09-18 12:38:49 +0900
commitc8beeb400a9467fda3e723e8bfdb4dae70159c36 (patch)
treec9f5e6487883a59731229160cf9103b61a0b79ba /tests
parent055e5314d0b36fd33bae9f5e3ba4f5fd753ecdc2 (diff)
downloadbuildstream-c8beeb400a9467fda3e723e8bfdb4dae70159c36.tar.gz
tests/integration/manual.py: Test staging files in custom directories
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/manual.py19
-rw-r--r--tests/integration/project/elements/manual/import-file.bst5
-rw-r--r--tests/integration/project/elements/manual/manual-stage-custom.bst13
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/integration/manual.py b/tests/integration/manual.py
index defc2503c..22b87fb9f 100644
--- a/tests/integration/manual.py
+++ b/tests/integration/manual.py
@@ -204,3 +204,22 @@ def test_manual_command_subdir(cli, datafiles):
result.assert_success()
with open(os.path.join(checkout, "hello")) as f:
assert f.read() == "hello from subdir\n"
+
+
+# Test staging artifacts into subdirectories
+@pytest.mark.datafiles(DATA_DIR)
+@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
+def test_manual_stage_custom(cli, datafiles):
+ project = str(datafiles)
+ checkout = os.path.join(cli.directory, "checkout")
+
+ # Verify that the element builds, and has the correct expected output.
+ result = cli.run(project=project, args=["build", "manual/manual-stage-custom.bst"])
+ result.assert_success()
+ result = cli.run(
+ project=project, args=["artifact", "checkout", "manual/manual-stage-custom.bst", "--directory", checkout]
+ )
+ result.assert_success()
+
+ with open(os.path.join(checkout, "test.txt")) as f:
+ assert f.read() == "This is another test\n"
diff --git a/tests/integration/project/elements/manual/import-file.bst b/tests/integration/project/elements/manual/import-file.bst
new file mode 100644
index 000000000..195841951
--- /dev/null
+++ b/tests/integration/project/elements/manual/import-file.bst
@@ -0,0 +1,5 @@
+kind: import
+
+sources:
+- kind: local
+ path: files/import-source
diff --git a/tests/integration/project/elements/manual/manual-stage-custom.bst b/tests/integration/project/elements/manual/manual-stage-custom.bst
new file mode 100644
index 000000000..abd29c88a
--- /dev/null
+++ b/tests/integration/project/elements/manual/manual-stage-custom.bst
@@ -0,0 +1,13 @@
+kind: manual
+
+depends:
+- base.bst
+
+build-depends:
+- filename: manual/import-file.bst
+ config:
+ location: /flying-ponies
+
+config:
+ install-commands:
+ - cp /flying-ponies/subdir/test.txt %{install-root}