Closed Bug 1880541 Opened 2 years ago Closed 2 years ago

Tweak test_system_update_enterprisepolicy.js to be less confusing when if fails because of non-test enterprise policies have been loaded instead

Categories

(Toolkit :: Add-ons Manager, task, P3)

task

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: rpl, Assigned: rpl)

Details

Attachments

(1 file)

Not a bug per se, but the test case test_system_update_enterprisepolicy.js will fail if executed on a developer machine where an enterprise policy json file is found at system level, which end up silently be used instead of the enterprise policies data set by the test case itself, and then hitting an assertion failure about unexpected system addons directories found, which in practice under this corner case doesn't help to understand that the failure is hit not because of a bug or regression but because of enterprise policy already existing in the same system.

I got to hit this corner case because I was testing out something around enterprise policies and forgot to remove that test enterprise policy from my system, and after a few days I was getting failures on this test and didn't make the connection between the failure and the enterprise policy I was testing out a few days earlier until I actually investigated the failure deeply enough to determine what was going on.

Asserting explicitly that the enterprise policy returned by Services.policies.getActivePolicies should be matching the test policy set by the test itself would have been useful, maybe also mentioning in the assertion message to double-check enterprise policies installed at system level in case of failures may also be a reasonable way to help a developer hitting the failure to more quickly pinpoint what is triggering it.

Assignee: nobody → lgreco
Status: NEW → ASSIGNED
Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/376210fa8624 Add to test_system_update_enterprisepolicy.js an explicit assertion on the active policies data. r=willdurand
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: