Closed Bug 1929968 Opened 1 year ago Closed 1 year ago

Ensure the search unit tests use add_setup correctly

Categories

(Firefox :: Search, task, P3)

task

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: scunnane, Assigned: scunnane)

References

Details

(Whiteboard: [sng])

Attachments

(1 file)

At least one of the tests in browser/components/search/test/unit puts test setup code inside an add_task call, rather than an add_setup call.
There are at least 2 reasons this isn't a good idea:

  1. add_setup is more explicit and semantically correct
  2. When adding an .only() call to a task to run that task in isolation, the setup code will not be run at all if it's inside an add_task call, whereas it would be run if it were inside an add_setup call.

We need to fix test_urlTelemetry.js and check the other unit tests for the same issue.

Whiteboard: [sng]
Assignee: nobody → scunnane
Status: NEW → ASSIGNED
Summary: Ensure the unit tests within browser/components/search use add_setup correctly → Ensure the search unit tests use add_setup correctly
Attachment #9441459 - Attachment description: Bug 1929968 - Ensure the unit tests within browser/components/search use add_setup correctly. r?#search-reviewers! → Bug 1929968 - Ensure the search unit tests use add_setup correctly. r?#search-reviewers!
Pushed by scunnane@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1c85c2eba66d Ensure the search unit tests use add_setup correctly. r=search-reviewers,jteow
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: