diff options
author | William Salmon <will.salmon@codethink.co.uk> | 2020-03-25 11:57:05 +0000 |
---|---|---|
committer | William Salmon <will.salmon@codethink.co.uk> | 2020-03-25 12:12:21 +0000 |
commit | 62457c56beac27529b1e52d421b15baf3a070d60 (patch) | |
tree | 7106d74aedc2aec04a051c8b397438cba35b2929 | |
parent | 6b60666f151fd079ce1bf92c6c1aa41c7fd94172 (diff) | |
download | buildstream-willsalmon/tar_plugin_move.tar.gz |
proof of concept skipwillsalmon/tar_plugin_move
-rw-r--r-- | src/buildstream/testing/_sourcetests/source_determinism.py | 7 | ||||
-rw-r--r-- | src/buildstream/testing/_utils/site.py | 7 | ||||
-rw-r--r-- | tests/cachekey/cachekey.py | 3 | ||||
-rw-r--r-- | tests/frontend/mirror.py | 2 |
4 files changed, 17 insertions, 2 deletions
diff --git a/src/buildstream/testing/_sourcetests/source_determinism.py b/src/buildstream/testing/_sourcetests/source_determinism.py index b834f3223..2533e0035 100644 --- a/src/buildstream/testing/_sourcetests/source_determinism.py +++ b/src/buildstream/testing/_sourcetests/source_determinism.py @@ -23,7 +23,7 @@ import os import pytest from buildstream import _yaml -from .._utils.site import HAVE_SANDBOX, CASD_SEPARATE_USER +from .._utils.site import HAVE_SANDBOX, CASD_SEPARATE_USER, HAVE_TAR from .. import create_repo from .. import cli # pylint: disable=unused-import from .utils import kind # pylint: disable=unused-import @@ -50,6 +50,11 @@ def create_test_directory(*path, mode=0o644): @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox") +@pytest.mark.skipif(not HAVE_TAR, reason="WIP test for bst external") +@pytest.mark.skipif( + HAVE_SANDBOX == "buildbox-run" and CASD_SEPARATE_USER, + reason="Flaky due to timestamps: https://gitlab.com/BuildStream/buildstream/issues/1218", +) def test_deterministic_source_umask(cli, tmpdir, datafiles, kind): if CASD_SEPARATE_USER and kind == "ostree": pytest.xfail("The ostree plugin ignores the umask") diff --git a/src/buildstream/testing/_utils/site.py b/src/buildstream/testing/_utils/site.py index a04f65210..19747e584 100644 --- a/src/buildstream/testing/_utils/site.py +++ b/src/buildstream/testing/_utils/site.py @@ -78,3 +78,10 @@ if HAVE_SANDBOX == "buildbox-run": BUILDBOX_RUN = os.path.basename(os.readlink(path)) except (ProgramNotFoundError, OSError): pass + +HAVE_TAR = None +try: + import buildstream.plugins.elements.tar_element + HAVE_TAR = True +except: + pass
\ No newline at end of file diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py index b669bacaa..a2de414ba 100644 --- a/tests/cachekey/cachekey.py +++ b/tests/cachekey/cachekey.py @@ -45,7 +45,7 @@ import os import pytest from buildstream.testing.runcli import cli # pylint: disable=unused-import -from buildstream.testing._utils.site import HAVE_BZR, HAVE_GIT, IS_LINUX, MACHINE_ARCH +from buildstream.testing._utils.site import HAVE_BZR, HAVE_GIT, IS_LINUX, MACHINE_ARCH, HAVE_TAR from buildstream.plugin import CoreWarnings from buildstream import _yaml @@ -157,6 +157,7 @@ DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",) @pytest.mark.skipif(not IS_LINUX, reason="Only available on linux") @pytest.mark.skipif(HAVE_BZR is False, reason="bzr is not available") @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") +@pytest.mark.skipif(not HAVE_TAR, reason="git is not available") @pytest.mark.datafiles(DATA_DIR) def test_cache_key(datafiles, cli): project = str(datafiles) diff --git a/tests/frontend/mirror.py b/tests/frontend/mirror.py index f71cb554d..9931216f5 100644 --- a/tests/frontend/mirror.py +++ b/tests/frontend/mirror.py @@ -7,6 +7,7 @@ import pytest from buildstream import _yaml from buildstream.testing import create_repo from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing._utils.site import HAVE_TAR # Project directory @@ -56,6 +57,7 @@ def generate_project(): @pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("ref_storage", [("inline"), ("project.refs")]) @pytest.mark.parametrize("mirror", [("no-mirror"), ("mirror"), ("unrelated-mirror")]) +@pytest.mark.skipif(not HAVE_TAR, reason="WIP test for bst external") def test_mirror_fetch_ref_storage(cli, tmpdir, datafiles, ref_storage, mirror): bin_files_path = os.path.join(str(datafiles), "files", "bin-files", "usr") dev_files_path = os.path.join(str(datafiles), "files", "dev-files", "usr") |