From f1118093260fa9921d58e2193ab301724e3279c6 Mon Sep 17 00:00:00 2001 From: Travis Long Date: Tue, 3 Dec 2024 11:37:28 -0600 Subject: [PATCH] Add sync ping registration prior to resetGlean calls This is weird to do in other test classes calling resetGlean, but it's an unfortunate side effect of the new collection enabled mechanisms that'll be fixed up with https://bugzilla.mozilla.org/show_bug.cgi?id=1935001 --- .../MozillaTestServicesTests/NimbusTests.swift | 12 +++++++++++- .../SyncManagerTelemetryTests.swift | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/NimbusTests.swift b/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/NimbusTests.swift index 7afa000609..84b1cadbfa 100644 --- a/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/NimbusTests.swift +++ b/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/NimbusTests.swift @@ -10,8 +10,18 @@ import XCTest class NimbusTests: XCTestCase { override func setUp() { + // Due to recent changes in how upload enabled works, we need to register the custom + // Sync pings before they can collect data in tests, even here in Nimbus unfortunately. + // See https://bugzilla.mozilla.org/show_bug.cgi?id=1935001 for more info. + Glean.shared.registerPings(GleanMetrics.Pings.shared.sync) + Glean.shared.registerPings(GleanMetrics.Pings.shared.historySync) + Glean.shared.registerPings(GleanMetrics.Pings.shared.bookmarksSync) + Glean.shared.registerPings(GleanMetrics.Pings.shared.loginsSync) + Glean.shared.registerPings(GleanMetrics.Pings.shared.creditcardsSync) + Glean.shared.registerPings(GleanMetrics.Pings.shared.addressesSync) + Glean.shared.registerPings(GleanMetrics.Pings.shared.tabsSync) + Glean.shared.resetGlean(clearStores: true) - Glean.shared.enableTestingMode() } func emptyExperimentJSON() -> String { diff --git a/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/SyncManagerTelemetryTests.swift b/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/SyncManagerTelemetryTests.swift index e4fa4f1ac1..22fa466f6e 100644 --- a/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/SyncManagerTelemetryTests.swift +++ b/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/SyncManagerTelemetryTests.swift @@ -14,7 +14,8 @@ class SyncManagerTelemetryTests: XCTestCase { super.setUp() // Due to recent changes in how upload enabled works, we need to register the custom - // Sync pings before they can be submitted properly. + // Sync pings before they can collect data in tests. + // See https://bugzilla.mozilla.org/show_bug.cgi?id=1935001 for more info. Glean.shared.registerPings(GleanMetrics.Pings.shared.sync) Glean.shared.registerPings(GleanMetrics.Pings.shared.historySync) Glean.shared.registerPings(GleanMetrics.Pings.shared.bookmarksSync)