-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.py
31 lines (23 loc) · 1002 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import logging
import os
import tempfile
import time
from distutils.dir_util import copy_tree
import core
logging.basicConfig(level=logging.DEBUG)
root_path = os.path.dirname(os.path.abspath(__file__))
with tempfile.TemporaryDirectory() as previous_dirname:
with tempfile.TemporaryDirectory() as current_dirname:
print("Copying current directory (as current commit)...")
copy_tree(root_path, current_dirname)
print("Copy current directory and resetting to HEAD (as previous commit)...")
copy_tree(root_path, previous_dirname)
os.chdir(previous_dirname)
os.system("git reset --hard HEAD")
os.chdir(root_path)
print("Running probes...")
start = time.time()
core.iterate_over_configs(current_dirname, previous_dirname)
# core.iterate_over_configs_parallel(current_dirname, previous_dirname)
print("Probes finished")
print("Took " + str(time.time() - start) + " seconds to run all probes")