Closed Bug 1980131 Opened 5 months ago Closed 5 months ago

Glean documentation ( instrumentation_tests.html ) should prioritize browser tests over plain mochitests and be clearer about required patterns

Categories

(Toolkit :: Telemetry, task, P1)

task

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox144 --- fixed

People

(Reporter: Gijs, Assigned: chutten)

References

Details

Attachments

(1 file, 1 obsolete file)

No description provided.

Where in the docs do we do that?

Attachment #9503980 - Attachment is obsolete: true

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: gijskruitbosch+bugs → nobody
OS: Unspecified → All
Hardware: Unspecified → All
See Also: → 1756055
Summary: Glean documentation shouldn't suggest to await testGetValue → Glean documentation ( instrumentation_tests.html ) should prioritize browser tests over plain mochitests and be clearer about required patterns
Assignee: nobody → chutten
Severity: -- → N/A
Status: NEW → ASSIGNED
Priority: -- → P1
Pushed by chutten@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5d8abb6ccc01 https://hg.mozilla.org/integration/autoland/rev/bcbcebf329e6 Be more obvious about the difference between instrumentation tests in browser-chome vs plain mochitests r=Gijs DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
QA Whiteboard: [qa-triage-done-c145/b144]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: