summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-01-10 22:27:49 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-01-10 22:33:52 +0900
commit8d418c71e17f08dc7537b52209a875c2e52555b3 (patch)
tree9dc339e9817b4377a78928f39a40407b15e53af3
parent4abd4382d014b3184919df981471ca33d678824e (diff)
downloadbuildstream-8d418c71e17f08dc7537b52209a875c2e52555b3.tar.gz
tests/cachekey/cachekey.py: Manually create a symlink for our tests
This works around an inconsistent behavior with setuptools. Newer versions of setuptools fail to preserve symbolic links when creating a source distribution, meaning that tests run from the dist tarball will fail.
-rw-r--r--tests/cachekey/cachekey.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py
index d59a15529..36562fbf3 100644
--- a/tests/cachekey/cachekey.py
+++ b/tests/cachekey/cachekey.py
@@ -150,6 +150,16 @@ DATA_DIR = os.path.join(
@pytest.mark.datafiles(DATA_DIR)
def test_cache_key(datafiles, cli):
project = os.path.join(datafiles.dirname, datafiles.basename)
+
+ # Workaround bug in recent versions of setuptools: newer
+ # versions of setuptools fail to preserve symbolic links
+ # when creating a source distribution, causing this test
+ # to fail from a dist tarball.
+ goodbye_link = os.path.join(project, 'files', 'local',
+ 'usr', 'bin', 'goodbye')
+ os.unlink(goodbye_link)
+ os.symlink('hello', goodbye_link)
+
result = cli.run(project=project, silent=True, args=[
'show',
'--format', '%{name}::%{full-key}',