Closed Bug 982610 Opened 10 years ago Closed 10 years ago

Update TPS to use latest Mozmill 2.0.6

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32
Tracking Status
firefox30 --- fixed
firefox31 --- fixed
firefox32 --- fixed
b2g-v1.4 --- fixed
b2g-v2.0 --- fixed

People

(Reporter: whimboo, Assigned: cosmin-malutan)

References

Details

Attachments

(1 file, 6 obsolete files)

When TPS has been created the included Mozmill version was in alpha state. Now that Mozmill 2.0 has been released and even Mozmill 2.0.6 is available, we should update TPS to make use of that version for stability.

https://github.com/mozilla/mozmill/tree/2.0.6

It is not that urgent as to get all the tests running, so we can delay that a bit.
Assignee: nobody → cosmin.malutan
This is a WIP patch:
I had to add the extension code from mozmill in to TPS.
To remove jsbridge module loading in mozmill
Fix tests, they haven't been ran with australis
Fix other import errors.

I have some work to do here but I'm close, it looks like mozmill_sanity tests haven't been ran in a long time.
Attached patch patch_v1.1 (obsolete) — Splinter Review
With this the mozmill_sanity tests passes. It still has an issue with aModule, it looks like controller is not persisted between test modules, I will have to fix that tomorrow then the patch will be ready for review.
Attachment #8425513 - Attachment is obsolete: true
Attached patch patch_v2.0 (obsolete) — Splinter Review
The setupModule wasn't loading because when calling initTestModule, name parameter has to be null in oreder for setupModule to ran, in our case it was undefined.
> https://github.com/mozilla/mozmill/blob/hotfix-2.0/mozmill/mozmill/extension/resource/modules/frame.js#L468

I will update a patch in which I will just copy paste the mozmill extension so you can make a diff between the patches, to see only the changes I made, for the extension to work.
Attachment #8425532 - Attachment is obsolete: true
Attachment #8426102 - Flags: review?(hskupin)
Attached patch patch_v2.1 (obsolete) — Splinter Review
Attachment #8426102 - Attachment is obsolete: true
Attachment #8426102 - Flags: review?(hskupin)
Attachment #8426170 - Flags: review?(hskupin)
Attached patch 0001-PATCH-FOR-DIFF.patch (obsolete) — Splinter Review
This patch is for making a diff between just coping the mozmill extension in TPS.
(In reply to Cosmin Malutan from comment #3)
> The setupModule wasn't loading because when calling initTestModule, name
> parameter has to be null in oreder for setupModule to ran, in our case it
> was undefined.
> > https://github.com/mozilla/mozmill/blob/hotfix-2.0/mozmill/mozmill/extension/resource/modules/frame.js#L468

Why it is undefined? And what did you change? I really don't get that. Please be more specific in explaining changes you do.

> I will update a patch in which I will just copy paste the mozmill extension
> so you can make a diff between the patches, to see only the changes I made,
> for the extension to work.

That's not necessary. Bugzilla supports interdiff, so you might want to give me that link and the appropriate lines for the changes.
Attachment #8426171 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Comment on attachment 8426170 [details] [diff] [review]
patch_v2.1

Review of attachment 8426170 [details] [diff] [review]:
-----------------------------------------------------------------

::: services/sync/tests/tps/mozmill_sanity2.js
@@ -1,2 @@
> -/* Any copyright is dedicated to the Public Domain.
> -   http://creativecommons.org/publicdomain/zero/1.0/ */

MPL 2 please.

@@ +7,4 @@
>    controller.open("about:support");
>    controller.waitForPageLoad();
>  
> +  var appbox = new findElement.ID(controller.tabs.activeTab, "application-box");

findElement.ID is a method and doesn't need the new operator. I already told this on another bug.

@@ +7,5 @@
>    controller.open("about:support");
>    controller.waitForPageLoad();
>  
> +  var appbox = new findElement.ID(controller.tabs.activeTab, "application-box");
> +  assert.waitFor(() => appbox.getNode().innerHTML == 'Firefox', 'correct app name');

I don't see why we need a waitFor here.

@@ +47,2 @@
>    controller.click(item);
> +  item = new findElement.Lookup(controller.window.document, SEARCH_AUTOCOMPLETE);

I would remove all those tests. I don't see how those are useful.

::: services/sync/tps/extensions/mozmill/build.xml
@@ +21,5 @@
> +  <target name="cleanup">
> +    <!-- Delete the chrome directory, any other cleanup actions go here -->
> +    <delete dir="chrome"/>
> +  </target>
> +</project>

We do not need this file.

::: services/sync/tps/extensions/mozmill/components/handlers.js
@@ +1,3 @@
> +/* This Source Code Form is subject to the terms of the Mozilla Public
> + * License, v. 2.0. If a copy of the MPL was not distributed with this
> + * file, you can obtain one at http://mozilla.org/MPL/2.0/. */

Why are you adding this file? It's not necessary and will only fail given that it is using jsbridge all over the place.

::: services/sync/tps/extensions/mozmill/content/test/chrome_elements.xul
@@ +1,2 @@
> +<?xml version="1.0"?>
> +

only used for mutt tests, which we don't need here.

::: services/sync/tps/extensions/mozmill/content/test/radio_buttons.xul
@@ +1,2 @@
> +<?xml version="1.0"?>
> +

Same for that file, and others under that folder.

::: services/sync/tps/extensions/mozmill/defaults/preferences/debug.js
@@ -3,5 @@
> - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
> -
> -/* debugging prefs */
> -pref("browser.dom.window.dump.enabled", true);
> -pref("javascript.options.showInConsole", true);

Are you sure it can be removed? I think we would fail to dump to the console. Or is that set via the testrunner itself already?

::: services/sync/tps/extensions/mozmill/install.rdf
@@ -1,4 @@
>  <?xml version="1.0"?>
> -<!-- This Source Code Form is subject to the terms of the Mozilla Public
> -   - License, v. 2.0. If a copy of the MPL was not distributed with this
> -   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

Why the removal?

::: services/sync/tps/extensions/tps/resource/tps.jsm
@@ -39,5 @@
>  var prefs = Cc["@mozilla.org/preferences-service;1"]
>              .getService(Ci.nsIPrefBranch);
>  
> -var mozmillInit = {};
> -Cu.import('resource://mozmill/modules/init.js', mozmillInit);

Why do we remove it here but not replace it with mozmill.js? As of now we wont initialize Mozmill correctly.
Attachment #8426170 - Flags: review?(hskupin) → review-
Attached patch patch_v3.0 (obsolete) — Splinter Review
(In reply to Henrik Skupin (:whimboo) from comment #7)
> > +  var appbox = new findElement.ID(controller.tabs.activeTab, "application-box");
> > +  assert.waitFor(() => appbox.getNode().innerHTML == 'Firefox', 'correct app name');
> 
> I don't see why we need a waitFor here.
This is asynchronously updated so it's not ready when the pageload event is dispatched:
http://mxr.mozilla.org/mozilla-central/source/toolkit/content/aboutSupport.js#35

> > -/* debugging prefs */
> > -pref("browser.dom.window.dump.enabled", true);
> > -pref("javascript.options.showInConsole", true);
> 
> Are you sure it can be removed? I think we would fail to dump to the
> console. Or is that set via the testrunner itself already?
I can make dumps without this prefs, those were removed wen we passed from mozmill 1.5 to 2.0
Attachment #8426170 - Attachment is obsolete: true
Attachment #8426867 - Flags: review?(hskupin)
(In reply to Cosmin Malutan from comment #8)
> > > +  var appbox = new findElement.ID(controller.tabs.activeTab, "application-box");
> > > +  assert.waitFor(() => appbox.getNode().innerHTML == 'Firefox', 'correct app name');
> > 
> > I don't see why we need a waitFor here.
> This is asynchronously updated so it's not ready when the pageload event is
> dispatched:
> http://mxr.mozilla.org/mozilla-central/source/toolkit/content/aboutSupport.
> js#35

Then also use textContent as the code you are referring here is doing. innerHTML is dangerous!

> > > -/* debugging prefs */
> > > -pref("browser.dom.window.dump.enabled", true);
> > > -pref("javascript.options.showInConsole", true);
> > 
> > Are you sure it can be removed? I think we would fail to dump to the
> > console. Or is that set via the testrunner itself already?
> I can make dumps without this prefs, those were removed wen we passed from
> mozmill 1.5 to 2.0

Just checked and those prefs are getting set in testrunner.py.
Attachment #8426867 - Flags: review?(hskupin)
Attached patch patch_v3.1Splinter Review
(In reply to Henrik Skupin (:whimboo) from comment #9)
> Then also use textContent as the code you are referring here is doing.
> innerHTML is dangerous!
Done it!
Attachment #8426867 - Attachment is obsolete: true
Attachment #8426895 - Flags: review?(hskupin)
Comment on attachment 8426895 [details] [diff] [review]
patch_v3.1

Review of attachment 8426895 [details] [diff] [review]:
-----------------------------------------------------------------

This looks fine to me. Thanks Cosmin. I also tested it, and the sanity tests for Mozmill are passing now. I will get this landed in a bit.
Attachment #8426895 - Flags: review?(hskupin) → review+
https://hg.mozilla.org/mozilla-central/rev/f6d230cf0dab
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
We will get this tested today, and if all is stable we can do the backports. The patch should apply on all affected branches.
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: