Skip to content

Commit 3bdb407

Browse files
committed
Invert 'StandardTestFinder' and 'PerfTestFinder' declaration order
Preliminary commit, we'll need to make 'PerfTestFinder' inherits from 'StandardTestFinder' in a later commit.
1 parent 661b3b5 commit 3bdb407

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

testsuite/testsuite.py

+26-25
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
benchmarks_driver, refactor_driver
2121
)
2222

23-
class PerfTestFinder(YAMLTestFinder):
23+
24+
class StandardTestFinder(YAMLTestFinder):
2425
"""
25-
Testcase finder to use in perf mode.
26+
Testcase finder to use in stadard mode.
2627
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.
3133
"""
3234

3335
def probe(self,
@@ -38,30 +40,21 @@ def probe(self,
3840
# Probe testcases as usual
3941
result = super().probe(testsuite, dirpath, dirnames, filenames)
4042

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:
4445
return None
4546

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-
5347
return result
5448

5549

56-
class StandardTestFinder(YAMLTestFinder):
50+
class PerfTestFinder(YAMLTestFinder):
5751
"""
58-
Testcase finder to use in stadard mode.
52+
Testcase finder to use in perf mode.
5953
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.
6558
"""
6659

6760
def probe(self,
@@ -72,10 +65,18 @@ def probe(self,
7265
# Probe testcases as usual
7366
result = super().probe(testsuite, dirpath, dirnames, filenames)
7467

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:
7771
return None
7872

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+
7980
return result
8081

8182

0 commit comments

Comments
 (0)