Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404046 )

Change subject: webperf: Introduce 'templates' in test fixture and use for 
mwload
......................................................................

webperf: Introduce 'templates' in test fixture and use for mwload

* Create a 'templates' key in the fixture that the test runner
  ignores.

* Move the existing 'expected_uncached_desktop' list there.

* Abstract another template list for 'expected_uncached_desktop_mwload'
  that is also used by the non-navtiming test.

* Add 'flatten()' utility method given the ref/merge ref/extend syntax
  only works for key-value objects (dict) in YAML, not for sequences (list).

Change-Id: Ib43ab6a2d21c3148a4ce8954cc81166ebc2c0237
---
M modules/webperf/files/navtiming_fixture.yaml
M modules/webperf/files/navtiming_test.py
2 files changed, 160 insertions(+), 156 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/46/404046/1

diff --git a/modules/webperf/files/navtiming_fixture.yaml 
b/modules/webperf/files/navtiming_fixture.yaml
index 494a6eb..8b56c54 100644
--- a/modules/webperf/files/navtiming_fixture.yaml
+++ b/modules/webperf/files/navtiming_fixture.yaml
@@ -14,148 +14,153 @@
 # - webHost: example
 # - wiki: example
 
+templates:
+  - &expected_uncached_desktop_mwload
+    - frontend.navtiming.mediaWikiLoadComplete.desktop.authenticated:1270|ms
+    - frontend.navtiming.mediaWikiLoadComplete.desktop.overall:1270|ms
+    - frontend.navtiming.mediaWikiLoadComplete.overall:1270|ms
+    - frontend.navtiming.mediaWikiLoadComplete.by_browser.Firefox.55:1270|ms
+    - frontend.navtiming.mediaWikiLoadComplete.by_browser.Firefox.all:1270|ms
+    - frontend.navtiming.mediaWikiLoadComplete.by_continent.Europe:1270|ms
+    - frontend.navtiming2.mediaWikiLoad.desktop.authenticated:1270|ms
+    - frontend.navtiming2.mediaWikiLoad.desktop.overall:1270|ms
+    - frontend.navtiming2.mediaWikiLoad.overall:1270|ms
+    - frontend.navtiming2.mediaWikiLoad.by_browser.Firefox.55:1270|ms
+    - frontend.navtiming2.mediaWikiLoad.by_browser.Firefox.all:1270|ms
+    - frontend.navtiming2.mediaWikiLoad.by_continent.Europe:1270|ms
+  - &expected_uncached_desktop
+    - frontend.navtiming.loadEventStart.desktop.authenticated:1965|ms
+    - frontend.navtiming.loadEventStart.desktop.overall:1965|ms
+    - frontend.navtiming.loadEventStart.overall:1965|ms
+    - frontend.navtiming.loadEventStart.by_browser.Firefox.55:1965|ms
+    - frontend.navtiming.loadEventStart.by_browser.Firefox.all:1965|ms
+    - frontend.navtiming.loadEventStart.by_continent.Europe:1965|ms
+    - frontend.navtiming.dnsLookup.desktop.authenticated:1|ms
+    - frontend.navtiming.dnsLookup.desktop.overall:1|ms
+    - frontend.navtiming.dnsLookup.overall:1|ms
+    - frontend.navtiming.dnsLookup.by_browser.Firefox.55:1|ms
+    - frontend.navtiming.dnsLookup.by_browser.Firefox.all:1|ms
+    - frontend.navtiming.dnsLookup.by_continent.Europe:1|ms
+    - frontend.navtiming.loadEventEnd.desktop.authenticated:1968|ms
+    - frontend.navtiming.loadEventEnd.desktop.overall:1968|ms
+    - frontend.navtiming.loadEventEnd.overall:1968|ms
+    - frontend.navtiming.loadEventEnd.by_browser.Firefox.55:1968|ms
+    - frontend.navtiming.loadEventEnd.by_browser.Firefox.all:1968|ms
+    - frontend.navtiming.loadEventEnd.by_continent.Europe:1968|ms
+    - frontend.navtiming.waiting.desktop.authenticated:374|ms
+    - frontend.navtiming.waiting.desktop.overall:374|ms
+    - frontend.navtiming.waiting.overall:374|ms
+    - frontend.navtiming.waiting.by_browser.Firefox.55:374|ms
+    - frontend.navtiming.waiting.by_browser.Firefox.all:374|ms
+    - frontend.navtiming.waiting.by_continent.Europe:374|ms
+    - frontend.navtiming.connecting.by_continent.Europe:0|ms
+    - frontend.navtiming.fetchStart.desktop.authenticated:1|ms
+    - frontend.navtiming.fetchStart.desktop.overall:1|ms
+    - frontend.navtiming.fetchStart.overall:1|ms
+    - frontend.navtiming.fetchStart.by_browser.Firefox.55:1|ms
+    - frontend.navtiming.fetchStart.by_browser.Firefox.all:1|ms
+    - frontend.navtiming.fetchStart.by_continent.Europe:1|ms
+    - frontend.navtiming.domComplete.desktop.authenticated:1965|ms
+    - frontend.navtiming.domComplete.desktop.overall:1965|ms
+    - frontend.navtiming.domComplete.overall:1965|ms
+    - frontend.navtiming.domComplete.by_browser.Firefox.55:1965|ms
+    - frontend.navtiming.domComplete.by_browser.Firefox.all:1965|ms
+    - frontend.navtiming.domComplete.by_continent.Europe:1965|ms
+    - frontend.navtiming.receiving.desktop.authenticated:35|ms
+    - frontend.navtiming.receiving.desktop.overall:35|ms
+    - frontend.navtiming.receiving.overall:35|ms
+    - frontend.navtiming.receiving.by_browser.Firefox.55:35|ms
+    - frontend.navtiming.receiving.by_browser.Firefox.all:35|ms
+    - frontend.navtiming.receiving.by_continent.Europe:35|ms
+    - frontend.navtiming.responseStart.desktop.authenticated:380|ms
+    - frontend.navtiming.responseStart.desktop.overall:380|ms
+    - frontend.navtiming.responseStart.overall:380|ms
+    - frontend.navtiming.responseStart.by_browser.Firefox.55:380|ms
+    - frontend.navtiming.responseStart.by_browser.Firefox.all:380|ms
+    - frontend.navtiming.responseStart.by_continent.Europe:380|ms
+    - frontend.navtiming.domInteractive.desktop.authenticated:956|ms
+    - frontend.navtiming.domInteractive.desktop.overall:956|ms
+    - frontend.navtiming.domInteractive.overall:956|ms
+    - frontend.navtiming.domInteractive.by_browser.Firefox.55:956|ms
+    - frontend.navtiming.domInteractive.by_browser.Firefox.all:956|ms
+    - frontend.navtiming.domInteractive.by_continent.Europe:956|ms
+    - frontend.navtiming2.onLoad.desktop.authenticated:3|ms
+    - frontend.navtiming2.onLoad.desktop.overall:3|ms
+    - frontend.navtiming2.onLoad.overall:3|ms
+    - frontend.navtiming2.onLoad.by_browser.Firefox.55:3|ms
+    - frontend.navtiming2.onLoad.by_browser.Firefox.all:3|ms
+    - frontend.navtiming2.onLoad.by_continent.Europe:3|ms
+    - frontend.navtiming2.dns.desktop.authenticated:1|ms
+    - frontend.navtiming2.dns.desktop.overall:1|ms
+    - frontend.navtiming2.dns.overall:1|ms
+    - frontend.navtiming2.dns.by_browser.Firefox.55:1|ms
+    - frontend.navtiming2.dns.by_browser.Firefox.all:1|ms
+    - frontend.navtiming2.dns.by_continent.Europe:1|ms
+    - frontend.navtiming2.unload.desktop.authenticated:4|ms
+    - frontend.navtiming2.unload.desktop.overall:4|ms
+    - frontend.navtiming2.unload.overall:4|ms
+    - frontend.navtiming2.unload.by_browser.Firefox.55:4|ms
+    - frontend.navtiming2.unload.by_browser.Firefox.all:4|ms
+    - frontend.navtiming2.unload.by_continent.Europe:4|ms
+    - frontend.navtiming2.processing.desktop.authenticated:1550|ms
+    - frontend.navtiming2.processing.desktop.overall:1550|ms
+    - frontend.navtiming2.processing.overall:1550|ms
+    - frontend.navtiming2.processing.by_browser.Firefox.55:1550|ms
+    - frontend.navtiming2.processing.by_browser.Firefox.all:1550|ms
+    - frontend.navtiming2.processing.by_continent.Europe:1550|ms
+    - frontend.navtiming2.request.desktop.authenticated:374|ms
+    - frontend.navtiming2.request.desktop.overall:374|ms
+    - frontend.navtiming2.request.overall:374|ms
+    - frontend.navtiming2.request.by_browser.Firefox.55:374|ms
+    - frontend.navtiming2.request.by_browser.Firefox.all:374|ms
+    - frontend.navtiming2.request.by_continent.Europe:374|ms
+    - frontend.navtiming2.tcp.desktop.authenticated:0|ms
+    - frontend.navtiming2.tcp.desktop.overall:0|ms
+    - frontend.navtiming2.tcp.overall:0|ms
+    - frontend.navtiming2.tcp.by_browser.Firefox.55:0|ms
+    - frontend.navtiming2.tcp.by_browser.Firefox.all:0|ms
+    - frontend.navtiming2.tcp.by_continent.Europe:0|ms
+    - frontend.navtiming2.loadEventEnd.desktop.authenticated:1967|ms
+    - frontend.navtiming2.loadEventEnd.desktop.overall:1967|ms
+    - frontend.navtiming2.loadEventEnd.overall:1967|ms
+    - frontend.navtiming2.loadEventEnd.by_browser.Firefox.55:1967|ms
+    - frontend.navtiming2.loadEventEnd.by_browser.Firefox.all:1967|ms
+    - frontend.navtiming2.loadEventEnd.by_continent.Europe:1967|ms
+    - frontend.navtiming2.loadEventStart.desktop.authenticated:1964|ms
+    - frontend.navtiming2.loadEventStart.desktop.overall:1964|ms
+    - frontend.navtiming2.loadEventStart.overall:1964|ms
+    - frontend.navtiming2.loadEventStart.by_browser.Firefox.55:1964|ms
+    - frontend.navtiming2.loadEventStart.by_browser.Firefox.all:1964|ms
+    - frontend.navtiming2.loadEventStart.by_continent.Europe:1964|ms
+    - frontend.navtiming2.response.desktop.authenticated:35|ms
+    - frontend.navtiming2.response.desktop.overall:35|ms
+    - frontend.navtiming2.response.overall:35|ms
+    - frontend.navtiming2.response.by_browser.Firefox.55:35|ms
+    - frontend.navtiming2.response.by_browser.Firefox.all:35|ms
+    - frontend.navtiming2.response.by_continent.Europe:35|ms
+    - frontend.navtiming2.domComplete.desktop.authenticated:1964|ms
+    - frontend.navtiming2.domComplete.desktop.overall:1964|ms
+    - frontend.navtiming2.domComplete.overall:1964|ms
+    - frontend.navtiming2.domComplete.by_browser.Firefox.55:1964|ms
+    - frontend.navtiming2.domComplete.by_browser.Firefox.all:1964|ms
+    - frontend.navtiming2.domComplete.by_continent.Europe:1964|ms
+    - frontend.navtiming2.responseStart.desktop.authenticated:379|ms
+    - frontend.navtiming2.responseStart.desktop.overall:379|ms
+    - frontend.navtiming2.responseStart.overall:379|ms
+    - frontend.navtiming2.responseStart.by_browser.Firefox.55:379|ms
+    - frontend.navtiming2.responseStart.by_browser.Firefox.all:379|ms
+    - frontend.navtiming2.responseStart.by_continent.Europe:379|ms
+    - frontend.navtiming2.domInteractive.desktop.authenticated:955|ms
+    - frontend.navtiming2.domInteractive.desktop.overall:955|ms
+    - frontend.navtiming2.domInteractive.overall:955|ms
+    - frontend.navtiming2.domInteractive.by_browser.Firefox.55:955|ms
+    - frontend.navtiming2.domInteractive.by_browser.Firefox.all:955|ms
+    - frontend.navtiming2.domInteractive.by_continent.Europe:955|ms
+    - *expected_uncached_desktop_mwload
+
 Uncached page view from desktop:
  input: {"event": {"action": "history", "connectEnd": 6, "connectStart": 6, 
"dnsLookup": 1, "domComplete": 1965, "domInteractive": 956, "fetchStart": 1, 
"isAnon": false, "isHiDPI": false, "isHttp2": true, "loadEventEnd": 1968, 
"loadEventStart": 1965, "mediaWikiLoadComplete": 1270, "mediaWikiVersion": 
"1.30.0-wmf.19", "namespaceId": 1, "originCountry": "RS", "originRegion": "VO", 
"pageId": 1, "requestStart": 6, "responseEnd": 415, "responseStart": 380, 
"revId": 1, "unload": 4}, "recvFrom": "example", "revision": 1, "schema": 
"NavigationTiming", "seqId": 1, "timestamp": 1, "userAgent": "{\"os_minor\": 
null, \"is_bot\": false, \"os_major\": null, \"device_family\": \"Other\", 
\"os_family\": \"Windows 8.1\", \"browser_minor\": \"0\", \"wmf_app_version\": 
\"-\", \"browser_major\": \"55\", \"browser_family\": \"Firefox\", 
\"is_mediawiki\": false}", "uuid": "example", "webHost": "example", "wiki": 
"example"}
- expect: &expected_uncached_desktop
-  - frontend.navtiming.loadEventStart.desktop.authenticated:1965|ms
-  - frontend.navtiming.loadEventStart.desktop.overall:1965|ms
-  - frontend.navtiming.loadEventStart.overall:1965|ms
-  - frontend.navtiming.loadEventStart.by_browser.Firefox.55:1965|ms
-  - frontend.navtiming.loadEventStart.by_browser.Firefox.all:1965|ms
-  - frontend.navtiming.loadEventStart.by_continent.Europe:1965|ms
-  - frontend.navtiming.dnsLookup.desktop.authenticated:1|ms
-  - frontend.navtiming.dnsLookup.desktop.overall:1|ms
-  - frontend.navtiming.dnsLookup.overall:1|ms
-  - frontend.navtiming.dnsLookup.by_browser.Firefox.55:1|ms
-  - frontend.navtiming.dnsLookup.by_browser.Firefox.all:1|ms
-  - frontend.navtiming.dnsLookup.by_continent.Europe:1|ms
-  - frontend.navtiming.mediaWikiLoadComplete.desktop.authenticated:1270|ms
-  - frontend.navtiming.mediaWikiLoadComplete.desktop.overall:1270|ms
-  - frontend.navtiming.mediaWikiLoadComplete.overall:1270|ms
-  - frontend.navtiming.mediaWikiLoadComplete.by_browser.Firefox.55:1270|ms
-  - frontend.navtiming.mediaWikiLoadComplete.by_browser.Firefox.all:1270|ms
-  - frontend.navtiming.mediaWikiLoadComplete.by_continent.Europe:1270|ms
-  - frontend.navtiming.loadEventEnd.desktop.authenticated:1968|ms
-  - frontend.navtiming.loadEventEnd.desktop.overall:1968|ms
-  - frontend.navtiming.loadEventEnd.overall:1968|ms
-  - frontend.navtiming.loadEventEnd.by_browser.Firefox.55:1968|ms
-  - frontend.navtiming.loadEventEnd.by_browser.Firefox.all:1968|ms
-  - frontend.navtiming.loadEventEnd.by_continent.Europe:1968|ms
-  - frontend.navtiming.waiting.desktop.authenticated:374|ms
-  - frontend.navtiming.waiting.desktop.overall:374|ms
-  - frontend.navtiming.waiting.overall:374|ms
-  - frontend.navtiming.waiting.by_browser.Firefox.55:374|ms
-  - frontend.navtiming.waiting.by_browser.Firefox.all:374|ms
-  - frontend.navtiming.waiting.by_continent.Europe:374|ms
-  - frontend.navtiming.connecting.by_continent.Europe:0|ms
-  - frontend.navtiming.fetchStart.desktop.authenticated:1|ms
-  - frontend.navtiming.fetchStart.desktop.overall:1|ms
-  - frontend.navtiming.fetchStart.overall:1|ms
-  - frontend.navtiming.fetchStart.by_browser.Firefox.55:1|ms
-  - frontend.navtiming.fetchStart.by_browser.Firefox.all:1|ms
-  - frontend.navtiming.fetchStart.by_continent.Europe:1|ms
-  - frontend.navtiming.domComplete.desktop.authenticated:1965|ms
-  - frontend.navtiming.domComplete.desktop.overall:1965|ms
-  - frontend.navtiming.domComplete.overall:1965|ms
-  - frontend.navtiming.domComplete.by_browser.Firefox.55:1965|ms
-  - frontend.navtiming.domComplete.by_browser.Firefox.all:1965|ms
-  - frontend.navtiming.domComplete.by_continent.Europe:1965|ms
-  - frontend.navtiming.receiving.desktop.authenticated:35|ms
-  - frontend.navtiming.receiving.desktop.overall:35|ms
-  - frontend.navtiming.receiving.overall:35|ms
-  - frontend.navtiming.receiving.by_browser.Firefox.55:35|ms
-  - frontend.navtiming.receiving.by_browser.Firefox.all:35|ms
-  - frontend.navtiming.receiving.by_continent.Europe:35|ms
-  - frontend.navtiming.responseStart.desktop.authenticated:380|ms
-  - frontend.navtiming.responseStart.desktop.overall:380|ms
-  - frontend.navtiming.responseStart.overall:380|ms
-  - frontend.navtiming.responseStart.by_browser.Firefox.55:380|ms
-  - frontend.navtiming.responseStart.by_browser.Firefox.all:380|ms
-  - frontend.navtiming.responseStart.by_continent.Europe:380|ms
-  - frontend.navtiming.domInteractive.desktop.authenticated:956|ms
-  - frontend.navtiming.domInteractive.desktop.overall:956|ms
-  - frontend.navtiming.domInteractive.overall:956|ms
-  - frontend.navtiming.domInteractive.by_browser.Firefox.55:956|ms
-  - frontend.navtiming.domInteractive.by_browser.Firefox.all:956|ms
-  - frontend.navtiming.domInteractive.by_continent.Europe:956|ms
-  - frontend.navtiming2.onLoad.desktop.authenticated:3|ms
-  - frontend.navtiming2.onLoad.desktop.overall:3|ms
-  - frontend.navtiming2.onLoad.overall:3|ms
-  - frontend.navtiming2.onLoad.by_browser.Firefox.55:3|ms
-  - frontend.navtiming2.onLoad.by_browser.Firefox.all:3|ms
-  - frontend.navtiming2.onLoad.by_continent.Europe:3|ms
-  - frontend.navtiming2.dns.desktop.authenticated:1|ms
-  - frontend.navtiming2.dns.desktop.overall:1|ms
-  - frontend.navtiming2.dns.overall:1|ms
-  - frontend.navtiming2.dns.by_browser.Firefox.55:1|ms
-  - frontend.navtiming2.dns.by_browser.Firefox.all:1|ms
-  - frontend.navtiming2.dns.by_continent.Europe:1|ms
-  - frontend.navtiming2.unload.desktop.authenticated:4|ms
-  - frontend.navtiming2.unload.desktop.overall:4|ms
-  - frontend.navtiming2.unload.overall:4|ms
-  - frontend.navtiming2.unload.by_browser.Firefox.55:4|ms
-  - frontend.navtiming2.unload.by_browser.Firefox.all:4|ms
-  - frontend.navtiming2.unload.by_continent.Europe:4|ms
-  - frontend.navtiming2.processing.desktop.authenticated:1550|ms
-  - frontend.navtiming2.processing.desktop.overall:1550|ms
-  - frontend.navtiming2.processing.overall:1550|ms
-  - frontend.navtiming2.processing.by_browser.Firefox.55:1550|ms
-  - frontend.navtiming2.processing.by_browser.Firefox.all:1550|ms
-  - frontend.navtiming2.processing.by_continent.Europe:1550|ms
-  - frontend.navtiming2.request.desktop.authenticated:374|ms
-  - frontend.navtiming2.request.desktop.overall:374|ms
-  - frontend.navtiming2.request.overall:374|ms
-  - frontend.navtiming2.request.by_browser.Firefox.55:374|ms
-  - frontend.navtiming2.request.by_browser.Firefox.all:374|ms
-  - frontend.navtiming2.request.by_continent.Europe:374|ms
-  - frontend.navtiming2.tcp.desktop.authenticated:0|ms
-  - frontend.navtiming2.tcp.desktop.overall:0|ms
-  - frontend.navtiming2.tcp.overall:0|ms
-  - frontend.navtiming2.tcp.by_browser.Firefox.55:0|ms
-  - frontend.navtiming2.tcp.by_browser.Firefox.all:0|ms
-  - frontend.navtiming2.tcp.by_continent.Europe:0|ms
-  - frontend.navtiming2.loadEventEnd.desktop.authenticated:1967|ms
-  - frontend.navtiming2.loadEventEnd.desktop.overall:1967|ms
-  - frontend.navtiming2.loadEventEnd.overall:1967|ms
-  - frontend.navtiming2.loadEventEnd.by_browser.Firefox.55:1967|ms
-  - frontend.navtiming2.loadEventEnd.by_browser.Firefox.all:1967|ms
-  - frontend.navtiming2.loadEventEnd.by_continent.Europe:1967|ms
-  - frontend.navtiming2.loadEventStart.desktop.authenticated:1964|ms
-  - frontend.navtiming2.loadEventStart.desktop.overall:1964|ms
-  - frontend.navtiming2.loadEventStart.overall:1964|ms
-  - frontend.navtiming2.loadEventStart.by_browser.Firefox.55:1964|ms
-  - frontend.navtiming2.loadEventStart.by_browser.Firefox.all:1964|ms
-  - frontend.navtiming2.loadEventStart.by_continent.Europe:1964|ms
-  - frontend.navtiming2.response.desktop.authenticated:35|ms
-  - frontend.navtiming2.response.desktop.overall:35|ms
-  - frontend.navtiming2.response.overall:35|ms
-  - frontend.navtiming2.response.by_browser.Firefox.55:35|ms
-  - frontend.navtiming2.response.by_browser.Firefox.all:35|ms
-  - frontend.navtiming2.response.by_continent.Europe:35|ms
-  - frontend.navtiming2.domComplete.desktop.authenticated:1964|ms
-  - frontend.navtiming2.domComplete.desktop.overall:1964|ms
-  - frontend.navtiming2.domComplete.overall:1964|ms
-  - frontend.navtiming2.domComplete.by_browser.Firefox.55:1964|ms
-  - frontend.navtiming2.domComplete.by_browser.Firefox.all:1964|ms
-  - frontend.navtiming2.domComplete.by_continent.Europe:1964|ms
-  - frontend.navtiming2.responseStart.desktop.authenticated:379|ms
-  - frontend.navtiming2.responseStart.desktop.overall:379|ms
-  - frontend.navtiming2.responseStart.overall:379|ms
-  - frontend.navtiming2.responseStart.by_browser.Firefox.55:379|ms
-  - frontend.navtiming2.responseStart.by_browser.Firefox.all:379|ms
-  - frontend.navtiming2.responseStart.by_continent.Europe:379|ms
-  - frontend.navtiming2.domInteractive.desktop.authenticated:955|ms
-  - frontend.navtiming2.domInteractive.desktop.overall:955|ms
-  - frontend.navtiming2.domInteractive.overall:955|ms
-  - frontend.navtiming2.domInteractive.by_browser.Firefox.55:955|ms
-  - frontend.navtiming2.domInteractive.by_browser.Firefox.all:955|ms
-  - frontend.navtiming2.domInteractive.by_continent.Europe:955|ms
-  - frontend.navtiming2.mediaWikiLoad.desktop.authenticated:1270|ms
-  - frontend.navtiming2.mediaWikiLoad.desktop.overall:1270|ms
-  - frontend.navtiming2.mediaWikiLoad.overall:1270|ms
-  - frontend.navtiming2.mediaWikiLoad.by_browser.Firefox.55:1270|ms
-  - frontend.navtiming2.mediaWikiLoad.by_browser.Firefox.all:1270|ms
-  - frontend.navtiming2.mediaWikiLoad.by_continent.Europe:1270|ms
+ expect: *expected_uncached_desktop
 
 Cached page view from desktop:
  input: {"event": {"action": "view", "connectEnd": 0, "connectStart": 0, 
"dnsLookup": 0, "domComplete": 1201, "domInteractive": 576, "fetchStart": 0, 
"firstPaint": 635, "isAnon": true, "isHiDPI": false, "isHttp2": true, 
"loadEventEnd": 1203, "loadEventStart": 1201, "mediaWikiLoadComplete": 667, 
"mediaWikiVersion": "1.30.0-wmf.19", "namespaceId": 1, "originCountry": "MA", 
"originRegion": "01", "pageId": 1, "requestStart": 16, "responseEnd": 373, 
"responseStart": 360, "revId": 1, "unload": 0}, "recvFrom": "example", 
"revision": 1, "schema": "NavigationTiming", "seqId": 1, "timestamp": 1, 
"userAgent": "{\"os_minor\": null, \"is_bot\": false, \"os_major\": null, 
\"device_family\": \"Other\", \"os_family\": \"Windows 7\", \"browser_minor\": 
\"0\", \"wmf_app_version\": \"-\", \"browser_major\": \"60\", 
\"browser_family\": \"Chrome\", \"is_mediawiki\": false}", "uuid": "example", 
"webHost": "example", "wiki": "example"}
@@ -303,20 +308,8 @@
   - frontend.navtiming2.mediaWikiLoad.by_continent.Africa:667|ms
 
 Page view without NavTiming support:
- input: {"event": {"action": "delete", "isAnon": false, "isHiDPI": true, 
"isHttp2": true, "mediaWikiLoadComplete": 3513, "mediaWikiVersion": 
"1.30.0-wmf.19", "namespaceId": 1, "originCountry": "PL", "originRegion": "LD", 
"pageId": 1, "revId": 1}, "recvFrom": "example", "revision": 1, "schema": 
"NavigationTiming", "seqId": 1, "timestamp": 1, "userAgent": "{\"os_minor\": 
\"4\", \"is_bot\": false, \"os_major\": \"4\", \"device_family\": \"Samsung 
SM-T230\", \"os_family\": \"Android\", \"browser_minor\": \"0\", 
\"wmf_app_version\": \"-\", \"browser_major\": \"59\", \"browser_family\": 
\"Chrome\", \"is_mediawiki\": false}", "uuid": "example", "webHost": "example", 
"wiki": "example"}
- expect:
-  - frontend.navtiming.mediaWikiLoadComplete.desktop.authenticated:3513|ms
-  - frontend.navtiming.mediaWikiLoadComplete.desktop.overall:3513|ms
-  - frontend.navtiming.mediaWikiLoadComplete.overall:3513|ms
-  - frontend.navtiming.mediaWikiLoadComplete.by_browser.Chrome.59:3513|ms
-  - frontend.navtiming.mediaWikiLoadComplete.by_browser.Chrome.all:3513|ms
-  - frontend.navtiming.mediaWikiLoadComplete.by_continent.Europe:3513|ms
-  - frontend.navtiming2.mediaWikiLoad.desktop.authenticated:3513|ms
-  - frontend.navtiming2.mediaWikiLoad.desktop.overall:3513|ms
-  - frontend.navtiming2.mediaWikiLoad.overall:3513|ms
-  - frontend.navtiming2.mediaWikiLoad.by_browser.Chrome.59:3513|ms
-  - frontend.navtiming2.mediaWikiLoad.by_browser.Chrome.all:3513|ms
-  - frontend.navtiming2.mediaWikiLoad.by_continent.Europe:3513|ms
+ input: {"event": {"action": "delete", "isAnon": false, "isHiDPI": true, 
"isHttp2": true, "mediaWikiLoadComplete": 1270, "mediaWikiVersion": 
"1.30.0-wmf.19", "namespaceId": 1, "originCountry": "RS", "originRegion": "VO", 
"pageId": 1, "revId": 1}, "recvFrom": "example", "revision": 1, "schema": 
"NavigationTiming", "seqId": 1, "timestamp": 1, "userAgent": "{\"os_minor\": 
null, \"is_bot\": false, \"os_major\": null, \"device_family\": \"Other\", 
\"os_family\": \"Windows 8.1\", \"browser_minor\": \"0\", \"wmf_app_version\": 
\"-\", \"browser_major\": \"55\", \"browser_family\": \"Firefox\", 
\"is_mediawiki\": false}", "uuid": "example", "webHost": "example", "wiki": 
"example"}
+ expect: *expected_uncached_desktop_mwload
 
 Mobile page view:
  input: {"event": {"action": "edit", "connectEnd": 0, "connectStart": 0, 
"dnsLookup": 0, "domComplete": 3515, "domInteractive": 2936, "fetchStart": 0, 
"isAnon": true, "isHiDPI": false, "isHttp2": true, "loadEventEnd": 3520, 
"loadEventStart": 3515, "mediaWikiLoadComplete": 907, "mediaWikiVersion": 
"1.30.0-wmf.19", "mobileMode": "stable", "namespaceId": 1, "originCountry": 
"RU", "originRegion": "PER", "pageId": 1, "requestStart": 1, "responseEnd": 
2631, "responseStart": 2367, "revId": 1}, "recvFrom": "example", "revision": 1, 
"schema": "NavigationTiming", "seqId": 1, "timestamp": 1, "userAgent": 
"{\"os_minor\": \"3\", \"is_bot\": false, \"os_major\": \"9\", 
\"device_family\": \"iPad\", \"os_family\": \"iOS\", \"browser_minor\": \"0\", 
\"wmf_app_version\": \"-\", \"browser_major\": \"9\", \"browser_family\": 
\"Mobile Safari\", \"is_mediawiki\": false}", "uuid": "example", "webHost": 
"example", "wiki": "example"}
@@ -620,7 +613,8 @@
 
 Uncached page view from desktop that includes isOversample=false:
  input: {"event": {"action": "history", "connectEnd": 6, "connectStart": 6, 
"dnsLookup": 1, "domComplete": 1965, "domInteractive": 956, "fetchStart": 1, 
"isAnon": false, "isHiDPI": false, "isHttp2": true, "isOversample": false, 
"loadEventEnd": 1968, "loadEventStart": 1965, "mediaWikiLoadComplete": 1270, 
"mediaWikiVersion": "1.30.0-wmf.19", "namespaceId": 1, "originCountry": "RS", 
"originRegion": "VO", "pageId": 1, "requestStart": 6, "responseEnd": 415, 
"responseStart": 380, "revId": 1, "unload": 4}, "recvFrom": "example", 
"revision": 1, "schema": "NavigationTiming", "seqId": 1, "timestamp": 1, 
"userAgent": "{\"os_minor\": null, \"is_bot\": false, \"os_major\": null, 
\"device_family\": \"Other\", \"os_family\": \"Windows 8.1\", 
\"browser_minor\": \"0\", \"wmf_app_version\": \"-\", \"browser_major\": 
\"55\", \"browser_family\": \"Firefox\", \"is_mediawiki\": false}", "uuid": 
"example", "webHost": "example", "wiki": "example"}
- expect: *expected_uncached_desktop
+ expect:
+  - *expected_uncached_desktop
 
 Uncached page view from desktop that includes isOversample=true:
  input: {"event": {"action": "history", "connectEnd": 6, "connectStart": 6, 
"dnsLookup": 1, "domComplete": 1965, "domInteractive": 956, "fetchStart": 1, 
"isAnon": false, "isHiDPI": false, "isHttp2": true, "isOversample": true, 
"loadEventEnd": 1968, "loadEventStart": 1965, "mediaWikiLoadComplete": 1270, 
"mediaWikiVersion": "1.30.0-wmf.19", "namespaceId": 1, "originCountry": "RS", 
"originRegion": "VO", "pageId": 1, "requestStart": 6, "responseEnd": 415, 
"responseStart": 380, "revId": 1, "unload": 4}, "recvFrom": "example", 
"revision": 1, "schema": "NavigationTiming", "seqId": 1, "timestamp": 1, 
"userAgent": "{\"os_minor\": null, \"is_bot\": false, \"os_major\": null, 
\"device_family\": \"Other\", \"os_family\": \"Windows 8.1\", 
\"browser_minor\": \"0\", \"wmf_app_version\": \"-\", \"browser_major\": 
\"55\", \"browser_family\": \"Firefox\", \"is_mediawiki\": false}", "uuid": 
"example", "webHost": "example", "wiki": "example"}
diff --git a/modules/webperf/files/navtiming_test.py 
b/modules/webperf/files/navtiming_test.py
index 37086e2..7a719fa 100644
--- a/modules/webperf/files/navtiming_test.py
+++ b/modules/webperf/files/navtiming_test.py
@@ -18,6 +18,14 @@
     # addition to the value diff, not instead of the diff.
     longMessage = True
 
+    def flatten(self, values):
+        for value in values:
+            if isinstance(value, list):
+                for subvalue in self.flatten(value):
+                    yield subvalue
+            else:
+                yield value
+
     def test_parse_ua(self):
         data_path = os.path.join(os.path.dirname(__file__), 
'navtiming_ua_data.yaml')
         with open(data_path) as data_file:
@@ -36,6 +44,8 @@
         with open(fixture_path) as fixture_file:
             cases = yaml.safe_load(fixture_file)
             for key, case in cases.items():
+                if key == 'templates':
+                    continue
                 if isinstance(case['input'], list):
                     messages = case['input']
                 else:
@@ -52,7 +62,7 @@
                 # print "" # debug
                 self.assertItemsEqual(
                     actual,
-                    case['expect'],
+                    self.flatten(case['expect']),
                     key
                 )
 

-- 
To view, visit https://gerrit.wikimedia.org/r/404046
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib43ab6a2d21c3148a4ce8954cc81166ebc2c0237
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Krinkle <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to