Skip to content

Commit 995831e

Browse files
committed
update perfomance test
1 parent dff787e commit 995831e

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

examples/git_tester.py

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
11
from pydriller import Repository
22
import os
33
import datetime
4-
os.system("cp examples/speedtest.py examples/speedtest2.py")
5-
for commit in Repository('.', from_tag="v0.5.2").traverse_commits():
6-
print(commit.hash)
7-
print(commit.msg)
4+
os.system("cp examples/speedtest.py examples/speedtest2.py") # the file has to be outside of git
5+
for idx, commit in enumerate(Repository('.', from_tag="v0.6.0").traverse_commits()):
6+
name=commit.msg.replace('\n', ' ').replace('\r', ' ')
7+
print(idx, commit.hash, name)
8+
9+
10+
11+
for commit in Repository('.', from_tag="v0.6.0").traverse_commits():
12+
13+
name=commit.msg.replace('\n', ' ').replace('\r', ' ')
14+
print(commit.hash, name)
815

916
os.system(f"git checkout {commit.hash}; rm -rf build; ")
10-
os.system("python -m pip install .")
11-
os.system(f'python examples/speedtest2.py -n "{commit.msg}" -d 4 -t 1')
12-
os.system(f'python examples/speedtest2.py -n "{commit.msg}" -d 64 -t 1')
13-
os.system(f'python examples/speedtest2.py -n "{commit.msg}" -d 128 -t 1')
14-
os.system(f'python examples/speedtest2.py -n "{commit.msg}" -d 4 -t 24')
15-
os.system(f'python examples/speedtest2.py -n "{commit.msg}" -d 128 -t 24')
17+
print("\n\n--------------------\n\n")
18+
ret=os.system("python -m pip install .")
19+
print(ret)
20+
21+
if ret != 0:
22+
print ("build failed!!!!")
23+
print ("build failed!!!!")
24+
print ("build failed!!!!")
25+
print ("build failed!!!!")
26+
continue
27+
28+
os.system(f'python examples/speedtest2.py -n "{name}" -d 4 -t 1')
29+
os.system(f'python examples/speedtest2.py -n "{name}" -d 64 -t 1')
30+
os.system(f'python examples/speedtest2.py -n "{name}" -d 128 -t 1')
31+
os.system(f'python examples/speedtest2.py -n "{name}" -d 4 -t 24')
32+
os.system(f'python examples/speedtest2.py -n "{name}" -d 128 -t 24')
33+
1634

0 commit comments

Comments
 (0)