Skip to content

Commit 4e1c89e

Browse files
committed
Added performance testing foundation library, reworked existing performance tests to work on larger repositories
1 parent 4a25347 commit 4e1c89e

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

Diff for: test/git/performance/lib.py

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"""Contains library functions"""
2+
import os
3+
from test.testlib import *
4+
5+
from git import (
6+
Repo
7+
)
8+
9+
#{ Invvariants
10+
k_env_git_repo = "GIT_PYTHON_TEST_GIT_REPO_BASE"
11+
#} END invariants
12+
13+
14+
#{ Utilities
15+
def resolve_or_fail(env_var):
16+
""":return: resolved environment variable or raise EnvironmentError"""
17+
try:
18+
return os.environ[env_var]
19+
except KeyError:
20+
raise EnvironmentError("Please set the %r envrionment variable and retry" % env_var)
21+
# END exception handling
22+
23+
#} END utilities
24+
25+
26+
#{ Base Classes
27+
28+
class TestBigRepoReadOnly(TestBase):
29+
"""TestCase providing access to readonly 'big' repositories using the following
30+
member variables:
31+
32+
* gitrepo
33+
34+
* Read-Only git repository - actually the repo of git itself"""
35+
36+
#{ Invariants
37+
head_sha_2k = '235d521da60e4699e5bd59ac658b5b48bd76ddca'
38+
head_sha_50 = '32347c375250fd470973a5d76185cac718955fd5'
39+
#} END invariants
40+
41+
@classmethod
42+
def setUpAll(cls):
43+
super(TestBigRepoReadOnly, cls).setUpAll()
44+
cls.gitrepo = Repo(resolve_or_fail(k_env_git_repo))
45+
46+
#} END base classes
File renamed without changes.

0 commit comments

Comments
 (0)