diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2011-06-06 16:55:57 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-06-06 16:55:57 +0200 |
commit | d1032572162f91ee9e67e74321f329238fa32b15 (patch) | |
tree | 8183c05462c0cadf9e02b6605fbffcb82e43b2d6 /git | |
parent | 5426890ebd5a54fdc450f977137511bbd52f200e (diff) | |
download | gitpython-d1032572162f91ee9e67e74321f329238fa32b15.tar.gz |
Fixed packed ODB test, in preparation for separating the type to allow future implementations to use the test as well
Diffstat (limited to 'git')
-rw-r--r-- | git/test/performance/db/odb_impl.py | 4 | ||||
-rw-r--r-- | git/test/performance/lib.py | 4 | ||||
-rw-r--r-- | git/test/performance/test_pack.py | 19 |
3 files changed, 21 insertions, 6 deletions
diff --git a/git/test/performance/db/odb_impl.py b/git/test/performance/db/odb_impl.py index 50ee37e1..fd1abdee 100644 --- a/git/test/performance/db/odb_impl.py +++ b/git/test/performance/db/odb_impl.py @@ -17,6 +17,10 @@ class PerfBaseDeletorMetaClass(GlobalsItemDeletorMetaCls): class TestObjDBPerformanceBase(TestBigRepoR): __metaclass__ = PerfBaseDeletorMetaClass + #{ Configuration + RepoCls = None # to be set by subclass + #} END configuration + def test_random_access_test(self): repo = self.rorepo diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py index cf80a0de..c92b0eea 100644 --- a/git/test/performance/lib.py +++ b/git/test/performance/lib.py @@ -7,6 +7,8 @@ from git.test.lib import ( import shutil import tempfile +from git import Repo + #{ Invvariants k_env_git_repo = "GIT_PYTHON_TEST_GIT_REPO_BASE" #} END invariants @@ -41,7 +43,7 @@ class TestBigRepoR(TestBase): #} END invariants #{ Configuration - RepoCls = None + RepoCls = Repo #} END configuration @classmethod diff --git a/git/test/performance/test_pack.py b/git/test/performance/test_pack.py index b1f3abe1..8c1207bc 100644 --- a/git/test/performance/test_pack.py +++ b/git/test/performance/test_pack.py @@ -8,17 +8,26 @@ from lib import ( ) from git.exc import UnsupportedOperation -from git.db.pack import PackedDB +from git.db.py.pack import PurePackedODB import sys import os from time import time import random -class TestPackedDBPerformance(TestBigRepoR): +class TestPurePackedODBPerformance(TestBigRepoR): - def _test_pack_random_access(self): - pdb = PackedDB(os.path.join(self.gitrepopath, "objects/pack")) + #{ Configuration + PackedODBCls = PurePackedODB + #} END configuration + + @classmethod + def setUpAll(cls): + super(TestPurePackedODBPerformance, cls).setUpAll() + cls.ropdb = cls.PackedODBCls(cls.rorepo.db_path("pack")) + + def test_pack_random_access(self): + pdb = self.ropdb # sha lookup st = time() @@ -66,7 +75,7 @@ class TestPackedDBPerformance(TestBigRepoR): print >> sys.stderr, "PDB: Obtained %i streams by sha and read all bytes totallying %i KiB ( %f KiB / s ) in %f s ( %f streams/s )" % (max_items, total_kib, total_kib/elapsed , elapsed, max_items / elapsed) def test_correctness(self): - pdb = PackedDB(os.path.join(self.gitrepopath, "objects/pack")) + pdb = self.ropdb # disabled for now as it used to work perfectly, checking big repositories takes a long time print >> sys.stderr, "Endurance run: verify streaming of objects (crc and sha)" for crc in range(2): |