From 8b3b222565199eab67196a5ab840b9e2770bfc53 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 7 Jul 2011 19:34:25 +0200 Subject: Added default performance tests - these should help to measure something at least, which implicitly includes pack handling. For the pack specific tests to work, one would need a pack interface though, which is currently not planned to be specifically exposed --- .gitignore | 1 + git/db/dulwich/complex.py | 7 ++++++- git/test/performance/db/test_looseodb_dulwich.py | 6 ++++++ git/test/performance/db/test_odb_dulwich.py | 6 ++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 git/test/performance/db/test_looseodb_dulwich.py create mode 100644 git/test/performance/db/test_odb_dulwich.py diff --git a/.gitignore b/.gitignore index eec80860..8dd67105 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /dist /doc/_build nbproject +.nosebazinga diff --git a/git/db/dulwich/complex.py b/git/db/dulwich/complex.py index 6c3645a4..3fa7c1cd 100644 --- a/git/db/dulwich/complex.py +++ b/git/db/dulwich/complex.py @@ -26,7 +26,12 @@ class DulwichGitODB(PureGitODB): def __init__(self, objects_root): """Initalize this instance""" PureGitODB.__init__(self, objects_root) - self._dw_repo = DulwichRepo(self.working_dir) + if hasattr(self, 'working_dir'): + wd = self.working_dir + else: + wd = os.path.dirname(os.path.dirname(objects_root)) + #END try to figure out good entry for dulwich, which doesn't do an extensive search + self._dw_repo = DulwichRepo(wd) def __getattr__(self, attr): try: diff --git a/git/test/performance/db/test_looseodb_dulwich.py b/git/test/performance/db/test_looseodb_dulwich.py new file mode 100644 index 00000000..cf27a528 --- /dev/null +++ b/git/test/performance/db/test_looseodb_dulwich.py @@ -0,0 +1,6 @@ +from git.db.dulwich.complex import DulwichGitODB +from looseodb_impl import TestLooseDBWPerformanceBase + +class TestPureLooseDB(TestLooseDBWPerformanceBase): + LooseODBCls = DulwichGitODB + diff --git a/git/test/performance/db/test_odb_dulwich.py b/git/test/performance/db/test_odb_dulwich.py new file mode 100644 index 00000000..069c5b43 --- /dev/null +++ b/git/test/performance/db/test_odb_dulwich.py @@ -0,0 +1,6 @@ +from git.db.dulwich.complex import DulwichCompatibilityGitDB +from odb_impl import TestObjDBPerformanceBase + +class TestPureDB(TestObjDBPerformanceBase): + RepoCls = DulwichCompatibilityGitDB + -- cgit v1.2.1