From 7ae36c3e019a5cc16924d1b6007774bfb625036f Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 6 May 2011 18:53:59 +0200 Subject: Started to fix imports - tests still have no chance to work as database changed drastically. Now the actual work begins --- git/test/performance/lib.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'git/test/performance/lib.py') diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py index d0727b60..08c0e91c 100644 --- a/git/test/performance/lib.py +++ b/git/test/performance/lib.py @@ -1,11 +1,11 @@ """Contains library functions""" import os -from git.test.lib import * +from git.test.lib import TestBase import shutil import tempfile from git.db import ( - GitCmdObjectDB, + CmdGitDB, GitDB ) @@ -54,7 +54,7 @@ class TestBigRepoR(TestBase): def setUpAll(cls): super(TestBigRepoR, cls).setUpAll() repo_path = resolve_or_fail(k_env_git_repo) - cls.gitrorepo = Repo(repo_path, odbt=GitCmdObjectDB) + cls.gitrorepo = Repo(repo_path, odbt=CmdGitDB) cls.puregitrorepo = Repo(repo_path, odbt=GitDB) @@ -68,7 +68,7 @@ class TestBigRepoRW(TestBigRepoR): super(TestBigRepoRW, cls).setUpAll() dirname = tempfile.mktemp() os.mkdir(dirname) - cls.gitrwrepo = cls.gitrorepo.clone(dirname, shared=True, bare=True, odbt=GitCmdObjectDB) + cls.gitrwrepo = cls.gitrorepo.clone(dirname, shared=True, bare=True, odbt=CmdGitDB) cls.puregitrwrepo = Repo(dirname, odbt=GitDB) @classmethod -- cgit v1.2.3 From 5426890ebd5a54fdc450f977137511bbd52f200e Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 6 Jun 2011 16:39:27 +0200 Subject: Fixed odb performance tests --- git/test/performance/lib.py | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'git/test/performance/lib.py') diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py index 08c0e91c..cf80a0de 100644 --- a/git/test/performance/lib.py +++ b/git/test/performance/lib.py @@ -1,18 +1,12 @@ """Contains library functions""" import os -from git.test.lib import TestBase +from git.test.lib import ( + TestBase, + GlobalsItemDeletorMetaCls + ) import shutil import tempfile -from git.db import ( - CmdGitDB, - GitDB - ) - -from git import ( - Repo - ) - #{ Invvariants k_env_git_repo = "GIT_PYTHON_TEST_GIT_REPO_BASE" #} END invariants @@ -38,11 +32,7 @@ class TestBigRepoR(TestBase): * gitrorepo - * Read-Only git repository - actually the repo of git itself - - * puregitrorepo - - * As gitrepo, but uses pure python implementation + * a big read-only git repository """ #{ Invariants @@ -50,29 +40,33 @@ class TestBigRepoR(TestBase): head_sha_50 = '32347c375250fd470973a5d76185cac718955fd5' #} END invariants + #{ Configuration + RepoCls = None + #} END configuration + @classmethod def setUpAll(cls): super(TestBigRepoR, cls).setUpAll() - repo_path = resolve_or_fail(k_env_git_repo) - cls.gitrorepo = Repo(repo_path, odbt=CmdGitDB) - cls.puregitrorepo = Repo(repo_path, odbt=GitDB) + if cls.RepoCls is None: + raise AssertionError("Require RepoCls in class %s to be set" % cls) + #END assert configuration + cls.rorepo = cls.RepoCls(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`` and ``self.puregitrwrepo``""" + Provides ``self.rwrepo``""" @classmethod def setUpAll(cls): super(TestBigRepoRW, cls).setUpAll() dirname = tempfile.mktemp() os.mkdir(dirname) - cls.gitrwrepo = cls.gitrorepo.clone(dirname, shared=True, bare=True, odbt=CmdGitDB) - cls.puregitrwrepo = Repo(dirname, odbt=GitDB) + cls.rwrepo = cls.gitrorepo.clone(dirname, shared=True, bare=True) @classmethod def tearDownAll(cls): - shutil.rmtree(cls.gitrwrepo.working_dir) + shutil.rmtree(cls.rwrepo.working_dir) #} END base classes -- cgit v1.2.3 From d1032572162f91ee9e67e74321f329238fa32b15 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 6 Jun 2011 16:55:57 +0200 Subject: Fixed packed ODB test, in preparation for separating the type to allow future implementations to use the test as well --- git/test/performance/lib.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'git/test/performance/lib.py') 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 -- cgit v1.2.3 From 79b9dbd63f3b1ec3f1ae9269ff44f9c07eeab9fa Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 6 Jun 2011 19:56:17 +0200 Subject: Fixed performance commit object testing --- git/test/performance/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/test/performance/lib.py') diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py index c92b0eea..758d402d 100644 --- a/git/test/performance/lib.py +++ b/git/test/performance/lib.py @@ -65,7 +65,7 @@ class TestBigRepoRW(TestBigRepoR): super(TestBigRepoRW, cls).setUpAll() dirname = tempfile.mktemp() os.mkdir(dirname) - cls.rwrepo = cls.gitrorepo.clone(dirname, shared=True, bare=True) + cls.rwrepo = cls.rorepo.clone(dirname, shared=True, bare=True) @classmethod def tearDownAll(cls): -- cgit v1.2.3