Bug 1620656 - Fix tests broken by removing 'geckoview' telemetry. r=janerik
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Tue, 16 Jun 2020 12:24:01 +0000
changeset 535848 dfab5bc68cde255a8025010d17041b505f3c2916
parent 535847 d009c756c86bb07bdfdad89772d9d810c71a9c98
child 535849 fb27ef9d01e058045a3c0016a12d8ae399779512
push id37512
push usernbeleuzu@mozilla.com
push dateTue, 16 Jun 2020 21:50:06 +0000
treeherdermozilla-central@f570748b1fda [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanerik
bugs1620656
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1620656 - Fix tests broken by removing 'geckoview' telemetry. r=janerik Differential Revision: https://phabricator.services.mozilla.com/D79792
toolkit/components/telemetry/geckoview/gtest/TestGeckoViewStreaming.cpp
toolkit/components/telemetry/tests/python/test_gen_event_data_json.py
toolkit/components/telemetry/tests/python/test_gen_scalar_data_json.py
toolkit/components/telemetry/tests/python/test_parse_events.py
toolkit/components/telemetry/tests/python/test_usecounters.py
--- a/toolkit/components/telemetry/geckoview/gtest/TestGeckoViewStreaming.cpp
+++ b/toolkit/components/telemetry/geckoview/gtest/TestGeckoViewStreaming.cpp
@@ -1,17 +1,19 @@
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
+#include "mozilla/Telemetry.h"
 #include "nsThreadUtils.h"
 #include "TelemetryFixture.h"
+#include "TelemetryTestHelpers.h"
 #include "streaming/GeckoViewStreamingTelemetry.h"
 
 using namespace mozilla;
 using namespace mozilla::Telemetry;
 using namespace TelemetryTestHelpers;
 using GeckoViewStreamingTelemetry::StreamingTelemetryDelegate;
 using mozilla::Telemetry::ScalarID;
 using ::testing::_;
--- a/toolkit/components/telemetry/tests/python/test_gen_event_data_json.py
+++ b/toolkit/components/telemetry/tests/python/test_gen_event_data_json.py
@@ -42,17 +42,17 @@ with.optin:
   testme2:
     objects: ["test2"]
     bug_numbers: [1456415]
     notification_emails: ["telemetry-client-dev@mozilla.org"]
     record_in_processes: ["main"]
     description: opt-in event
     release_channel_collection: opt-in
     expiry_version: never
-    products: ['firefox', 'fennec', 'geckoview']
+    products: ['firefox', 'fennec']
     extra_keys:
       message: a message 2
         """
 
         EXPECTED_JSON = {
             "with.optout": {
                 "testme1": {
                     "objects": ["test1"],
@@ -67,17 +67,17 @@ with.optin:
             "with.optin": {
                 "testme2": {
                     "objects": ["test2"],
                     "expired": False,
                     "expires": "never",
                     "methods": ["testme2"],
                     "extra_keys": ["message"],
                     "record_on_release": False,
-                    "products": ["firefox", "fennec", "geckoview"],
+                    "products": ["firefox", "fennec"],
                 }
             },
         }
 
         io = StringIO()
         try:
             tmpfile = tempfile.NamedTemporaryFile(suffix=".json", delete=False)
             # Write the event definition to the temporary file
--- a/toolkit/components/telemetry/tests/python/test_gen_scalar_data_json.py
+++ b/toolkit/components/telemetry/tests/python/test_gen_scalar_data_json.py
@@ -41,31 +41,31 @@ newscalar:
     bug_numbers:
       - 1456415
     description: opt-out scalar
     expires: never
     kind: string
     notification_emails: ["telemetry-client-dev@mozilla.org"]
     record_in_processes: ["main"]
     release_channel_collection: opt-out
-    products: ["firefox", "fennec", "geckoview"]
+    products: ["firefox", "fennec"]
     keyed: false
         """
 
         EXPECTED_JSON = {
             "newscalar": {
                 "withoptout": {
                     "kind": "nsITelemetry::SCALAR_TYPE_STRING",
                     "expired": False,
                     "expires": "never",
                     "record_on_release": True,
                     "keyed": False,
                     "keys": [],
                     "stores": ["main"],
-                    "products": ["firefox", "fennec", "geckoview"],
+                    "products": ["firefox", "fennec"],
                 },
                 "withoptin": {
                     "kind": "nsITelemetry::SCALAR_TYPE_COUNT",
                     "expired": False,
                     "expires": "never",
                     "record_on_release": False,
                     "keyed": False,
                     "keys": [],
--- a/toolkit/components/telemetry/tests/python/test_parse_events.py
+++ b/toolkit/components/telemetry/tests/python/test_parse_events.py
@@ -89,32 +89,32 @@ bug_numbers: [12345]
 notification_emails: ["test01@mozilla.com", "test02@mozilla.com"]
 record_in_processes: ["content"]
 description: This is a test entry for Telemetry.
 expiry_version: never
 extra_keys:
   key1: test1
   key2: test2
 products:
-    - geckoview
+    - fennec
 operating_systems:
     - windows
 """
         name = "test_event"
         event = load_event(SAMPLE_EVENT)
         evt = parse_events.EventData("CATEGORY",
                                      name,
                                      event,
                                      strict_type_checks=True)
         ParserError.exit_func()
 
         self.assertEqual(evt.methods, ["method1", "method2"])
         self.assertEqual(evt.objects, ["object1", "object2"])
         self.assertEqual(evt.record_in_processes, ["content"])
-        self.assertEqual(evt.products, ["geckoview"])
+        self.assertEqual(evt.products, ["fennec"])
         self.assertEqual(evt.operating_systems, ["windows"])
         self.assertEqual(sorted(evt.extra_keys), ["key1", "key2"])
 
     def test_absent_products(self):
         SAMPLE_EVENT = """
 methods: ["method1", "method2"]
 objects: ["object1", "object2"]
 bug_numbers: [12345]
--- a/toolkit/components/telemetry/tests/python/test_usecounters.py
+++ b/toolkit/components/telemetry/tests/python/test_usecounters.py
@@ -30,17 +30,17 @@ class TestParser(unittest.TestCase):
         parse_histograms.load_allowlist()
 
         hist = parse_histograms.Histogram('USE_COUNTER2_TEST_HISTOGRAM',
                                           histograms['USE_COUNTER2_TEST_HISTOGRAM'],
                                           strict_type_checks=True)
 
         ParserError.exit_func()
         self.assertEquals(hist.dataset(), "nsITelemetry::DATASET_ALL_CHANNELS")
-        self.assertEquals(hist.products(), ["firefox", "fennec", "geckoview"])
+        self.assertEquals(hist.products(), ["firefox", "fennec"])
 
     def test_usecounter_histogram(self):
         SAMPLE_HISTOGRAM = {
             "USE_COUNTER2_TEST_HISTOGRAM": {
                 "expires_in_version": "never",
                 "kind": "boolean",
                 "description": "Whether a foo used bar"
             }
@@ -51,13 +51,13 @@ class TestParser(unittest.TestCase):
         hist = parse_histograms.Histogram('USE_COUNTER2_TEST_HISTOGRAM',
                                           histograms['USE_COUNTER2_TEST_HISTOGRAM'],
                                           strict_type_checks=True)
 
         ParserError.exit_func()
         self.assertEquals(hist.expiration(), "never")
         self.assertEquals(hist.kind(), "boolean")
         self.assertEquals(hist.description(), "Whether a foo used bar")
-        self.assertEquals(hist.products(), ["firefox", "fennec", "geckoview"])
+        self.assertEquals(hist.products(), ["firefox", "fennec"])
 
 
 if __name__ == '__main__':
     mozunit.main()