From 234660f478b88fe34b6a5ee2e3faf2b6b8d8f15d Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Tue, 10 Dec 2024 18:13:20 -0500 Subject: [PATCH] Revert Glean v63.0.0 update --- CHANGELOG.md | 5 --- components/external/glean | 2 +- .../syncmanager/SyncTelemetryTest.kt | 35 +++---------------- gradle/libs.versions.toml | 2 +- .../project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 5 ++- .../NimbusTests.swift | 12 +------ .../SyncManagerTelemetryTests.swift | 14 +------- 8 files changed, 12 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 348839fc1d..33c4ff5a69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,6 @@ [Full Changelog](In progress) -## 🦊 What's Changed 🦊 - -### Glean -- Updated to v63.0.0 ([bug 1933939](https://bugzilla.mozilla.org/show_bug.cgi?id=1933939)) - # v134.0 (_2023-11-25_) ## ✨ What's New ✨ diff --git a/components/external/glean b/components/external/glean index 2fe73c4d28..505c497f9e 160000 --- a/components/external/glean +++ b/components/external/glean @@ -1 +1 @@ -Subproject commit 2fe73c4d2876f5e1c073fb4ac4c010a36ad5c825 +Subproject commit 505c497f9ecfc0ab32c19b62f14c73c378c2d826 diff --git a/components/sync_manager/android/src/test/java/mozilla/appservices/syncmanager/SyncTelemetryTest.kt b/components/sync_manager/android/src/test/java/mozilla/appservices/syncmanager/SyncTelemetryTest.kt index 48a32e63ad..34041a12af 100644 --- a/components/sync_manager/android/src/test/java/mozilla/appservices/syncmanager/SyncTelemetryTest.kt +++ b/components/sync_manager/android/src/test/java/mozilla/appservices/syncmanager/SyncTelemetryTest.kt @@ -6,7 +6,6 @@ package mozilla.appservices.syncmanager import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.work.testing.WorkManagerTestInitHelper import mozilla.appservices.sync15.EngineInfo import mozilla.appservices.sync15.FailureName import mozilla.appservices.sync15.FailureReason @@ -16,9 +15,7 @@ import mozilla.appservices.sync15.ProblemInfo import mozilla.appservices.sync15.SyncInfo import mozilla.appservices.sync15.SyncTelemetryPing import mozilla.appservices.sync15.ValidationInfo -import mozilla.telemetry.glean.Glean -import mozilla.telemetry.glean.config.Configuration -import org.junit.After +import mozilla.telemetry.glean.testing.GleanTestRule import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertNotNull @@ -26,6 +23,7 @@ import org.junit.Assert.assertNull import org.junit.Assert.assertTrue import org.junit.Assert.fail import org.junit.Before +import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.mozilla.appservices.syncmanager.GleanMetrics.Pings @@ -42,6 +40,9 @@ private fun Date.asSeconds() = time / BaseGleanSyncPing.MILLIS_PER_SEC @RunWith(AndroidJUnit4::class) @Suppress("LargeClass") class SyncTelemetryTest { + @get:Rule + val gleanRule = GleanTestRule(ApplicationProvider.getApplicationContext()) + private var now: Long = 0 private var pingCount = 0 @@ -49,32 +50,6 @@ class SyncTelemetryTest { fun setup() { now = Date().asSeconds() pingCount = 0 - - // Due to recent changes in how upload enabled works, we need to register the custom - // Sync pings before resetting Glean manually so they can be submitted properly. This - // replaces the use of the GleanTestRule until it can be updated to better support testing - // custom pings in libraries. - Glean.registerPings(Pings.sync) - Glean.registerPings(Pings.historySync) - Glean.registerPings(Pings.bookmarksSync) - Glean.registerPings(Pings.loginsSync) - Glean.registerPings(Pings.creditcardsSync) - Glean.registerPings(Pings.addressesSync) - Glean.registerPings(Pings.tabsSync) - - // Glean will crash in tests without this line when not using the GleanTestRule. - WorkManagerTestInitHelper.initializeTestWorkManager(ApplicationProvider.getApplicationContext()) - Glean.resetGlean( - context = ApplicationProvider.getApplicationContext(), - config = Configuration(), - clearStores = true, - ) - } - - @After - fun tearDown() { - // This closes the WorkManager database to help prevent leaking it during tests. - WorkManagerTestInitHelper.closeWorkDatabase() } @Test diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 55209fe6ab..384a08011e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -17,7 +17,7 @@ kotlinx-coroutines = "1.8.0" # Mozilla android-components = "133.0" -glean = "63.0.0" +glean = "62.0.0" rust-android-gradle = "0.9.4" # AndroidX diff --git a/megazords/ios-rust/MozillaTestServices/MozillaTestServices.xcodeproj/project.pbxproj b/megazords/ios-rust/MozillaTestServices/MozillaTestServices.xcodeproj/project.pbxproj index 0b0ca8bd05..dd703173be 100644 --- a/megazords/ios-rust/MozillaTestServices/MozillaTestServices.xcodeproj/project.pbxproj +++ b/megazords/ios-rust/MozillaTestServices/MozillaTestServices.xcodeproj/project.pbxproj @@ -980,7 +980,7 @@ repositoryURL = "https://github.com/mozilla/glean-swift"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 63.0.0; + minimumVersion = 62.0.0; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/megazords/ios-rust/MozillaTestServices/MozillaTestServices.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/megazords/ios-rust/MozillaTestServices/MozillaTestServices.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d477d1e9f9..d0d681493e 100644 --- a/megazords/ios-rust/MozillaTestServices/MozillaTestServices.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/megazords/ios-rust/MozillaTestServices/MozillaTestServices.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,13 +1,12 @@ { - "originHash" : "94dc6b186acfc4720adc0bbb95f712b86bc82988e2b0c0a85e65eb1ae9a4af4c", "pins" : [ { "identity" : "glean-swift", "kind" : "remoteSourceControl", "location" : "https://github.com/mozilla/glean-swift", "state" : { - "revision" : "be4fbca81f9e1da5f9b91e8bd245a8dee53cc57f", - "version" : "63.0.0" + "revision" : "5c614b4af5a1f1ffe23b46bd03696086d8ce9d0d", + "version" : "62.0.0" } } ], diff --git a/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/NimbusTests.swift b/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/NimbusTests.swift index 84b1cadbfa..7afa000609 100644 --- a/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/NimbusTests.swift +++ b/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/NimbusTests.swift @@ -10,18 +10,8 @@ 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 22fa466f6e..fa7372874e 100644 --- a/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/SyncManagerTelemetryTests.swift +++ b/megazords/ios-rust/MozillaTestServices/MozillaTestServicesTests/SyncManagerTelemetryTests.swift @@ -12,20 +12,8 @@ class SyncManagerTelemetryTests: XCTestCase { override func setUp() { super.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. - // 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() now = Int64(Date().timeIntervalSince1970) / BaseGleanSyncPing.MILLIS_PER_SEC }