Skip to content

Commit 46efa1b

Browse files
Liviu RauV8 LUCI CQ
authored andcommitted
[resultdb] Make suffixes more distinguishable
Test ids would get an uniform format between different kinds of tests: prefix//test_id//suffix - prefix: - empty for regular tests - or 'special test' token, as in 'numfuzz' - test_id is the full name of the test as generated by test runner: - suite_name/path/to/actual/test_name - suffix is anything a test runner processor might want to add to the name: - numfuzz processor will add 'analysis' of a numeric value - variant processor will add the variant name Bug: v8:13316 Change-Id: Ied8f958173f82d8e26c62e39ccc21167ca2928ab Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4084763 Commit-Queue: Liviu Rau <[email protected]> Reviewed-by: Michael Achenbach <[email protected]> Cr-Commit-Position: refs/heads/main@{#84736}
1 parent ada6f41 commit 46efa1b

6 files changed

Lines changed: 21 additions & 13 deletions

File tree

tools/testrunner/objects/testcase.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,18 @@ def full_name(self):
460460
def __str__(self):
461461
return self.full_name
462462

463+
def test_suffixes(self):
464+
suffixes = self.origin.test_suffixes() if self.origin else []
465+
current_suffix = self.processor.test_suffix(self)
466+
if current_suffix:
467+
suffixes.append(str(current_suffix))
468+
return suffixes
469+
463470
@property
464471
def rdb_test_id(self):
465-
rdb_id = self.origin.rdb_test_id if self.origin else self.full_name
466-
rdb_id += self.processor.test_suffix(self)
467-
return rdb_id
472+
suffixes = '/'.join(self.test_suffixes())
473+
full_suffix = ('//' + suffixes) if suffixes else ''
474+
return self.full_name + full_suffix
468475

469476
@property
470477
def processor_name(self):
@@ -475,7 +482,7 @@ class DuckProcessor:
475482
"""Dummy default processor for original tests implemented by duck-typing."""
476483

477484
def test_suffix(self, test):
478-
return ''
485+
return None
479486

480487
@property
481488
def name(self):

tools/testrunner/objects/testcase_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ def testSubtestsProperties(self):
3131
self.assertEqual(test.keep_output, False)
3232

3333
subtest = test.create_subtest(FakeProcessor(), 0, keep_output=True)
34-
self.assertEqual(subtest.rdb_test_id, 'fakeSuite/parent/fakep/0')
34+
self.assertEqual(subtest.rdb_test_id, 'fakeSuite/parent//fakep/0')
3535
# provide by FakeProcessor
3636
self.assertEqual(subtest.processor.name, 'fake_processor1')
3737
self.assertEqual(subtest.procid, 'fakeSuite/parent.fake_processor1-0')
3838
self.assertEqual(subtest.keep_output, True)
3939

4040
subsubtest = subtest.create_subtest(FakeProcessor(), 1)
41-
self.assertEqual(subsubtest.rdb_test_id, 'fakeSuite/parent/fakep/0/fakep/1')
41+
self.assertEqual(subsubtest.rdb_test_id,
42+
'fakeSuite/parent//fakep/0/fakep/1')
4243
# provide by FakeProcessor
4344
self.assertEqual(subsubtest.processor.name, 'fake_processor2')
4445
self.assertEqual(subsubtest.procid,
@@ -68,7 +69,7 @@ def name(self):
6869
return f'fake_processor{self.idx}'
6970

7071
def test_suffix(self, test):
71-
return f'/fakep/{test.subtest_id}'
72+
return f'fakep/{test.subtest_id}'
7273

7374

7475
if __name__ == '__main__':

tools/testrunner/standard_runner_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,15 @@ def tag_dict(tags):
179179
)
180180

181181
self.assertEquals(len(records), 3)
182-
self.assertEquals(records[0]['testId'], 'sweet/bananaflakes/stress')
182+
self.assertEquals(records[0]['testId'], 'sweet/bananaflakes//stress')
183183
self.assertEquals(tag_dict(records[0]['tags'])['run'], '1')
184184
self.assertFalse(records[0]['expected'])
185185

186-
self.assertEquals(records[1]['testId'], 'sweet/bananaflakes/stress')
186+
self.assertEquals(records[1]['testId'], 'sweet/bananaflakes//stress')
187187
self.assertEquals(tag_dict(records[1]['tags'])['run'], '2')
188188
self.assertTrue(records[1]['expected'])
189189

190-
self.assertEquals(records[2]['testId'], 'sweet/bananaflakes/default')
190+
self.assertEquals(records[2]['testId'], 'sweet/bananaflakes//default')
191191
self.assertEquals(tag_dict(records[2]['tags'])['run'], '1')
192192
self.assertTrue(records[2]['expected'])
193193

tools/testrunner/testproc/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def _result_for(self, test, subtest, result):
163163

164164
def test_suffix(self, test):
165165
"""Default implementation of rdb test id suffix generated by a producer"""
166-
return ''
166+
return None
167167

168168

169169
class TestProcFilter(TestProc):

tools/testrunner/testproc/fuzzer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def __init__(self, rng, count, fuzzers, disable_analysis=False):
173173
self._gens = {}
174174

175175
def test_suffix(self, test):
176-
return '/' + test.subtest_id
176+
return test.subtest_id
177177

178178
def _next_test(self, test):
179179
if self.is_stopped:

tools/testrunner/testproc/variant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self, variants):
2929
self._variants = variants
3030

3131
def test_suffix(self, test):
32-
return f'/{test.variant}'
32+
return test.variant
3333

3434
def _next_test(self, test):
3535
gen = self._variants_gen(test)

0 commit comments

Comments
 (0)