Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(883)

Unified Diff: tools/telemetry/telemetry/page/test_expectations.py

Issue 49353004: Added ability to set telemetry expectations against test names as well as URLs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/page/test_expectations_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/test_expectations.py
diff --git a/tools/telemetry/telemetry/page/test_expectations.py b/tools/telemetry/telemetry/page/test_expectations.py
index 2c2f2c679c51b4269492535a8df13e6c6e46892b..df2e68632d074d0a538388b25ea4f993c3c5ed66 100644
--- a/tools/telemetry/telemetry/page/test_expectations.py
+++ b/tools/telemetry/telemetry/page/test_expectations.py
@@ -12,9 +12,10 @@ GPU_MODIFIERS = ['amd', 'arm', 'broadcom', 'hisilicon', 'intel', 'imagination',
CONFIG_MODIFIERS = ['debug', 'release']
class Expectation(object):
- def __init__(self, expectation, url_pattern, conditions=None, bug=None):
+ def __init__(self, expectation, pattern, conditions=None, bug=None):
self.expectation = expectation.lower()
- self.url_pattern = url_pattern
+ self.name_pattern = pattern
+ self.url_pattern = pattern
self.bug = bug
self.os_conditions = []
@@ -71,7 +72,9 @@ class TestExpectations(object):
gpu_info = None
for e in self.expectations:
- if fnmatch.fnmatch(page.url, e.url_pattern):
+ matches_url = fnmatch.fnmatch(page.url, e.url_pattern)
+ matches_name = page.name and fnmatch.fnmatch(page.name, e.name_pattern)
+ if matches_url or matches_name:
if gpu_info == None and browser.supports_system_info:
gpu_info = browser.GetSystemInfo().gpu
if self._ModifiersApply(platform, gpu_info, e):
« no previous file with comments | « no previous file | tools/telemetry/telemetry/page/test_expectations_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698