Closed Bug 1559692 Opened 1 year ago Closed 1 year ago

Filter by regexp in TelemetryTestUtils.assertEvents does not work

Categories

(Toolkit :: Telemetry, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

TelemetryTestUtils.assertEvents uses } else if (expected instanceof RegExp) { to detect if a given filter is a RegExp.

The RegExp object in TelemetryTestUtils.jsm is not necessary the same as the RegExp constructor in a test, because e.g. mochitests run in a window, which differs from a JSM's global. Consequently the instanceof RegExp check is always false, and events are not filtered as expected (i.e. they are not filtered, as if the filter was not set).

and migrate an existing test to use TelemetryTestUtils.assertEvents,
with a regular expression as filter.

Adding blocker on bug 1518756 since I've converted one test.

Blocks: 1518756
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/d5123ea91eb8
Fix support for regexp filter in TelemetryTestUtils.assertEvents r=chutten
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.