Glean documentation ( instrumentation_tests.html ) should prioritize browser tests over plain mochitests and be clearer about required patterns
Categories
(Toolkit :: Telemetry, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox144 | --- | fixed |
People
(Reporter: Gijs, Assigned: chutten)
References
Details
Attachments
(1 file, 1 obsolete file)
Comment 1•5 months ago
|
||
Where in the docs do we do that?
| Reporter | ||
Comment 2•5 months ago
|
||
Updated•5 months ago
|
| Reporter | ||
Comment 3•5 months ago
|
||
There was a sizeable amount of confusion on my part. Primarily I was confused by the docs having await Glean...testGetValue, but it turns out you need that in plain mochitests? But not anywhere else? At a technical level I understand why, but it's pretty confusing. I think the styling for the "hint" boxes in fx-source-docs makes them less obvious rather than more obvious, but perhaps that's just me.
Anyway, that means the original bug I filed was invalid... but rather than do that I will instead morph it to be about the larger problem here.
On the whole I think this doc would be better if it was structured differently. There are way more browser mochitests using Glean APIs than plain mochitests, and the examples in the doc should reflect that. Also, the gotcha for the xpcshell tests (you need to call init manually) is annoying, and not very well-highlighted in the doc. This ended up meaning (while working on https://phabricator.services.mozilla.com/D259237 ) that fixing the code-under-test to do the telemetry correctly took maybe 10 minutes, and writing the automated test took closer to an hour - and I ended up just looking for some other event metric being instrumented and looking at what the test for that was doing. It wasn't helped by the fact that TelemetryTestUtils does not have event helpers for glean.
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 4•5 months ago
|
||
Comment 6•5 months ago
|
||
| bugherder | ||
Updated•4 months ago
|
Description
•