20
20
benchmarks_driver , refactor_driver
21
21
)
22
22
23
- class PerfTestFinder (YAMLTestFinder ):
23
+
24
+ class StandardTestFinder (YAMLTestFinder ):
24
25
"""
25
- Testcase finder to use in perf mode.
26
+ Testcase finder to use in stadard mode.
26
27
27
- This finder automatically discard tests that do not have performance
28
- measuring instructions. This is preferable to creating these tests but
29
- skipping them (SKIP status) as most tests do not support performance
30
- measurements: less noise in the testsuite report.
28
+ This finder exclude test cases from the 'tests/perf/' directory to avoid
29
+ running them in standard mode. This allow performance exclusive test
30
+ cases.
31
+ This finder doesn't exclude all performance compatible tests because
32
+ we want to be able to write baseline/performance hybrid tests.
31
33
"""
32
34
33
35
def probe (self ,
@@ -38,30 +40,21 @@ def probe(self,
38
40
# Probe testcases as usual
39
41
result = super ().probe (testsuite , dirpath , dirnames , filenames )
40
42
41
- # Reject testcases which do not contain performance measuring
42
- # instructions.
43
- if result is None or P .join ("tests" , "perf" ) not in result .test_dir :
43
+ # Reject all tests which have 'tests/perf' in their directory name
44
+ if result is None or P .join ("tests" , "perf" ) in result .test_dir :
44
45
return None
45
46
46
- # Make sure that the driver supports performance measuring
47
- if not result .driver_cls .perf_supported :
48
- raise ProbingError (
49
- f"The '{ result .driver_cls .__name__ } ' driver does not support"
50
- " performance measuring"
51
- )
52
-
53
47
return result
54
48
55
49
56
- class StandardTestFinder (YAMLTestFinder ):
50
+ class PerfTestFinder (YAMLTestFinder ):
57
51
"""
58
- Testcase finder to use in stadard mode.
52
+ Testcase finder to use in perf mode.
59
53
60
- This finder exclude test cases from the 'tests/perf/' directory to avoid
61
- running them in standard mode. This allow performance exclusive test
62
- cases.
63
- This finder doesn't exclude all performance compatible tests because
64
- we want to be able to write baseline/performance hybrid tests.
54
+ This finder automatically discard tests that do not have performance
55
+ measuring instructions. This is preferable to creating these tests but
56
+ skipping them (SKIP status) as most tests do not support performance
57
+ measurements: less noise in the testsuite report.
65
58
"""
66
59
67
60
def probe (self ,
@@ -72,10 +65,18 @@ def probe(self,
72
65
# Probe testcases as usual
73
66
result = super ().probe (testsuite , dirpath , dirnames , filenames )
74
67
75
- # Reject all tests which have 'tests/perf' in their directory name
76
- if result is None or P .join ("tests" , "perf" ) in result .test_dir :
68
+ # Reject testcases which do not contain performance measuring
69
+ # instructions.
70
+ if result is None or P .join ("tests" , "perf" ) not in result .test_dir :
77
71
return None
78
72
73
+ # Make sure that the driver supports performance measuring
74
+ if not result .driver_cls .perf_supported :
75
+ raise ProbingError (
76
+ f"The '{ result .driver_cls .__name__ } ' driver does not support"
77
+ " performance measuring"
78
+ )
79
+
79
80
return result
80
81
81
82
0 commit comments