summaryrefslogtreecommitdiff
path: root/test/git/performance/lib.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-03 23:20:34 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-03 23:20:34 +0200
commit1e2b46138ba58033738a24dadccc265748fce2ca (patch)
tree0f2a625a371c16cc95e53e024e007d8b89d87c92 /test/git/performance/lib.py
parent4b4a514e51fbc7dc6ddcb27c188159d57b5d1fa9 (diff)
downloadgitpython-1e2b46138ba58033738a24dadccc265748fce2ca.tar.gz
commit.create_from_tree now uses pure python implementation, fixed message parsing which truncated newlines although it was ilegitimate. Its up to the reader to truncate therse, nowhere in the git code I could find anyone adding newlines to commits where it is written
Added performance tests for serialization, it does about 5k commits per second if writing to tmpfs
Diffstat (limited to 'test/git/performance/lib.py')
-rw-r--r--test/git/performance/lib.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/test/git/performance/lib.py b/test/git/performance/lib.py
index 4b552b20..650bea82 100644
--- a/test/git/performance/lib.py
+++ b/test/git/performance/lib.py
@@ -1,6 +1,8 @@
"""Contains library functions"""
import os
from test.testlib import *
+import shutil
+import tempfile
from git import (
Repo
@@ -25,7 +27,7 @@ def resolve_or_fail(env_var):
#{ Base Classes
-class TestBigRepoReadOnly(TestBase):
+class TestBigRepoR(TestBase):
"""TestCase providing access to readonly 'big' repositories using the following
member variables:
@@ -40,7 +42,24 @@ class TestBigRepoReadOnly(TestBase):
@classmethod
def setUpAll(cls):
- super(TestBigRepoReadOnly, cls).setUpAll()
- cls.gitrepo = Repo(resolve_or_fail(k_env_git_repo))
+ super(TestBigRepoR, cls).setUpAll()
+ cls.gitrorepo = Repo(resolve_or_fail(k_env_git_repo))
+
+class TestBigRepoRW(TestBigRepoR):
+ """As above, but provides a big repository that we can write to.
+
+ Provides ``self.gitrwrepo``"""
+
+ @classmethod
+ def setUpAll(cls):
+ super(TestBigRepoRW, cls).setUpAll()
+ dirname = tempfile.mktemp()
+ os.mkdir(dirname)
+ cls.gitrwrepo = cls.gitrorepo.clone(dirname, shared=True, bare=True)
+
+ @classmethod
+ def tearDownAll(cls):
+ shutil.rmtree(cls.gitrwrepo.working_tree_dir)
+
#} END base classes