|
| 1 | +import os |
| 2 | +import shutil |
| 3 | + |
| 4 | +from sys import platform |
1 | 5 | from pydriller import Repository
|
2 |
| -import os |
3 |
| -import datetime |
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 | 6 |
|
9 | 7 |
|
| 8 | +speedtest_src_path = os.path.join("examples", "speedtest.py") |
| 9 | +speedtest_copy_path = os.path.join("examples", "speedtest2.py") |
| 10 | +shutil.copyfile(speedtest_src_path, speedtest_copy_path) # the file has to be outside of git |
| 11 | + |
| 12 | +commits = list(Repository('.', from_tag="v0.6.0").traverse_commits()) |
| 13 | +print("Found commits:") |
| 14 | +for idx, commit in enumerate(commits): |
| 15 | + name = commit.msg.replace('\n', ' ').replace('\r', ' ') |
| 16 | + print(idx, commit.hash, name) |
10 | 17 |
|
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) |
15 |
| - |
16 |
| - os.system(f"git checkout {commit.hash}; rm -rf build; ") |
| 18 | +for commit in commits: |
| 19 | + name = commit.msg.replace('\n', ' ').replace('\r', ' ') |
| 20 | + print("\nProcessing", commit.hash, name) |
| 21 | + |
| 22 | + if os.path.exists("build"): |
| 23 | + shutil.rmtree("build") |
| 24 | + os.system(f"git checkout {commit.hash}") |
17 | 25 | 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') |
| 26 | + ret = os.system("python -m pip install .") |
| 27 | + print("Install result:", ret) |
33 | 28 |
|
| 29 | + if ret != 0: |
| 30 | + print("build failed!!!!") |
| 31 | + print("build failed!!!!") |
| 32 | + print("build failed!!!!") |
| 33 | + print("build failed!!!!") |
| 34 | + continue |
34 | 35 |
|
| 36 | + os.system(f'python {speedtest_copy_path} -n "{name}" -d 4 -t 1') |
| 37 | + os.system(f'python {speedtest_copy_path} -n "{name}" -d 64 -t 1') |
| 38 | + os.system(f'python {speedtest_copy_path} -n "{name}" -d 128 -t 1') |
| 39 | + os.system(f'python {speedtest_copy_path} -n "{name}" -d 4 -t 24') |
| 40 | + os.system(f'python {speedtest_copy_path} -n "{name}" -d 128 -t 24') |
0 commit comments