From 3079bb918e81f08f974421b0f648eb36592a0ace Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Mon, 7 Oct 2019 15:59:04 +0100 Subject: tests/frontend/buildcheckout.py: Create required symlinks on the fly 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. --- tests/frontend/buildcheckout.py | 16 ++++++++++++++++ .../files/files-and-links/basicfolder/basicsymlink | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) delete mode 120000 tests/frontend/project/files/files-and-links/basicfolder/basicsymlink 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 -- cgit v1.2.1