This is an automated email from the ASF dual-hosted git repository. tvb pushed a commit to branch tristan/remove-plugins in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 7dc17437107c3cba3fc0bdad6c0014c980c4278e Author: Tristan van Berkom <[email protected]> AuthorDate: Mon Mar 28 16:08:25 2022 +0900 tests/conftest.py: Remove bzr from automated source tests --- tests/conftest.py | 2 -- tests/testutils/repo/bzr.py | 47 --------------------------------------------- 2 files changed, 49 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 168a8ca..0f3a2dd 100755 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -32,7 +32,6 @@ from buildstream._testing.integration import integration_cache # pylint: disabl from tests.testutils.repo.git import Git -from tests.testutils.repo.bzr import Bzr from tests.testutils.repo.tar import Tar @@ -130,7 +129,6 @@ def remote_services(request): # Setup for templated source tests # ################################################# register_repo_kind("git", Git, None) -register_repo_kind("bzr", Bzr, None) register_repo_kind("tar", Tar, None) diff --git a/tests/testutils/repo/bzr.py b/tests/testutils/repo/bzr.py deleted file mode 100644 index 038d759..0000000 --- a/tests/testutils/repo/bzr.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import subprocess -import pytest - -from buildstream._testing import Repo -from buildstream._testing._utils.site import BZR, BZR_ENV, HAVE_BZR - - -class Bzr(Repo): - def __init__(self, directory, subdir="repo"): - if not HAVE_BZR: - pytest.skip("bzr is not available") - super().__init__(directory, subdir) - self.bzr = BZR - - self.env = os.environ.copy() - self.env.update(BZR_ENV) - - def create(self, directory): - # Work around race condition in bzr's creation of ~/.bazaar in - # ensure_config_dir_exists() when running tests in parallel. - bazaar_config_dir = os.path.expanduser("~/.bazaar") - os.makedirs(bazaar_config_dir, exist_ok=True) - - branch_dir = os.path.join(self.repo, "trunk") - - subprocess.call([self.bzr, "init-repo", self.repo], env=self.env) - subprocess.call([self.bzr, "init", branch_dir], env=self.env) - self.copy_directory(directory, branch_dir) - subprocess.call([self.bzr, "add", "."], env=self.env, cwd=branch_dir) - subprocess.call([self.bzr, "commit", '--message="Initial commit"'], env=self.env, cwd=branch_dir) - - return self.latest_commit() - - def source_config(self, ref=None): - config = {"kind": "bzr", "url": "file://" + self.repo, "track": "trunk"} - if ref is not None: - config["ref"] = ref - - return config - - def latest_commit(self): - return subprocess.check_output( - [self.bzr, "version-info", "--custom", "--template={revno}", os.path.join(self.repo, "trunk")], - env=self.env, - universal_newlines=True, - ).strip()
