diff options
author | Valentin David <valentin.david@gmail.com> | 2019-01-21 11:47:18 +0000 |
---|---|---|
committer | Valentin David <valentin.david@gmail.com> | 2019-01-21 11:47:18 +0000 |
commit | 33782865c019a993fde5f725b350262e7735c53f (patch) | |
tree | 178212556117f396353d5b2e30fd77ee2f396024 | |
parent | e230dedba3b5daac6d1d1f006bff792c10b9cf60 (diff) | |
parent | 8677a2569aaa34048df49a2868400c722dd4b69b (diff) | |
download | buildstream-33782865c019a993fde5f725b350262e7735c53f.tar.gz |
Merge branch 'richardmaw/centos-oldgit-test-fixes' into 'master'
Fix CentOS
Closes #833
See merge request BuildStream/buildstream!1085
-rw-r--r-- | .gitlab-ci.yml | 5 | ||||
-rw-r--r-- | buildstream/_gitsourcebase.py | 3 | ||||
-rw-r--r-- | tests/frontend/workspace.py | 1 | ||||
-rw-r--r-- | tests/sources/git.py | 4 | ||||
-rw-r--r-- | tests/testutils/site.py | 5 |
5 files changed, 16 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 99814048b..9a3de5154 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,6 +31,7 @@ variables: - df -h script: + - mkdir -p "${INTEGRATION_CACHE}" - useradd -Um buildstream - chown -R buildstream:buildstream . @@ -70,6 +71,10 @@ tests-python-3.7-stretch: # some of our base dependencies declare it as their runtime dependency. TOXENV: py37 +tests-centos-7.6: + <<: *tests + image: buildstream/testsuite-centos:7.6-5da27168-32c47d1c + overnight-fedora-28-aarch64: image: buildstream/testsuite-fedora:aarch64-28-5da27168-32c47d1c tags: diff --git a/buildstream/_gitsourcebase.py b/buildstream/_gitsourcebase.py index 4ee870d99..1d33bd539 100644 --- a/buildstream/_gitsourcebase.py +++ b/buildstream/_gitsourcebase.py @@ -112,7 +112,8 @@ class GitMirror(SourceFetcher): else: remote_name = "origin" - self.source.call([self.source.host_git, 'fetch', remote_name, '--prune', '--force', '--tags'], + self.source.call([self.source.host_git, 'fetch', remote_name, '--prune', + '+refs/heads/*:refs/heads/*', '+refs/tags/*:refs/tags/*'], fail="Failed to fetch from remote git repository: {}".format(url), fail_temporarily=True, cwd=self.mirror) diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py index 00c0bd835..2995bf967 100644 --- a/tests/frontend/workspace.py +++ b/tests/frontend/workspace.py @@ -204,6 +204,7 @@ def test_open_multi(cli, tmpdir, datafiles): assert not ('.bzr' in workspace_lsdir) +@pytest.mark.skipif(os.geteuid() == 0, reason="root may have CAP_DAC_OVERRIDE and ignore permissions") @pytest.mark.datafiles(DATA_DIR) def test_open_multi_unwritable(cli, tmpdir, datafiles): workspace_object = WorkspaceCreater(cli, tmpdir, datafiles) diff --git a/tests/sources/git.py b/tests/sources/git.py index e0560fe5d..f194e9f54 100644 --- a/tests/sources/git.py +++ b/tests/sources/git.py @@ -30,7 +30,7 @@ from buildstream import _yaml from buildstream.plugin import CoreWarnings from tests.testutils import cli, create_repo -from tests.testutils.site import HAVE_GIT +from tests.testutils.site import HAVE_GIT, HAVE_OLD_GIT DATA_DIR = os.path.join( os.path.dirname(os.path.realpath(__file__)), @@ -664,6 +664,7 @@ def test_invalid_submodule(cli, tmpdir, datafiles, fail): @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") +@pytest.mark.skipif(HAVE_OLD_GIT, reason="old git rm does not update .gitmodules") @pytest.mark.datafiles(os.path.join(DATA_DIR, 'template')) @pytest.mark.parametrize("fail", ['warn', 'error']) def test_track_invalid_submodule(cli, tmpdir, datafiles, fail): @@ -772,6 +773,7 @@ def test_track_fetch(cli, tmpdir, datafiles, ref_format, tag, extra_commit): @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") +@pytest.mark.skipif(HAVE_OLD_GIT, reason="old git describe lacks --first-parent") @pytest.mark.datafiles(os.path.join(DATA_DIR, 'template')) @pytest.mark.parametrize("ref_storage", [('inline'), ('project.refs')]) @pytest.mark.parametrize("tag_type", [('annotated'), ('lightweight')]) diff --git a/tests/testutils/site.py b/tests/testutils/site.py index 6ef22babb..b7bfa11cf 100644 --- a/tests/testutils/site.py +++ b/tests/testutils/site.py @@ -2,6 +2,7 @@ # so we dont have to repeat this everywhere # import os +import subprocess import sys from buildstream import _site, utils, ProgramNotFoundError @@ -16,8 +17,12 @@ except ProgramNotFoundError: try: utils.get_host_tool('git') HAVE_GIT = True + out = str(subprocess.check_output(['git', '--version']), "utf-8") + version = tuple(int(x) for x in out.split(' ', 2)[2].split('.')) + HAVE_OLD_GIT = version < (1, 8, 5) except ProgramNotFoundError: HAVE_GIT = False + HAVE_OLD_GIT = False try: utils.get_host_tool('ostree') |