-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFailureDataCollector.py
79 lines (63 loc) · 2.24 KB
/
FailureDataCollector.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import os
"""
This classes are used to collect the files that contain the test results
based on the given parameters. The source of the parameters differ.
"""
class FailureDataCollector(object):
@property
def graalpy_xml_files(self) -> list[(str, str)]: # (package, file)
pass
@property
def cpython_xml_files(self) -> list[(str, str)]: # (package, file)
pass
class FailureDataCollectorConstant(FailureDataCollector):
def __init__(
self, graalpy_xml_file, cpython_xml_file, graalpy_folder, cpython_folder
):
self._graalpy_xml_file = graalpy_xml_file
self._cpython_xml_file = cpython_xml_file
self._graalpy_folder = graalpy_folder
self._cpython_folder = cpython_folder
@property
def graalpy_xml_files(self):
files = list()
for path, _, _ in os.walk(self._graalpy_folder):
package = path.split("/")[-1]
files.append((package, os.path.join(path, self._graalpy_xml_file)))
return files
@property
def cpython_xml_files(self):
files = list()
for path, _, _ in os.walk(self._cpython_folder):
package = path.split("/")[-1]
files.append((package, os.path.join(path, self._cpython_xml_file)))
return files
class FailureDataCollectorCliParser(FailureDataCollector):
def __init__(self, args):
self.args = args
@property
def graalpy_xml_file(self):
return self.args.graalpy_xml
@property
def cpython_xml_file(self):
return self.args.cpython_xml
@property
def graalpy_folder(self):
return self.args.graalpy_folder
@property
def cpython_folder(self):
return self.args.cpython_folder
@property
def graalpy_xml_files(self):
files = list()
for path, _, _ in os.walk(self.graalpy_folder):
package = path.split("/")[-1]
files.append((package, os.path.join(path, self.graalpy_xml_file)))
return files
@property
def cpython_xml_files(self):
files = list()
for path, _, _ in os.walk(self.cpython_folder):
package = path.split("/")[-1]
files.append((package, os.path.join(path, self.cpython_xml_file)))
return files