-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-v61.2.0' into release
- Loading branch information
Showing
20 changed files
with
232 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
libraryVersion: 61.1.0 | ||
libraryVersion: 61.2.0 | ||
groupId: org.mozilla.telemetry | ||
projects: | ||
glean: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 33 additions & 16 deletions
49
docs/user/user/howto/real-time-events/real-time-events.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "glean-core" | ||
version = "61.1.0" | ||
version = "61.2.0" | ||
authors = ["Jan-Erik Rediger <[email protected]>", "The Glean Team <[email protected]>"] | ||
description = "A modern Telemetry library" | ||
repository = "https://github.com/mozilla/glean" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
glean-core/android/src/test/java/mozilla/telemetry/glean/pings/RidealongPingTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
package mozilla.telemetry.glean.scheduler | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import mozilla.telemetry.glean.Glean | ||
import mozilla.telemetry.glean.delayMetricsPing | ||
import mozilla.telemetry.glean.getContext | ||
import mozilla.telemetry.glean.getMockWebServer | ||
import mozilla.telemetry.glean.private.NoReasonCodes | ||
import mozilla.telemetry.glean.private.PingType | ||
import mozilla.telemetry.glean.resetGlean | ||
import mozilla.telemetry.glean.testing.GleanTestRule | ||
import mozilla.telemetry.glean.triggerWorkManager | ||
import okhttp3.mockwebserver.MockWebServer | ||
import org.junit.After | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import java.util.concurrent.TimeUnit | ||
|
||
/** | ||
* Testing behavior of custom pings. | ||
* | ||
* We already rely on the Rust side to test custom pings, | ||
* but this enables us to test the upload mechanism specifically. | ||
* | ||
* Even if this seemingly duplicates some of the testing, this should be kept around. | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class RidealongPingTest { | ||
private val context = getContext() | ||
private lateinit var server: MockWebServer | ||
|
||
@get:Rule | ||
val gleanRule = GleanTestRule(context) | ||
|
||
@Before | ||
fun setup() { | ||
server = getMockWebServer() | ||
} | ||
|
||
@After | ||
fun teardown() { | ||
server.shutdown() | ||
} | ||
|
||
@Test | ||
fun `sends a ride-along custom ping on baseline schedule`() { | ||
delayMetricsPing(context) | ||
resetGlean( | ||
context, | ||
Glean.configuration.copy( | ||
serverEndpoint = "http://" + server.hostName + ":" + server.port, | ||
pingSchedule = mapOf("baseline" to listOf("custom-ping")), | ||
), | ||
clearStores = true, | ||
uploadEnabled = true, | ||
) | ||
|
||
// Define a new custom ping inline. | ||
PingType<NoReasonCodes>( | ||
name = "custom-ping", | ||
includeClientId = true, | ||
sendIfEmpty = true, | ||
preciseTimestamps = true, | ||
includeInfoSections = true, | ||
enabled = true, | ||
schedulesPings = emptyList(), | ||
reasonCodes = emptyList(), | ||
) | ||
|
||
Glean.handleBackgroundEvent() | ||
// Trigger it to upload | ||
triggerWorkManager(context) | ||
|
||
var request = server.takeRequest(2L, TimeUnit.SECONDS)!! | ||
var docType = request.path!!.split("/")[3] | ||
assertEquals("baseline", docType) | ||
|
||
request = server.takeRequest(2L, TimeUnit.SECONDS)!! | ||
docType = request.path!!.split("/")[3] | ||
assertEquals("custom-ping", docType) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.