Closed Bug 1450994 Opened 6 years ago Closed 6 years ago

Check ping reason against expected value in `test_TelemetrySession#checkPayload`

Categories

(Toolkit :: Telemetry, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: janerik, Assigned: janerik)

Details

Attachments

(1 file)

The `checkPayload` method in toolkit/components/telemetry/tests/unit/test_TelemetrySession.js[1] receives an argument `reason` which is never checked against the payload.
We should eventually fix this. Currently it seems all tests pass the correct reason and no test failure should be expected.

[1]: https://searchfox.org/mozilla-central/rev/f5fb323246bf22a3a3b4185882a1c5d8a2c02996/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js#324
Do you think this would make a good mentored bug?
Flags: needinfo?(jrediger)
Flags: needinfo?(jrediger)
Summary: test_TelemetrySession#checkPayload → `checkPayload` in the TelemetrySession test should check the payload's reason against the expected value
Summary: `checkPayload` in the TelemetrySession test should check the payload's reason against the expected value → Check ping reason against expected value in `test_TelemetrySession#checkPayload`
This will now check for both inclusion in `ALLOWED_REASONS` and also the reason asked for by the calling test.
That's a bit repeated, but I couldn't really find why `ALLOWED_REASONS` was added instead of specifying the exact expected reason.
Attachment #8967079 - Flags: review?(chutten)
Comment on attachment 8967079 [details] [diff] [review]
Check for expected reason in payload. r?chutten

Review of attachment 8967079 [details] [diff] [review]:
-----------------------------------------------------------------

Seems like it ought to work. Any test failures?
Attachment #8967079 - Flags: review?(chutten) → review+
No, no test failures. Luckily our tests expected all the right reasons and the pings also contained them correctly.
Assignee: nobody → jrediger
Priority: -- → P1
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/95f15c1c2af3
Check for expected reason in payload. r=chutten
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/95f15c1c2af3
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: