Closed Bug 602365 Opened 14 years ago Closed 14 years ago

Update shared modules use CommonJS

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

(Whiteboard: [needs-mozmill-1.5.1])

Attachments

(9 files, 8 obsolete files)

59.30 KB, patch
gmealer
: review+
Details | Diff | Splinter Review
992 bytes, patch
whimboo
: review+
Details | Diff | Splinter Review
51.42 KB, patch
gmealer
: review+
Details | Diff | Splinter Review
51.05 KB, patch
gmealer
: review+
Details | Diff | Splinter Review
124.06 KB, patch
gmealer
: review+
Details | Diff | Splinter Review
124.09 KB, patch
gmealer
: review+
Details | Diff | Splinter Review
121.05 KB, patch
gmealer
: review+
Details | Diff | Splinter Review
629 bytes, patch
whimboo
: review+
Details | Diff | Splinter Review
634 bytes, patch
whimboo
: review+
Details | Diff | Splinter Review
With CommonJS supported by Mozmill 1.5.1 (bug 588682) we will have to update all of our shared modules and tests. This task is planned after a week of using Mozmill 1.5.1 on our boxes in the QA lab. Once we can make sure that there is no regression we can begin with the update. It's quite a bit of work which is involved to get this bug fixed. So we will have to divide the work into groups and assign areas to different people. That way we should be able to do it in two days for the default branch. Backports have to follow.

Steps:

* I will update all shared modules so they will use CommonJS internally. No test should be affected by this change, because the module name should stay intact. It could be also useful for future usage.

* Once this has been finished we have to assign a number of subfolders to each person of the team. So we can independently update all the tests, get them reviewed, and checked-in.

The changes which will be introduced in this bug are the base for our upcoming shared module refactoring work. That means they are really important.

For now I will test the Common JS usage and will upload a WIP patch for the shared modules hopefully by tomorrow.
Initial patch for all of our shared modules. Internally they will be able to use CommonJS while the tests itself will use the old module collector.

After all tests have been updated, we will have to rename the shared modules and give them a better name. I propose something like "testUtilsAPI.js" -> "utils.js".

Geo, please have a look at the patch. You will not be able to execute the tests with a release build of mozmill but the latest dev version from hotfix-1.5.1 should work fine.
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Attachment #481706 - Flags: feedback?(gmealer)
Depends on: 602455
Whiteboard: [needs-mozmill-1.5.1]
Comment on attachment 481706 [details] [diff] [review]
Patch v1 (part I - shared modules)

Patch looks pretty good so far.  It's a lot to review all at once, though, so you might want to consider splitting it up some.  Other than that, carry on!
Attachment #481706 - Flags: feedback?(gmealer) → feedback+
Blocks: 604703
Blocks: 604708
Blocks: 604718
(In reply to comment #2)
> Patch looks pretty good so far.  It's a lot to review all at once, though, so
> you might want to consider splitting it up some.  Other than that, carry on!

Well this is a combined patch. I can't split this up because of the dependencies between the shared modules. Once we update the tests we will have to attach patches for each sub folder separately.
Fair enough.  Figured I'd throw it out there in hopes that even shared modules changes could be chunked a little.  

I figured since the module vars are only used internally, there was no real reason they couldn't be handled one-by-one, but maybe it's the external module identifier that's the problem.  OTOH, we could have chosen not to remove that yet so the patch could broken up.  :)
This patch updates the changes to the current head and also includes the tabView API.
Attachment #481706 - Attachment is obsolete: true
Attachment #485762 - Flags: review?(gmealer)
Sorry, forgot about the exports for the TabViewAPI
Attachment #485762 - Attachment is obsolete: true
Attachment #485778 - Flags: review?(gmealer)
Attachment #485762 - Flags: review?(gmealer)
Given my talk with Geo I made some small tweaks.
Attachment #485778 - Attachment is obsolete: true
Attachment #485851 - Flags: review?(gmealer)
Attachment #485778 - Flags: review?(gmealer)
Figured that there is a spelling error in the UtilsAPI which breaks some of the tests. Lets get it fixed too.
Attachment #485851 - Attachment is obsolete: true
Attachment #485857 - Flags: review?(gmealer)
Attachment #485851 - Flags: review?(gmealer)
Lets keep this bug for the shared module work only. Update for tests should be worked on separate bugs.
Summary: Update shared modules and tests to use CommonJS → Update shared modules use CommonJS
Depends on: 607106
Comment on attachment 485857 [details] [diff] [review]
Patch v1.4 (part I - shared modules) [checked-in]

LGTM, don't see any further problems. Go ahead and land it and we can get started with test patches!
Attachment #485857 - Flags: review?(gmealer) → review+
Comment on attachment 485857 [details] [diff] [review]
Patch v1.4 (part I - shared modules) [checked-in]

Landed on default as:
http://hg.mozilla.org/qa/mozmill-tests/rev/a7d0b8557161
Attachment #485857 - Attachment description: Patch v1.4 (part I - shared modules) → Patch v1.4 (part I - shared modules) [checked-in]
Blocks: 607151
No longer blocks: 607151
Backport for 1.9.2 branch.
Attachment #485910 - Flags: review?(gmealer)
Backport for 1.9.1 branch.
Attachment #485923 - Flags: review?(gmealer)
Depends on: 607151
Depends on: 607198
Missed the exports in the addons API.
Attachment #485910 - Attachment is obsolete: true
Attachment #486024 - Flags: review?(gmealer)
Attachment #485910 - Flags: review?(gmealer)
Same for the API in 1.9.1
Attachment #485923 - Attachment is obsolete: true
Attachment #486025 - Flags: review?(gmealer)
Attachment #485923 - Flags: review?(gmealer)
Comment on attachment 486024 [details] [diff] [review]
Patch v1.1 (part I - shared modules - 1.9.2)

LGTM, please land when the branch opens
Attachment #486024 - Flags: review?(gmealer) → review+
Comment on attachment 486025 [details] [diff] [review]
Patch v1.1 (part I - shared modules - 1.9.1)

Also LGTM, please land when branch opens.
Attachment #486025 - Flags: review?(gmealer) → review+
Geo, can you also please file a bug for your section? Would be nice to have all the stuff checked into default by tomorrow.
Raising the issue in this bug as I suspect it a commonJS conversion issue. I've noticed [1] and seen in local test runs that there's an issue getting the collector, particularly in this call at [2]

|var prefs = collector.getModule('PrefsAPI').preferences;|

[1] http://mozmill-release.brasstacks.mozilla.com/#/general/report/4a2217a8a22f02aec478e6684a15525a

[2] http://hg.mozilla.org/qa/mozmill-tests/file/390d7b2f8e20/shared-modules/testUtilsAPI.js#l294

This is affecting those three security tests: safeBrowsingNotificationBar, safeBrowsingWarningPages, and testUntrustedConnectionErrorPage
Comment on attachment 486452 [details] [diff] [review]
testUtilsAPI breakage fix (default) [checked-in]

>+// Load the required modules
>+var prefs = require("testPrefsAPI");

Good catch! Strange that I have missed that!

The comment should be similar to all the other comments in the tests. I have seen that I used the wrong comments in the shared modules. I will update it in one step.

>-  var prefValue = prefs.getPref("browser.startup.homepage", "",
>+  var prefValue = preferences.getPref("browser.startup.homepage", "",
>                                 true, Ci.nsIPrefLocalizedString);

I will also correct the indentation.
Attachment #486452 - Flags: review?(hskupin) → review+
Comment on attachment 486452 [details] [diff] [review]
testUtilsAPI breakage fix (default) [checked-in]

Landed on default as:
http://hg.mozilla.org/qa/mozmill-tests/rev/c41f40e28560
Attachment #486452 - Attachment description: testUtilsAPI breakage fix (default) → testUtilsAPI breakage fix (default) [checked-in]
Updated backport of shared modules for 1.9.2 with missing parts.
Attachment #486024 - Attachment is obsolete: true
Attachment #486469 - Flags: review?(gmealer)
Updated backport of shared modules for 1.9.1 with missing parts.
Attachment #486025 - Attachment is obsolete: true
Attachment #486475 - Flags: review?(gmealer)
That's the final patch which completely cleans-up all the old crufted code in favor of CommonJS. Yay!
Attachment #486650 - Flags: review?(gmealer)
Comment on attachment 486650 [details] [diff] [review]
Final patch for shared modules v1 (default) [checked-in]

r+ pending renames of the files, but I'm mildly surprised by this considering we hadn't discussed renaming the files yet.
Attachment #486650 - Flags: review?(gmealer) → review+
Comment on attachment 486475 [details] [diff] [review]
Patch v2 (part I - shared modules - 1.9.1) [checked-in]

Looks fine.
Attachment #486475 - Flags: review?(gmealer) → review+
Comment on attachment 486469 [details] [diff] [review]
Patch v2 (part I - shared modules - 1.9.2) [checked-in]

Looks fine.
Attachment #486469 - Flags: review?(gmealer) → review+
> r+ pending renames of the files, but I'm mildly surprised by this considering
> we hadn't discussed renaming the files yet.

Discussed rename with whimboo, let's do it, r+.
Comment on attachment 486650 [details] [diff] [review]
Final patch for shared modules v1 (default) [checked-in]

Now we have completed the CommonJS transition on default. Branches will follow soon.
Attachment #486650 - Attachment description: Final patch for shared modules v1 (default) → Final patch for shared modules v1 (default) [checked-in]
Comment on attachment 486469 [details] [diff] [review]
Patch v2 (part I - shared modules - 1.9.2) [checked-in]

Landed on 1.9.2 as:
http://hg.mozilla.org/qa/mozmill-tests/rev/d2f9cefb2202
Attachment #486469 - Attachment description: Patch v2 (part I - shared modules - 1.9.2) → Patch v2 (part I - shared modules - 1.9.2) [checked-in]
Comment on attachment 486475 [details] [diff] [review]
Patch v2 (part I - shared modules - 1.9.1) [checked-in]

Landed on 1.9.1 as:
http://hg.mozilla.org/qa/mozmill-tests/rev/635eee9055b5
Attachment #486475 - Attachment description: Patch v2 (part I - shared modules - 1.9.1) → Patch v2 (part I - shared modules - 1.9.1) [checked-in]
Backports landed as:
http://hg.mozilla.org/qa/mozmill-tests/rev/716a1229a3d9 (1.9.2)
http://hg.mozilla.org/qa/mozmill-tests/rev/129c9b95ad59 (1.9.1)
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Sorry, that was the wrong bug.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to comment #30)
> Comment on attachment 486650 [details] [diff] [review]
> Final patch for shared modules v1 (default) [checked-in]

This has landed as:
http://hg.mozilla.org/qa/mozmill-tests/rev/aca4ffe102bb
Status: REOPENED → ASSIGNED
Had to mostly do it from scratch, because some files we have on the default branch don't exist in the older branches and that screwed everything up. :/

I ran a complete test-run and everything looks fine. No JS errors appear.
Attachment #486880 - Flags: review?(gmealer)
This patch also fixes a problem in testSafeBrowsingNotificationBar.js where we had a missing closing bracket and which caused a JS error.
Attachment #486885 - Flags: review?(gmealer)
Comment on attachment 486880 [details] [diff] [review]
Final patch for shared modules v1 (1.9.2)

Looks fine, please land.
Attachment #486880 - Flags: review?(gmealer) → review+
Comment on attachment 486885 [details] [diff] [review]
Final patch for shared modules v1 (1.9.1)

Looks fine, please land.
Attachment #486885 - Flags: review?(gmealer) → review+
Final patches for older branches landed as:
http://hg.mozilla.org/qa/mozmill-tests/rev/8b0c4b58c592 (1.9.2)
http://hg.mozilla.org/qa/mozmill-tests/rev/d4d762861c40 (1.9.1)

We are done! It's great to see CommonJS in place!
Status: ASSIGNED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Comment on attachment 486475 [details] [diff] [review]
Patch v2 (part I - shared modules - 1.9.1) [checked-in]

>+// Export of classes
>+exports.softwareUpdate = softwareUpdate;
>+exports.softwareUpdate.prototype = softwareU

My backport patch (part I) for 1.9.1 has introduced this broken line at the end of the software update module. That's the reason why update tests were broken on 1.9.1. I will fix this with the patch to land on bug 608511.
Attachment #490609 - Flags: review?(hskupin) → review?(gmealer)
Attachment #490609 - Flags: review?(gmealer) → review+
(In reply to comment #42)
> Created attachment 490609 [details] [diff] [review]
> Patch v1 - (Bustage fix for tabs reference in addons API)

http://hg.mozilla.org/qa/mozmill-tests/rev/9a0629f1bd44
Attachment #490649 - Flags: review?(hskupin) → review+
(In reply to comment #44)
> Created attachment 490649 [details] [diff] [review]
> Patch v1 - (Followup: Another bad reference in addons API)

http://hg.mozilla.org/qa/mozmill-tests/rev/328f78ba60aa
Move of Mozmill Test related project bugs to newly created components. You can
filter out those emails by using "Mozmill-Tests-to-MozillaQA" as criteria.
Product: Testing → Mozilla QA
Version: Trunk → unspecified
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: