Closed Bug 1495855 Opened Last year Closed 11 months ago

Rework the about:debugging webextensions tests to do not use symlink-ed test addons

Categories

(DevTools :: about:debugging, enhancement, P2)

enhancement

Tracking

(firefox64 fixed)

RESOLVED FIXED
Firefox 64
Tracking Status
firefox64 --- fixed

People

(Reporter: rpl, Assigned: rpl)

Details

Attachments

(1 file)

The about:debugging tests related to the webextensions debugging are currently failing to run locally on Linux.

The underlying issues seems to be related to the fact that the test extension is symlinked into `OBJDIR/_tests/testing/mochitest/browser/devtools/client/aboutdebugging/test/addons/` and when the extension is running in oop mode it fails to load any script that is a symlink to a file that is not in the test extension root dir or one of its subdirectory.

The same tests are running fine locally on windows, where the test extension are not symlink-ed by our build system, and also run successfully on try (where it is likely that the test extensions are being packaged differently).

This issue goal is to rework these tests so that they can run locally on Linux (e.g. by using ExtensionTestCommon.generateXPI to generate an extension xpi from a test extension defined right inside the test, similarly to the test extension we use in most of the WebExtensions tests).
Assignee: nobody → lgreco
Status: NEW → ASSIGNED
Priority: -- → P2
Pushed by luca.greco@alcacoop.it:
https://hg.mozilla.org/integration/autoland/rev/b062b1682bbd
Rework the about:debugging webextensions tests to do not use symlink-ed test addons. r=ochameau
Backed out for failures on browser_addons_debug_info.js

backout: https://hg.mozilla.org/integration/autoland/rev/39b4f60d3b07d074468898f71beccf4159f12e27

push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=b062b1682bbd328a0327edf51f9040dcd9e1680a&group_state=expanded

failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=206142542&repo=autoland&lineNumber=1665

16:09:25     INFO - TEST-UNEXPECTED-FAIL | devtools/client/aboutdebugging/test/browser_addons_debug_info.js | file path is set correctly - 
16:09:25     INFO - Stack trace:
16:09:25     INFO - chrome://mochitests/content/browser/devtools/client/aboutdebugging/test/browser_addons_debug_info.js:testFilePath:12
16:09:25     INFO - chrome://mochitests/content/browser/devtools/client/aboutdebugging/test/browser_addons_debug_info.js:testWebExtension:62
16:09:25     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1093
16:09:25     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1084
16:09:25     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:986
16:09:25     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:795
Flags: needinfo?(lgreco)
The failure on windows is related to the fact that the aboutdebugging page is converting a file URL to a path and the resulting path looks like "C:/Users/a_username/AppData/Local/Temp/generated-extension.xpi", and then we were comparing it with an expected path retrieved from the nsIFile's path property, which looks like "C:\\Users\\a_username\\AppData\\Local\\Temp\\generated-extension.xpi".

I'm re-opening the phabricator revision and applying the following fix:

use the nsIFile leafName property to retrieve the expected extension xpi filename, so that it doesn't include the full path and so the following assertion from testFilePath:

```
ok(filePath.textContent.endsWith(expectedFilePath), "file path is set correctly");
```

will behave the same (and pass) on all the supported platform, included windows.
Flags: needinfo?(lgreco)
Pushed by luca.greco@alcacoop.it:
https://hg.mozilla.org/integration/autoland/rev/545ff4f7bc5c
Rework the about:debugging webextensions tests to do not use symlink-ed test addons. r=ochameau
https://hg.mozilla.org/mozilla-central/rev/545ff4f7bc5c
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
You need to log in before you can comment on or make changes to this bug.