Closed Bug 930732 Opened 11 years ago Closed 4 years ago

Upgrade to Mozmill 2.0.x for Thunderbird

Categories

(Thunderbird :: Testing Infrastructure, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: tessarakt, Unassigned)

Details

Eventually, the Mozmill copy in Thunderbird should be updated to 2.0.x and the mozmill tests updated/ported.
See also bug 929608 comment 6, bug 929608 comment 7, and bug 929608 comment 8.

@Henrik: Doesn't MozMill 2.0 have an API that is considerably different from 1.5.x? This would mean that the effort for porting the tests would be significant as well. If I am right here, I think the way to go would be getting Mozmill 2.0 to run in Thunderbird, and then porting and moving tests step by step, eventually removing Mozmill 1.5.x when everything is done.

@Chiaki: Eventually, both has to be done, i.e., a local "make mozmill" and the packaging and running for tryserver builds has to work. But having it work locally would be a big step in the right direction.
(In reply to Jens Müller (:tessarakt) from comment #1)
> See also bug 929608 comment 6, bug 929608 comment 7, and bug 929608 comment
> 8.
> 
> @Henrik: Doesn't MozMill 2.0 have an API that is considerably different from
> 1.5.x? This would mean that the effort for porting the tests would be
> significant as well. If I am right here, I think the way to go would be
> getting Mozmill 2.0 to run in Thunderbird, and then porting and moving tests
> step by step, eventually removing Mozmill 1.5.x when everything is done.
> 
> @Chiaki: Eventually, both has to be done, i.e., a local "make mozmill" and
> the packaging and running for tryserver builds has to work. But having it
> work locally would be a big step in the right direction.

I am willing to help with mozmill-2.0 transition for TB.

I would like to start local mozilla-2.0 transition first.

So I installed mozmill-2.0.
Basically I followed the steps in:
https://developer.mozilla.org/en/docs/Mozmill

Then I realize that this must be put into the virtualenv directory which seemed to be used
by TB mozmill testsuite.

Just in case, 
I installed 
virtualenv-1.10.1 which seems to be the latest version.
|pip install virtualenv|  did it for me/

These installed |mozmill-2.0| and |virtualenv| in |/usr/local/bin| by default.

Now the big question. How do I include the mozmill-2.0 as opposed to
1.5.16 in the TB's mozmill virtual test environment.
This I say, becaue I found |mozmill| under

${MOZ_OBJDIR}/mozilla/_tests/mozmill-virtualenv/bin/mozmill

still has the following line inside (it is a python script)
after running |make -f client.mk| to see if this refreshes the commands, etc.

#!/new-hd1/extra/ishikawa/TB-3HG/objdir-tb3/mozilla/_tests/mozmill-virtualenv/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'mozmill==1.5.16','console_scripts','mozmill'
__requires__ = 'mozmill==1.5.16'
import sys
from pkg_resources import load_entry_point

cf. (%{MOZ_OBJDIR} is /new-hd1/extra/ishikawa/TB-3HG/objdir-tb3 below.)

When I ran |make -f client.mk|,
I see the running of PIP at the end, but obviously mozmill itself is not replaced. 

Then I recall that there is a tar or some type of archive that is used to re-create 
the mozmill / virtualenv for TB's mozmill virtual environment.

How do we go about refreshing the tar file (and which file?) so that mozmill-2.0
which was installed /usr/local/bin can be included? .

TIA
(In reply to Jens Müller (:tessarakt) from comment #1)
> @Henrik: Doesn't MozMill 2.0 have an API that is considerably different from
> 1.5.x? This would mean that the effort for porting the tests would be
> significant as well. If I am right here, I think the way to go would be
> getting Mozmill 2.0 to run in Thunderbird, and then porting and moving tests
> step by step, eventually removing Mozmill 1.5.x when everything is done.

No, 2.0 should be completely backward compatible. But if you find something in regards to Thunderbird please let me know. Keep in mind that there is one single bug which prevents ourselves from upgrading. It is bug 922995, and we hope to have it fixed today, with a 2.0.1 release of Mozmill.
(In reply to Jens Müller (:tessarakt) from comment #1)
> @Henrik: Doesn't MozMill 2.0 have an API that is considerably different from
> 1.5.x? This would mean that the effort for porting the tests would be
> significant as well. If I am right here, I think the way to go would be
> getting Mozmill 2.0 to run in Thunderbird, and then porting and moving tests
> step by step, eventually removing Mozmill 1.5.x when everything is done.

There seems to be many deprecated methods in mozmill 2.0 (https://developer.mozilla.org/en-US/docs/Mozmill/Mozmill_Controller_Object) but they are probably not removed yet. So our tests should still work with it.
(In reply to ISHIKAWA, Chiaki from comment #2)
> I am willing to help with mozmill-2.0 transition for TB.
> 
> I would like to start local mozilla-2.0 transition first.

Since we have a mozmill copy in tree - http://mxr.mozilla.org/comm-central/source/mail/test/resources/
there is probably little to win by trying to run any other copy from outside. Just replace the in tree copy locally, and make whatever other changes need to be done. That way there's no extra step to submit a patch later when things are working.
(In reply to Magnus Melin from comment #5)
> 
> Since we have a mozmill copy in tree -
> http://mxr.mozilla.org/comm-central/source/mail/test/resources/
> there is probably little to win by trying to run any other copy from
> outside. Just replace the in tree copy locally,

Sorry, I have no clue to this "replace the in tree copy locally" part.

After a default install of mozmill and virtualenv without specifying the special target directory, 
they go under /usr/local and
I have under /usr/local/lib/python2.7/dist-packages:
---
ls /usr/local/lib/python2.7/dist-packages/
./				 mozfile/		    mozprofile/
../				 mozfile-0.12.egg-info/     mozprofile-0.16.egg-info/
ManifestDestiny-0.5.7.egg-info/  mozinfo/		    mozrunner/
jsbridge/			 mozinfo-0.6.egg-info/	    mozrunner-5.24.egg-info/
jsbridge-3.0.egg-info/		 mozlog/		    simplejson/
manifestparser/			 mozlog-1.3.egg-info/	    simplejson-3.3.1.egg-info/
mozcrash/			 mozmill/		    virtualenv-1.10.1.egg-info/
mozcrash-0.10.egg-info/		 mozmill-2.0.egg-info/	    virtualenv.py
mozdevice/			 mozprocess/		    virtualenv.pyc
mozdevice-0.29.egg-info/	 mozprocess-0.13.egg-info/  virtualenv_support/

--
and I have under /REF-COMM-CENTRAL/comm-central/mail/test/resources:
( /REF-COMM-CENTRAL/comm-central is the comcentral source tree. )

./  ../  ManifestDestiny/  installmozmill.py  jsbridge/  mozmill/  mozrunner/  simplejson-2.1.6/


Can I simply overwrite the mozmill, mozrunner, jsbridge from the newly installed mozmill, etc.?

(This is what I did anyway, I saved the copy of resource directory above, and
cp -r /usr/local/lib/python2.7/dist-packages/{mozmill,mozrunner,jsbridge} /REF-COMM-CENTRAL/comm-central/mail/test/resources
This copies files that were not under |resources/mozmill| directory before, for example,
but I am running |make mozmill| and it seems to be running just fine. Yes, it finished
without incurring additional errors (currently 6-8 under 64-bit Debian GNU/Linux), and so
mozmill-2.0 seems just fine. )

This is under 64-bit Debian GNU/Linux.

TIA
I meant you won't need to do any "default install of mozmill", but you could remove the old in-tree directory of mozmill (and what else is needed), with the new version. Then change whatever config needs changing so that someone can download the source, compile, and after that make mozmill should work and use mozmill2.

(Maybe what you did actually did part of it, i can't say.)

Anyway, looking promising!
Just replacing the mozmill directory is not sufficient for 2.0:

$ make mozmill
unset PYTHONHOME && cd ./mozilla/_tests/mozmill && MACOSX_DEPLOYMENT_TARGET= \
        /home/jens/devel/releases-comm-central/obj-thunderbird/mozilla/_tests/mozmill-virtualenv/bin/python runtestlist.py --list=mozmilltests.list \
        --binary=../../.././mozilla/dist/bin/thunderbird \
        --dir=/home/jens/devel/releases-comm-central/mail/test/mozmill \
        --symbols-path=/home/jens/devel/releases-comm-central/obj-thunderbird/mozilla/dist/crashreporter-symbols \
        --plugins-path=/home/jens/devel/releases-comm-central/obj-thunderbird/mozilla/dist/plugins \

INFO | (runtestlist.py) | Running directory: account
['/home/jens/devel/releases-comm-central/obj-thunderbird/mozilla/_tests/mozmill-virtualenv/bin/python', 'runtest.py', '-t', '/home/jens/devel/releases-comm-central/mail/test/mozmill/account', '--binary', '../../.././mozilla/dist/bin/thunderbird', '--symbols-path', '/home/jens/devel/releases-comm-central/obj-thunderbird/mozilla/dist/crashreporter-symbols', '--plugins-path', '/home/jens/devel/releases-comm-central/obj-thunderbird/mozilla/dist/plugins']
Traceback (most recent call last):
  File "runtest.py", line 15, in <module>
    import mozmill
  File "/home/jens/devel/releases-comm-central/obj-thunderbird/mozilla/_tests/mozmill-virtualenv/local/lib/python2.7/site-packages/mozmill/__init__.py", line 23, in <module>
    from mozrunner.utils import get_metadata_from_egg
ImportError: No module named utils
TEST-UNEXPECTED-FAIL | (runtestlist.py) | Exited with code 1 during directory run
INFO | (runtestlist.py) | account: 0 passed, 0 failed

[and the same for all the remaining directories ...]
That's correct because you will need several other packages too including new versions of Mozrunner and JSbridge. You might want to check that by installing Mozmill via 'pip install mozmill==2.0'.
In my case reported in  comment 6, I copied mozmill, mozrunner, jsbridge, i.e.,
three of them.

cp -r /usr/local/lib/python2.7/dist-packages/{mozmill,mozrunner,jsbridge} /REF-COMM-CENTRAL/comm-central/mail/test/resources

(In reply to Henrik Skupin (:whimboo) from comment #9)
> That's correct because you will need several other packages too including
> new versions of Mozrunner and JSbridge. You might want to check that by
> installing Mozmill via 'pip install mozmill==2.0'.

So sounds like my copying three packages above was helpful.

The last pip command line should be invoked AFTER we invoke virtualenv, correct?

I will check my installation on a different computer tomorrow and let you know
what I will find there. (I am on the road right now.)

Like I said, after copying three of the packages, I don't seem to have problems, but
I can't exactly say that I am running mozmill 2.0

It would be great if |make mozmill| invokes |mozmill --version| near the beginning of the run to show
the version of mozmill it is running. Then I can be sure that 2.0 is running.

TIA
Keep also the dependencies of mozrunner in mind. There are a couple other mozbase packages it depends on:
https://github.com/mozilla/mozbase/blob/master/mozrunner/setup.py#L13
(In reply to ISHIKAWA, Chiaki from comment #10)
> In my case reported in  comment 6, I copied mozmill, mozrunner, jsbridge,
> i.e.,
> three of them.
> 
> cp -r /usr/local/lib/python2.7/dist-packages/{mozmill,mozrunner,jsbridge}
> /REF-COMM-CENTRAL/comm-central/mail/test/resources
> 
> (In reply to Henrik Skupin (:whimboo) from comment #9)
> > That's correct because you will need several other packages too including
> > new versions of Mozrunner and JSbridge. You might want to check that by
> > installing Mozmill via 'pip install mozmill==2.0'.
> 
> So sounds like my copying three packages above was helpful.
> 
> The last pip command line should be invoked AFTER we invoke virtualenv,
> correct?
> 
> I will check my installation on a different computer tomorrow and let you
> know
> what I will find there. (I am on the road right now.)
> 
> Like I said, after copying three of the packages, I don't seem to have
> problems, but
> I can't exactly say that I am running mozmill 2.0
> 
> It would be great if |make mozmill| invokes |mozmill --version| near the
> beginning of the run to show
> the version of mozmill it is running. Then I can be sure that 2.0 is running.
> 
> TIA

Hi, I *think* I have been running mozmill 2.0 on my local test PC (two of them: one debian GNU/Linux 32-bit and the other 64-bit) without much ill-effect so far. Sorry, I have forgotten to
report back.

If there are specific tests, I should do, please let me know.

TIA
Ping for this, how to getting TB support for mozmill 2.x?
I tried to import the hotfix-2.0 branch of mozmill again and currently I am stuck here:

tbird-bin/_tests/mozmill-virtualenv/bin/python runtest.py \
--test=mozilla/../mail/test/mozmill/content-tabs/test-install-xpi.js \
--binary=tbird-bin/dist/bin/thunderbird \
--symbols-path=tbird-bin/dist/crashreporter-symbols \
--plugins-path=tbird-bin/dist/plugins \
--testing-modules-dir=tbird-bin/_tests/modules \

Traceback (most recent call last):
  File "runtest.py", line 422, in <module>
    mozmill.LoggerListener.cases['mozmill.endTest'] = logEndTest
AttributeError: 'module' object has no attribute 'LoggerListener'
make: *** [mozmill-one] Error 1
(In reply to Henrik Skupin (:whimboo) from comment #11)
> Keep also the dependencies of mozrunner in mind. There are a couple other
> mozbase packages it depends on:
> https://github.com/mozilla/mozbase/blob/master/mozrunner/setup.py#L13

This URL seems invalid today.
Is there a new URL?

TIA
mozbase is no longer on github. The whole project has been moved in to mozilla-central a while ago. It's located under testing/mozbase now.

mozmill is gone.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.