Bug 1433335 - Skip addon manager telemetry events test if expired in the current version. draft
authorLuca Greco <lgreco@mozilla.com>
Thu, 05 Jul 2018 17:44:55 +0200
changeset 815627 a5103be40f0022cd66abea8b0636cb07c0399489
parent 815626 203c3b3de60dd0ccdd5ff353304606d01b6290da
push id115585
push userluca.greco@alcacoop.it
push dateMon, 09 Jul 2018 16:00:32 +0000
bugs1433335
milestone62.0a1
Bug 1433335 - Skip addon manager telemetry events test if expired in the current version. MozReview-Commit-ID: CvgebrVBCxf
toolkit/mozapps/extensions/test/xpcshell/test_addon_manager_telemetry_events.js
--- a/toolkit/mozapps/extensions/test/xpcshell/test_addon_manager_telemetry_events.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_addon_manager_telemetry_events.js
@@ -6,16 +6,20 @@ ChromeUtils.import("resource://gre/modul
 
 const EVENT_CATEGORY = "addonsManager";
 const EVENT_METHODS_INSTALL = ["install", "update"];
 const EVENT_METHODS_MANAGE = [
   "disable", "enable", "pending_uninstall", "undo_uninstall", "uninstall",
 ];
 const EVENT_METHODS = [...EVENT_METHODS_INSTALL, ...EVENT_METHODS_MANAGE];
 
+const currentVersion = Services.appinfo.platformVersion;
+const expiringVersion = "64.0";
+const EVENTS_EXPIRED = Services.vc.compare(currentVersion, expiringVersion) === -1;
+
 let profileDir;
 
 function getTelemetryEvents() {
   const snapshot = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true);
 
   ok(snapshot.parent && snapshot.parent.length > 0, "Got parent telemetry events in the snapshot");
 
   return snapshot.parent.filter(([timestamp, category, method]) => {
@@ -39,17 +43,19 @@ add_task(async function setup() {
   // Telemetry test setup needed to ensure that the builtin events are defined
   // and they can be collected and verified.
   await TelemetryController.testSetup();
 
   await promiseStartupManager();
 });
 
 // Test the basic install and management flows.
-add_task(async function test_basic_telemetry_events() {
+add_task({
+  skip_if: () => EVENTS_EXPIRED,
+}, async function test_basic_telemetry_events() {
   const EXTENSION_ID = "basic@test.extension";
   const manifest = {
     applications: {gecko: {id: EXTENSION_ID}},
   };
 
   let extension = ExtensionTestUtils.loadExtension({
     manifest,
     useAddonManager: "permanent",