mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Do not mock git_helper.Git, suppress git describe
error for ignore_no_tags
This commit is contained in:
parent
2ac95ccfce
commit
eb2a5c31a3
@ -10,9 +10,8 @@ from pr_info import PRInfo
|
||||
from report import TestResult
|
||||
import docker_images_check as di
|
||||
|
||||
with patch("git_helper.Git"):
|
||||
from version_helper import get_version_from_string
|
||||
import docker_server as ds
|
||||
from version_helper import get_version_from_string
|
||||
import docker_server as ds
|
||||
|
||||
# di.logging.basicConfig(level=di.logging.INFO)
|
||||
|
||||
@ -312,7 +311,3 @@ class TestDockerServer(unittest.TestCase):
|
||||
for case in cases_equal:
|
||||
release = ds.auto_release_type(case[0], "auto")
|
||||
self.assertEqual(case[1], release)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
@ -126,15 +126,16 @@ class Git:
|
||||
# Format should match TAG_REGEXP
|
||||
if self._ignore_no_tags and is_shallow():
|
||||
try:
|
||||
self._update_tags()
|
||||
self._update_tags(True)
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
return
|
||||
self._update_tags()
|
||||
|
||||
def _update_tags(self):
|
||||
self.latest_tag = self.run("git describe --tags --abbrev=0")
|
||||
def _update_tags(self, suppress_stderr: bool = False) -> None:
|
||||
stderr = subprocess.DEVNULL if suppress_stderr else None
|
||||
self.latest_tag = self.run("git describe --tags --abbrev=0", stderr=stderr)
|
||||
# Format should be: {latest_tag}-{commits_since_tag}-g{sha_short}
|
||||
self.description = self.run("git describe --tags --long")
|
||||
self.commits_since_tag = int(
|
||||
|
Loading…
Reference in New Issue
Block a user