Tests fail when cfx is run directly without 'activate' environment

66 views
Skip to first unread message

Jeff Griffiths

unread,
Feb 4, 2012, 9:37:03 AM2/4/12
to mozilla-la...@googlegroups.com
Recently some changes in the SDK have made it impossible to run cfx
unless you first run bin/activate. If I run something like this:

/usr/local/bin/python /Users/jeff/code/jetpack/addon-sdk/bin/cfx
--binary=/Applications/Aurora.app
--profiledir=/Users/jeff/Library/Application\
Support/Firefox/Profiles/0000000.Default run

...Firefox starts up but then immediately quits.

If I run testall instead I get a test failure ( see below for full error
output ). This happened to work previously and I found it convenient to
create an executable

While it wasn't necessarily a 'feature' of cfx to be able to run it
without the environment activated, there are valid reasons why you might
want to, for example if you wanted to integrate cfx test with
ant/jenkins for continuous integration. I believe there are people out
there currently that want to do this as well:

http://blog.mozilla.com/addons/2012/01/31/jetpack-project-weekly-update-for-january-31st-2012/#comments


Here's the full test failure output:

error: TEST FAILED: test-context-menu.testNewWindowMultipleModules (failure)
error: fail: The first item in sorted order should have the first
element in sorted order (2 != 1)
info: Traceback (most recent call last):
File
"resource://68279f75-1a05-4e71-8e61-54bbc5ac4569-at-jetpack/api-utils/lib/timer.js",
line 66, in notifyOnTimeout
this._callback.apply(null, this._params);
File
"resource://68279f75-1a05-4e71-8e61-54bbc5ac4569-at-jetpack/addon-kit/tests/test-context-menu.js",
line 1881, in null
callback.call(self, evt);
File
"resource://68279f75-1a05-4e71-8e61-54bbc5ac4569-at-jetpack/addon-kit/tests/test-context-menu.js",
line 2021, in null
onshownCallback.call(this, popup);
File
"resource://68279f75-1a05-4e71-8e61-54bbc5ac4569-at-jetpack/addon-kit/tests/test-context-menu.js",
line 1043, in null
test.checkMenu([item], [], []);
File
"resource://68279f75-1a05-4e71-8e61-54bbc5ac4569-at-jetpack/addon-kit/tests/test-context-menu.js",
line 1751, in null
this.checkSort(presentItems);
File
"resource://68279f75-1a05-4e71-8e61-54bbc5ac4569-at-jetpack/addon-kit/tests/test-context-menu.js",
line 1865, in null
"The first item in sorted order should have the " +
File
"resource://68279f75-1a05-4e71-8e61-54bbc5ac4569-at-jetpack/api-utils/lib/unit-test.js",
line 192, in assertEqual
this.fail(message);
File
"resource://68279f75-1a05-4e71-8e61-54bbc5ac4569-at-jetpack/api-utils/lib/unit-test.js",
line 99, in fail
this.console.trace();
console: [JavaScript Warning: "Duplicate resource declaration for
'services-sync' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/components/components.manifest"
line: 274}]
console: [JavaScript Warning: "Duplicate resource declaration for
'services-crypto' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/components/components.manifest"
line: 275}]
console: [JavaScript Warning: "Duplicate resource declaration for
'gre-resources' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/chrome/nonlocalized.manifest"
line: 27}]
console: [JavaScript Warning: "Duplicate resource declaration for
'services-sync' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/components/components.manifest"
line: 274}]
console: [JavaScript Warning: "Duplicate resource declaration for
'services-crypto' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/components/components.manifest"
line: 275}]
console: [JavaScript Warning: "Duplicate resource declaration for
'gre-resources' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/chrome/nonlocalized.manifest"
line: 27}]
console: [JavaScript Warning: "Duplicate resource declaration for
'services-sync' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/components/components.manifest"
line: 274}]
console: [JavaScript Warning: "Duplicate resource declaration for
'services-crypto' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/components/components.manifest"
line: 275}]
console: [JavaScript Warning: "Duplicate resource declaration for
'gre-resources' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/chrome/nonlocalized.manifest"
line: 27}]
console: [JavaScript Warning: "Duplicate resource declaration for
'services-sync' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/components/components.manifest"
line: 274}]
console: [JavaScript Warning: "Duplicate resource declaration for
'services-crypto' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/components/components.manifest"
line: 275}]
console: [JavaScript Warning: "Duplicate resource declaration for
'gre-resources' ignored." {file:
"jar:file:///Applications/Aurora.app/Contents/MacOS/omni.ja!/chrome/nonlocalized.manifest"
line: 27}]
Traceback (most recent call last):
File "/Users/jeff/code/jetpack/addon-sdk/bin/cfx", line 29, in <module>
cuddlefish.run()
File
"/Users/jeff/code/jetpack/addon-sdk/python-lib/cuddlefish/__init__.py",
line 518, in run
test_all(env_root, defaults=options.__dict__)
File
"/Users/jeff/code/jetpack/addon-sdk/python-lib/cuddlefish/__init__.py",
line 330, in test_all
test_all_packages(env_root, defaults)
File
"/Users/jeff/code/jetpack/addon-sdk/python-lib/cuddlefish/__init__.py",
line 390, in test_all_packages
env_root=env_root)
File
"/Users/jeff/code/jetpack/addon-sdk/python-lib/cuddlefish/__init__.py",
line 796, in run
mobile_app_name=options.mobile_app_name)
File
"/Users/jeff/code/jetpack/addon-sdk/python-lib/cuddlefish/runner.py",
line 608, in run_app
OUTPUT_TIMEOUT)
Exception: Test output exceeded timeout (60s).

Ben Bucksch

unread,
Feb 4, 2012, 10:32:51 AM2/4/12
to mozilla-la...@googlegroups.com
On 04.02.2012 15:37, Jeff Griffiths wrote:
> I found it convenient to create an executable

+1

I also have
$ cat /usr/local/bin/cfx
#!/bin/sh
/path/to/my/addon/checkout/bin/cfx
--binary=/path/to/my/own/build/of/firefox $1 $2 $3

and find that critical to use the SDK conveniently. "cfx test" for my
addon works well (so I'm fine for now), "cfx run" for apt-utils fails
with "TypeError: self[eventHandler].add is not a function"

Reply all
Reply to author
Forward
0 new messages