Fix problem with unmatched instantianated gtest type-parametrized tests.
Example output before change: ``` Additional test environment: CHROME_HEADLESS=1 LANG=en_US.UTF-8 Command: out/Desktop/components_unittests --test-launcher-bot-mode --gtest_filter=ProtoFetcherTest.*:*/ProtoFetcherTest.*/*:ProtoFetcherTest.*/*:ProtoFetcherTest/*.* --fast-local-dev IMPORTANT DEBUGGING NOTE: batches of tests are run inside their own process. For debugging a test inside a debugger, use the --gtest_filter=<your_test_name> flag along with --single-process-tests. Using sharding settings from environment. This is shard 0/1 Using 96 parallel jobs. Filter "*ProtoFetcherTest/*.*" would have matched: AllFetchers/ProtoFetcherTest/0.ConfiguresEndpoint Filter "*ProtoFetcherTest/*.*" would have matched: AllFetchers/ProtoFetcherTest/0.AddsPayload ``` (note that second filter has mismatched slash). Change-Id: Ie9a5df2746000468a96e8bf4a13194eff8bc4a63 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4614966 Reviewed-by: Dirk Pranke <dpranke@google.com> Commit-Queue: Tomek Jurkiewicz <tju@google.com> Cr-Commit-Position: refs/heads/main@{#1157984}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
47e7a37749
commit
4a83ec1ebc
@ -171,7 +171,7 @@ def GetFiltersForTests(tests, class_only):
|
||||
if class_only:
|
||||
fixtures = set([t.split('.')[0] for t in tests])
|
||||
return [c + '.*' for c in fixtures] + \
|
||||
['*/' + c + '.*/*' for c in fixtures] + \
|
||||
['*/' + c + '/*.*' for c in fixtures] + \
|
||||
[c + '.*/*' for c in fixtures] + \
|
||||
[c + '/*.*' for c in fixtures]
|
||||
else:
|
||||
|
@ -46,7 +46,7 @@ class Foo(unittest.TestCase):
|
||||
tests = ["TestSuite.TestName"]
|
||||
self.assertEqual(
|
||||
list(GetFiltersForTests(tests, class_only=True)),
|
||||
["TestSuite.*", "*/TestSuite.*/*", "TestSuite.*/*", "TestSuite/*.*"])
|
||||
["TestSuite.*", "*/TestSuite/*.*", "TestSuite.*/*", "TestSuite/*.*"])
|
||||
self.assertEqual(list(GetFiltersForTests(tests, class_only=False)), [
|
||||
"TestSuite.TestName", "*/TestSuite.TestName/*", "TestSuite.TestName/*",
|
||||
"TestSuite/*.TestName"
|
||||
|
Reference in New Issue
Block a user