NameError: name 'distro' is not defined when running jstests on linux
Categories
(Testing :: Mozbase, defect, P3)
Tracking
(firefox-esr68 unaffected, firefox70 unaffected, firefox71 unaffected, firefox72 fixed)
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox70 | --- | unaffected |
firefox71 | --- | unaffected |
firefox72 | --- | fixed |
People
(Reporter: jonco, Assigned: egao)
References
(Regression)
Details
(Keywords: regression)
I get the following error when trying to run jstests on the JS shell. This seems to be caused by changes to testing/mozbase/mozinfo/mozinfo/mozinfo.py in bug 1212502.
Traceback (most recent call last):
File "tests/jstests.py", line 584, in <module>
sys.exit(main())
File "tests/jstests.py", line 545, in main
test_count, test_gen = load_tests(options, requested_paths, excluded_paths)
File "tests/jstests.py", line 466, in load_tests
excluded_paths)
File "tests/jstests.py", line 381, in load_wpt_tests
run_info_extras = products.load_product(kwargs["config"], "firefox")[-1](**kwargs)
File "/home/jon/clone/bug/testing/web-platform/tests/tools/wptrunner/wptrunner/products.py", line 53, in load_product
rv = Product(config, product)
File "/home/jon/clone/bug/testing/web-platform/tests/tools/wptrunner/wptrunner/products.py", line 33, in __init__
module = product_module(config, product)
File "/home/jon/clone/bug/testing/web-platform/tests/tools/wptrunner/wptrunner/products.py", line 23, in product_module
module = importlib.import_module("wptrunner.browsers." + product)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/jon/clone/bug/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py", line 8, in <module>
import mozinfo
File "/home/jon/clone/bug/testing/mozbase/mozinfo/mozinfo/__init__.py", line 57, in <module>
from . import mozinfo
File "/home/jon/clone/bug/testing/mozbase/mozinfo/mozinfo/mozinfo.py", line 110, in <module>
if hasattr(distro, "linux_distribution"):
NameError: name 'distro' is not defined
Assignee | ||
Comment 1•5 years ago
|
||
I found that either installing distro
or pip install mozinfo
(if not already installed in your current environment) or pip install -U mozinfo
(if already installed using pip in your environment) resolved any missing dependencies for me.
Please note that mozinfo
version was bumped to 1.2.0 on pypi so the upgrade flag should pick it up.
Assignee | ||
Comment 2•5 years ago
|
||
I can't get a non-artifact build running on my debian 10 VM, so I can't test if jstests
does something unexpected.
On my local macosx1014 machine, when I run ./mach jstests
it doesn't seem to create a virutalenv for subsequent commands to be run inside. That might explain why the exception is thrown.
Assignee | ||
Comment 3•5 years ago
|
||
I've filed bug 1595220 and put up a patch there that should streamline how mozinfo
detects Linux distributions.
The change should also suppress this exception as long as user is using python <= 3.7 (where platform.linux_distribution()
call exists).
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
:jonco - once you pull the newer mozilla-central, could you please confirm if that fixes the issue?
Assignee | ||
Updated•5 years ago
|
Reporter | ||
Comment 5•5 years ago
|
||
This is working again now. Thanks for fixing.
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•2 years ago
|
Description
•