QA/Mobile/TelemetryTestPlan: Difference between revisions
Rpappalardo (talk | contribs) m (glean docs) |
Rpappalardo (talk | contribs) (ping scenarios) |
||
| Line 56: | Line 56: | ||
* see discussion: [https://groups.google.com/a/mozilla.com/forum/?utm_medium=email&utm_source=footer#!msg/android-product-team/7XpVCA2Be80/tpWsuaXoEwAJ discussion] | * see discussion: [https://groups.google.com/a/mozilla.com/forum/?utm_medium=email&utm_source=footer#!msg/android-product-team/7XpVCA2Be80/tpWsuaXoEwAJ discussion] | ||
== Ping | == Ping Testing == | ||
=== Summary === | |||
A "ping" refers to a JSON blog of data sent from the client to the telemetry service. There are three basic types: baseline, events and metrics pings. In addition, custom pings (i.e. activities, sync pings) can be defined using the pings.yaml and metrics.yaml files. | |||
== Ping Activities == | |||
=== Summary === | |||
To test ping integrity from end-to-end, we'll be doing 3 things: | |||
# Trigger Data Collection | |||
#* Ping data is generated on the client when certain actions are performed. Our test coverage will ensure we generate data for each of the ping scenarios. | |||
#* Generated data will first be verified locally via logcat | |||
# Trigger Data Submission | |||
#* Using Glean CLI tool, we will force data to be sent immediately, rather than waiting for a scheduled trigger event(s) or for thresholds to be met | |||
# Verify Submitted Data | |||
== Ping Scenarios == | |||
=== [https://github.com/mozilla-mobile/android-components/blob/master/components/service/glean/docs/pings/baseline.md Baseline ping] === | === [https://github.com/mozilla-mobile/android-components/blob/master/components/service/glean/docs/pings/baseline.md Baseline ping] === | ||
* ''trigger(s) / scheduling:'' | * ''trigger(s) / scheduling:'' | ||
Revision as of 22:23, 8 May 2019
Summary
Product Coverage
This is the test plan for verification of telemetry service clients for the following Mozilla Android products:
Fenix
Frequency:
- thorough first pass and on releases, spot check w/ sprints (to be verified w/ kbrosnan)
Issues:
Reference Browser
Frequency:
- upon request from dev, management
android-components - sample apps
Frequency:
- upon request from dev, management
Firefox for FireTV
Frequency:
- TBD - pending Glean implementation
Test Demo
This test demo video demonstrates how to verify that:
- Telemetry is being sent from client to the server
- Telemetry arrives at the server without excessive latency (can be viewed from the Glean Debug Dashboard)
- Telemetry is complete and data integrity maintained
NOTES:
- For ease of demonstration, an X86 device was used, but all testing should be done using physical devices.
- Test steps in video are outlined in wiki below
Test Strategy
Test Types
The Mobile QA team will perform two test types of telemetry verification for all our mobile projects:
End-2-end (client-to-server) tests
Type:
- manual
Frequency:
- upon request from devs, management
Who:
- SoftVision engineers
Tools:
- Glean CLI, Glean Debug Dashboard
Client-side only verification tests (TBD)
Type:
- automated
Frequency:
- github trigger on merge-to-master
Who:
- No-Jun's team
Tools:
- see discussion: discussion
Ping Testing
Summary
A "ping" refers to a JSON blog of data sent from the client to the telemetry service. There are three basic types: baseline, events and metrics pings. In addition, custom pings (i.e. activities, sync pings) can be defined using the pings.yaml and metrics.yaml files.
Ping Activities
Summary
To test ping integrity from end-to-end, we'll be doing 3 things:
- Trigger Data Collection
- Ping data is generated on the client when certain actions are performed. Our test coverage will ensure we generate data for each of the ping scenarios.
- Generated data will first be verified locally via logcat
- Trigger Data Submission
- Using Glean CLI tool, we will force data to be sent immediately, rather than waiting for a scheduled trigger event(s) or for thresholds to be met
- Verify Submitted Data
Ping Scenarios
Baseline ping
- trigger(s) / scheduling:
- sent when application is moved to background
- contents: includes the following fields....
- duration, locale
- common ping sections found in all pings
Events ping
- trigger(s) / scheduling:
- sent when application goes into background (if any recorded events to send)
- when queue of events exceeds Glean.configuration.maxEvents (default 500)
- if any unsent events found on disk when starting application
- contents:
- array of all of the events that have occurred since the last time the events ping was sent
- common ping sections found in all pings
Metrics ping
- trigger(s) / scheduling:
- sent at first available opportunity after 4AM local time on a new calendar day
- contents:
- common ping sections found in all pings
Manual Tests
End-2-end client-to-server tests
SUMMARY
Description
This will be a "client-to-server (end-2-end) verification" test using the production telemetry service across the real network (not a mock service on localhost). Execution requires manually triggering a telemetry ping to be sent to the telemetry service by emulating a specific set of user activities in the application.
Pings can be successfully verified by ensuring they have arrived in the telemetry server - viewable in the Glean Debug Dashboard.
- Authentication requires SSO login
- see: Debugging products using Glean
- Features
- Glean Debug Dashboard makes data received by the pipeline from some devices visible in real-time
- Enabling debug mode either returns a unique identifier, or the ID you want to use (see tagPings parameter below), enabling immediate query of test pings
TEST EXECUTION
Download Application
- Download the Fenix (or other) release apk file
- choose: public/target.x86.apk or public/target.aarch64.apk
NOTE:
- Debug builds won't work, but test build can otherwise be custom build or from PlayStore (no special build needed)
Install Application
- Connect an Android (physical) device via USB
- Open terminal
- Verify device is connected:
$ adb devices - Install the apk:
$ adb install ~/Downloads/target.aarch64.apk - Verify app has been installed on device
- NOTE: Do not open the application, Glean will do this for us
Check Network
- ping Glean Debug Dashboard: [1]
Send Telemetry Pings
Next, we will do three things (see "Examples" below):
- Tag our telemetry pings with a custom identifier
- Trigger ping generation on client
- Force immediate send of ping to telemetry server (i.e. we won't wait for scheduled send)
Verify Ping Success
- Open Glean Debug Dashboard: [2]
- Verify real-time receipt of tagged ping in dashboard
- Verify ping entry contains correct field data
- Drill down into ping
- Verify that "Recent pings..." entry contains correct ping types
- Drill down to JSON data
- Verify JSON data per glean pings doc
EXAMPLES
For running the commands with any Firefox Android app, adjust the application ID part in the command:
Fenix
adb shell -n org.mozilla.fenix.debug/mozilla.components.service.glean.debug.GleanDebugActivity --ez logPings true --es sendPing metrics --es tagPings rpapa-test1
Android Components (sample apps)
adb shell -n org.mozilla.samples.glean/mozilla.components.service.glean.debug.GleanDebugActivity --ez logPings true --es sendPing metrics --es tagPings rpapa-test1
Reference Browser
adb shell -n org.mozilla.reference.browser.debug/mozilla.components.service.glean.debug.GleanDebugActivity --ez logPings true --es sendPing metrics --es tagPings rpapa-test1- NOTE
- even with telemetry enabled, reference-browser doesn't define any metric outside of the ones we provide out of the box, which are sent in the baseline ping.
- suggestion: run commands against a version of reference-browser that has telemetry enabled (e.g. the one from the play store), and send a ping for which we're sure to have data:
PARAMETERS
logPings
- To dump Glean logs to logcat
adb shell -n ...GleanDebugActivity --ez logPings true
sendPing
- To force sending a ping right away use:
adb shell -n ...GleanDebugActivity --es sendPing metrics- (or instead of metrics other ping names)
- Look at Glean frontend to verify data is landing
tagPings
- To tag a ping with a user label for easy query in Glean dashboard
adb shell -n ...GleanDebugActivity --es tagPings rpapa-test1, then spotrpapa-test1in the frontend to identify your pings.
NOTES
Automated Tests (TBD)
Client-side only verification test
SUMMARY
This will be a "client-side only verification" test which will rely on a local HTTP client (probably the A-C fetch component) as a kind of simple mock telemetry server, which we will use to capture, read and verify the outbound JSON payload (jailed on localhost).
- priority #1: verify that our telemetry object has been called as expected using assertion functions
- priority #2: unpack and verify integrity of payload contents
- frequency: Test execution frequency will be determined by the CI (Taskcluster or Bitrise) config file
SCHEDULE Targeting for 2019, H2
Reference
Automated Tests (Firefox Desktop)
DESCRIPTION
- Automated tests for Firefox desktop do "client verification only test" also rely on a local HTTP client as a kind of simple mock telemetry server, used to capture, read and verify the outbound JSON payload locally
- Events are triggered, data integrity is verified
- see source: mozilla-central