Closed Bug 548446 Opened 14 years ago Closed 14 years ago

Retrieving the extension id from the install.rdf fails for some extensions

Categories

(Testing :: Mozbase, defect)

defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: whimboo, Assigned: jgriffin)

Details

(Whiteboard: [verified-mozmill-1.4.1])

Attachments

(1 file)

Using the -w (--plugin) option to install an extension before running the Mozmill tests can fail for some extensions.

As an example you can take FoxyProxy:
https://addons.mozilla.org/de/firefox/addons/versions/2464

$ mozmill -b /Applications/Namoroka.app/ --plugin=/data/foxyproxy.xpi 
Traceback (most recent call last):
  File "/usr/local/bin/mozmill", line 8, in <module>
    load_entry_point('mozmill==1.4', 'console_scripts', 'mozmill')()
  File "/Library/Python/2.5/site-packages/mozmill-1.4-py2.5.egg/mozmill/__init__.py", line 541, in cli
    CLI().run()
  File "/Library/Python/2.5/site-packages/mozmill-1.4-py2.5.egg/mozmill/__init__.py", line 518, in run
    self._run()
  File "/Library/Python/2.5/site-packages/mozmill-1.4-py2.5.egg/mozmill/__init__.py", line 459, in _run
    runner = self.create_runner()
  File "/Volumes/data/build/tools/mozrunner/mozrunner/__init__.py", line 482, in create_runner
    plugins=self.plugins)
  File "/Library/Python/2.5/site-packages/mozmill-1.4-py2.5.egg/mozmill/__init__.py", line 454, in get_profile
    profile = super(CLI, self).get_profile(*args, **kwargs)
  File "/Library/Python/2.5/site-packages/jsbridge-2.3.4-py2.5.egg/jsbridge/__init__.py", line 112, in get_profile
    profile = super(CLI, self).get_profile(*args, **kwargs)
  File "/Volumes/data/build/tools/mozrunner/mozrunner/__init__.py", line 494, in get_profile
    return self.profile_class(binary, profile, create_new, plugins, preferences)
  File "/Volumes/data/build/tools/mozrunner/mozrunner/__init__.py", line 188, in __init__
    self.install_plugin(plugin)
  File "/Volumes/data/build/tools/mozrunner/mozrunner/__init__.py", line 240, in install_plugin
    plugin_path = os.path.join(self.profile, 'extensions', plugin_id)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/posixpath.py", line 60, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'

The line which fails is:
http://github.com/mikeal/mozrunner/blob/master/mozrunner/__init__.py#L238

It does not retrieve the id. Instead we get a None type back.

This can be an important issue which we should fix before the Addons testday next week.
Jgriffin,  This is pretty serious.  Can you take a quick look at this?  Since it works for some extensions and not for others, I bet this is a simple oversight in the code.

Henrik, can you give us an extension that does work so that we can start with a working case and see what is different?
The issue here is that RDF is insane and, frankly retarded. I have no idea why we are using this insane stuff because nobody else is.

It's in XMLRDF which means we can parse it in XML and try to get the info we need but it's not XML, it's RDF, and there is more than one way to express the same thing if we're parsing it as XML.

Python doesn't ship with an RDF parser which means that moving to a different parser would mean taking on another dependency.
Twitterbar can get installed:
https://addons.mozilla.org/de/firefox/addons/versions/4664

For the FoxyProxy addon the problem could be the multiple em:id definitions inside the Description tag?
Attached file mozrunner update
Here's a version of __init__.py from mozrunner which fixes this; whimboo, can you verify?  I am not at home this week and don't have access to my regular mozmill machine, and for some can't seem to git clone mozrunner on my laptop, I keep getting:

fatal: http://github.com/mikeal/mozrunner/info/refs not found: did you run git u
pdate-server-info on the server?

Thus, no git diff.

The only change is to add two lines at around line 225.
Jonathan, that works like a charm! Thanks. I have created a diff and sent a pull request to Mikeal:

http://github.com/whimboo/mozrunner/commit/bb38dde8eaad69065d0a5b4e193e48f50d41bb29
Assignee: nobody → jgriffin
Status: NEW → ASSIGNED
As given by Mikeal, the patch has been merged.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [mozmill-1.4.1]
Verified fixed with the release candidate of Mozrunner 2.4.2.
Whiteboard: [mozmill-1.4.1] → [verified-mozmill-1.4.1]
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: