summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-10-07 15:59:04 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-10-08 16:34:47 +0000
commit3079bb918e81f08f974421b0f648eb36592a0ace (patch)
tree55ee26297fd454040f7bd2c5b44907ee060af5ae
parent31b23110443365e1608fd45c3c7242ce4e8b1060 (diff)
downloadbuildstream-bschubert/fix-windows-symlink.tar.gz
tests/frontend/buildcheckout.py: Create required symlinks on the flybschubert/fix-windows-symlink
Windows checks out symlinks as a file with content is the path of the symlink. This makes it impossible to mount the buildstream folder in a docker container and run the tests. This removes the symlink, and creates it on the fly for tests that use it, which fixes the problem.
-rw-r--r--tests/frontend/buildcheckout.py16
l---------tests/frontend/project/files/files-and-links/basicfolder/basicsymlink1
2 files changed, 16 insertions, 1 deletions
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py
index 7044739a1..5079800ab 100644
--- a/tests/frontend/buildcheckout.py
+++ b/tests/frontend/buildcheckout.py
@@ -526,6 +526,14 @@ def test_build_checkout_tarball_links(datafiles, cli):
checkout = os.path.join(cli.directory, 'checkout.tar')
extract = os.path.join(cli.directory, 'extract')
+ # Create the link before running the tests.
+ # This is needed for users working on Windows, git checks out symlinks as files which content is the name
+ # of the symlink and the test therefore doesn't have the correct content
+ os.symlink(
+ os.path.join("..", "basicfile"),
+ os.path.join(project, "files", "files-and-links", "basicfolder", "basicsymlink")
+ )
+
result = cli.run(project=project, args=['build', 'import-links.bst'])
result.assert_success()
@@ -548,6 +556,14 @@ def test_build_checkout_links(datafiles, cli):
project = str(datafiles)
checkout = os.path.join(cli.directory, 'checkout')
+ # Create the link before running the tests.
+ # This is needed for users working on Windows, git checks out symlinks as files which content is the name
+ # of the symlink and the test therefore doesn't have the correct content
+ os.symlink(
+ os.path.join("..", "basicfile"),
+ os.path.join(project, "files", "files-and-links", "basicfolder", "basicsymlink")
+ )
+
result = cli.run(project=project, args=['build', 'import-links.bst'])
result.assert_success()
diff --git a/tests/frontend/project/files/files-and-links/basicfolder/basicsymlink b/tests/frontend/project/files/files-and-links/basicfolder/basicsymlink
deleted file mode 120000
index e2b4f7423..000000000
--- a/tests/frontend/project/files/files-and-links/basicfolder/basicsymlink
+++ /dev/null
@@ -1 +0,0 @@
-../basicfile \ No newline at end of file