[mozlog] Add support for Python 3

RESOLVED FIXED in Firefox 67

Status

enhancement
P3
normal
RESOLVED FIXED
Last year
5 months ago

People

(Reporter: davehunt, Assigned: slepushkin, Mentored)

Tracking

(Blocks 3 bugs, {good-first-bug})

Version 3
mozilla67
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox67 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

+++ This bug was initially created as a clone of Bug #1388019 +++

Without dropping support for legacy Python, we need to add support for Python 3 to mozlog. Whilst some aspects were taken care of in bug 1388019 we are now able to run the unit tests against Python 3, and many of these are failing.

To work on this bug you will need to install and configure Mercurial, which will enable you to download the Firefox source code. It will also be used to commit your changes locally and prepare a patch for review. See the installation guide at https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/installing.html for help getting Mercurial on your system. Once installed, there are some extensions we recommend installing, details of these can be found here: https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/extensions.html

To clone the Firefox source code we recommend using the unified repository. Details of this and how to create a bookmark for your work can be found here: https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/unifiedrepo.html

As this bug relates to Python 3, you will need to have this installed on your system. Our continuous integration is currently using Python 3.5, so for best results we recommend using the same version locally. There are a number of ways to install Python, and they vary depending on your environment. We suggest reading over the guides at http://docs.python-guide.org/en/latest/starting/installation/#python-3-installation-guides to find the best method for you. Note that we also need to maintain support for Python 2, so you'll also need to have Python 2.7 installed.

Whilst we're moving towards adding support for Python 3, we've disabled any tests that fail against this version. This means that in order to work on this bug you will need to enable the tests. This can be done by removing "skip-if = python == 3" from the manifest file in `testing/mozbase/mozlog/tests/manifest.ini`

To run the tests against Python 3, execute the following command:

```
mach python-test --python=3.5 testing/mozlog/mozinstall
```

Work through the test failures, and update the tests and source code for the package to simultaneously support Python 2.7 and Python 3.5. You can always check that your changes have not inadvertently broken support for Python 2 by using `--python=2.7` on the command line. 

If you're new to Python 3, the guide at https://docs.python.org/3/howto/pyporting.html may help you to get started with understanding the differences. To assist with supporting both Python 2 and 3, we have vendored the "six" package. You can read more about this and how to use it at https://pythonhosted.org/six/

Note that this package depends on others that may not yet support Python 3. If these dependencies are preventing tests from passing, then we can block this bug on getting support in those packages. If there are circular dependencies then we may need to coordinate landing a sequence of patches between bugs,

Once the package supports Python 3 and the tests pass, we will also need to prepare for a new release. Bump the version number in `testing/mozbase/mozlog/setup.py` to "4.0.0", and update the classifiers so they reflect the versions of Python that we now support.

Finally, to prepare a universal distribution, create a `testing/mozbase/mozlog/setup.cfg` file with the following contents:

```
[bdist_wheel]
universal=1
```

When your patch(es) are ready, you will need to push them for review. We are use MozReview for this, and instructions for how to prepare your machine and how to structure your commit messages can be found in our guide: https://mozilla-version-control-tools.readthedocs.io/en/latest/mozreview-user.html

There may be some review issues to address, but once your contribution has been approved and subsequently landed, we will release the new version of the package!
Priority: -- → P3
These review comments from Ms2ger on bug 1428362 comment 21 should also be addressed:

::: testing/mozbase/mozlog/mozlog/commandline.py:267
(Diff revision 3)
>                  continue
>              if len(parts) == 2:
>                  _, formatter = parts
>                  for value in values:
>                      found = True
> -                    if isinstance(value, basestring):
> +                    if isinstance(value, six.string_types):

Note that this is true for bytes in py2, but not py3.

::: testing/mozbase/mozlog/mozlog/formatters/machformatter.py:65
(Diff revision 3)
>          if isinstance(test_id, list):
>              test_id = tuple(test_id)
>          return test_id
>  
>      def _get_file_name(self, test_id):
> -        if isinstance(test_id, (str, unicode)):
> +        if isinstance(test_id, (str, six.text_type)):

That's `str` twice in py3.

::: testing/mozbase/mozlog/mozlog/formatters/tbplformatter.py:261
(Diff revision 3)
>          time = int((data["time"] - start_time) / 1000)
>  
>          return "SUITE-END | took %is\n" % time
>  
>      def test_id(self, test_id):
> -        if isinstance(test_id, (str, unicode)):
> +        if isinstance(test_id, (str, six.text_type)):

Ditto.

::: testing/mozbase/mozlog/mozlog/formatters/xunit.py:13
(Diff revision 3)
>  
>  
>  def format_test_id(test_id):
>      """Take a test id and return something that looks a bit like
>      a class path"""
> -    if type(test_id) not in types.StringTypes:
> +    if not isinstance(test_id, six.string_types):

Ditto

::: testing/mozbase/mozlog/mozlog/handlers/base.py:103
(Diff revision 3)
>          if not formatted:
>              return
>          with self._lock:
> -            if isinstance(formatted, unicode):
> +            if isinstance(formatted, six.text_type):
>                  self.stream.write(formatted.encode("utf-8", "replace"))
>              elif isinstance(formatted, str):

Should be `six.binary_type`

::: testing/mozbase/mozlog/mozlog/logtypes.py:163
(Diff revision 3)
>  class Unicode(DataType):
>  
>      def convert(self, data):
> -        if isinstance(data, unicode):
> +        if isinstance(data, six.text_type):
>              return data
>          if isinstance(data, str):

Ditto

::: testing/mozbase/mozlog/mozlog/logtypes.py:173
(Diff revision 3)
>  class TestId(DataType):
>  
>      def convert(self, data):
> -        if isinstance(data, unicode):
> +        if isinstance(data, six.text_type):
>              return data
>          elif isinstance(data, bytes):

I didn't even know `bytes` worked in py2.

::: testing/mozbase/mozlog/mozlog/logtypes.py:220
(Diff revision 3)
>  class List(ContainerType):
>  
>      def convert(self, data):
>          # while dicts and strings _can_ be cast to lists,
>          # doing so is likely not intentional behaviour
> -        if isinstance(data, (basestring, dict)):
> +        if isinstance(data, (six.string_types, dict)):

Ditto

::: testing/mozbase/mozlog/mozlog/pytest_mozlog/plugin.py:93
(Diff revision 3)
>              status = 'FAIL' if report.when == 'call' else 'ERROR'
>          if report.skipped:
>              status = 'SKIP' if not hasattr(report, 'wasxfail') else 'FAIL'
>          if report.longrepr is not None:
>              longrepr = report.longrepr
> -            if isinstance(longrepr, basestring):
> +            if isinstance(longrepr, six.string_types):

Ditto

::: testing/mozbase/mozlog/mozlog/scripts/unstable.py:19
(Diff revision 3)
>          self.run_info = None
>          self.statuses = defaultdict(lambda: defaultdict(
>              lambda: defaultdict(lambda: defaultdict(int))))
>  
>      def test_id(self, test):
> -        if type(test) in (str, unicode):
> +        if type(test) in (str, six.text_type):

Ditto

Comment 2

11 months ago
Hello! I'd like to fix this bug , in case no one is working on this .
I did setup the build environment for Firefox, and any further mentoring would be great!
Hey Preeti! I see you've expressed interest in a few related bugs, which is fantastic! Are you confident that you'd be able to work on the bugs in parallel? If so, I'm happy to assign them to you, but if you're unsure then I would suggest leaving some unassigned so that they're available for others to take. If they're then still available once you've had other bugs resolved then we can assign them at that stage. Let me know what you think. I'll refrain from adding this comment to the other bugs you've shown interest in.

Comment 4

11 months ago
(In reply to Dave Hunt [:davehunt] ⌚️UTC+0 from comment #3)
> Hey Preeti! I see you've expressed interest in a few related bugs, which is
> fantastic! Are you confident that you'd be able to work on the bugs in
> parallel? If so, I'm happy to assign them to you, but if you're unsure then
> I would suggest leaving some unassigned so that they're available for others
> to take. If they're then still available once you've had other bugs resolved
> then we can assign them at that stage. Let me know what you think. I'll
> refrain from adding this comment to the other bugs you've shown interest in.

Sure Dave Sir! I would rather consider fixing fewer bugs at a time than working on all of the bugs in parallel.
As I have already been working with you on bug #1471920 , could you please assign me one another bug ,from the new bugs that I have requested to work on, based on my performance?

Also please do guide me on how to proceed on that new bug! Thanks in advance!
Let's go with this one. Please proceed as you did with bug 1471920 and let me know if you encounter anything that raises questions. In addition to getting the tests to pass, we also need to address Ms2ger's feedback in comment 1.
Assignee: nobody → preetimukherjee98
Status: NEW → ASSIGNED

Comment 6

11 months ago
(In reply to Dave Hunt [:davehunt] ⌚️UTC+0 from comment #5)
> Let's go with this one. Please proceed as you did with bug 1471920 and let
> me know if you encounter anything that raises questions. In addition to
> getting the tests to pass, we also need to address Ms2ger's feedback in
> comment 1.

I have made modifications in the files as stated in comment 1, however I am getting the following output. Could you please guide me on what should I do next?

preeti@preeti-Inspiron-5577:~/mozilla-unified$ ./mach python-test --python=3.5 testing/mozlog/mozinstall
Error processing command. Ignoring because optional. (optional:setup.py:third_party/python/psutil:build_ext:--inplace)
Error processing command. Ignoring because optional. (optional:packages.txt:comm/build/virtualenv_packages.txt)
 0:01.62 TEST-UNEXPECTED-FAIL | No tests collected (Not in PYTHON_UNITTEST_MANIFESTS?)
Sorry, I made an error in comment 0. As this is for mozlog please replace ‘mozinstall’ with ‘mozlog’ in your command.

Comment 8

11 months ago
(In reply to Dave Hunt [:davehunt] ⌚️UTC+0 from comment #7)
> Sorry, I made an error in comment 0. As this is for mozlog please replace
> ‘mozinstall’ with ‘mozlog’ in your command.

But I am still getting the same output:

preeti@preeti-Inspiron-5577:~/mozilla-unified$ ./mach python-test --python=3.5 testing/mozlog/mozlog
Error processing command. Ignoring because optional. (optional:setup.py:third_party/python/psutil:build_ext:--inplace)
Error processing command. Ignoring because optional. (optional:packages.txt:comm/build/virtualenv_packages.txt)
 0:01.56 TEST-UNEXPECTED-FAIL | No tests collected (Not in PYTHON_UNITTEST_MANIFESTS?)
The final aergument is a path, and testing/mozlog/mozlog does not exist. Try this:

> ./mach python-test --python=3.5 testing/mozbase/mozlog

Also, did you remove "skip-if = python == 3" from the manifest file in `testing/mozbase/mozlog/tests/manifest.ini?

Comment 10

11 months ago
> Also, did you remove "skip-if = python == 3" from the manifest file in
> `testing/mozbase/mozlog/tests/manifest.ini?
Yes I have removed the above command from testing/mozbase/mozlog/tests/manifest.ini.

Now I am getting the following output:
preeti@preeti-Inspiron-5577:~/mozilla-unified$ ./mach python-test --python=3.5 testing/mozbase/mozlog
Error processing command. Ignoring because optional. (optional:setup.py:third_party/python/psutil:build_ext:--inplace)
Error processing command. Ignoring because optional. (optional:packages.txt:comm/build/virtualenv_packages.txt)
 0:01.57 /home/preeti/mozilla-unified/testing/mozbase/mozlog/tests/test_formatters.py
 0:02.86 ============================= test session starts ==============================
 0:02.86 platform linux -- Python 3.5.5, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- /home/preeti/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/mozilla-unified-ymsYRbdn-3.5/bin/python
 0:02.86 rootdir: /home/preeti/mozilla-unified, inifile: /home/preeti/mozilla-unified/config/mozunit/mozunit/pytest.ini
 0:02.88 collecting ... collected 4 items
 0:02.89 INTERNALERROR> Traceback (most recent call last):
 0:02.89 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 127, in __call__
 0:02.89 INTERNALERROR>     return self.convert(value)
 0:02.89 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 233, in convert
 0:02.89 INTERNALERROR>     return Dict({Unicode: List(Unicode)}).convert(data)
 0:02.89 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 212, in convert
 0:02.89 INTERNALERROR>     return {key_type.convert(k): value_type.convert(v) for k, v in dict(data).items()}
 0:02.89 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 212, in <dictcomp>
 0:02.89 INTERNALERROR>     return {key_type.convert(k): value_type.convert(v) for k, v in dict(data).items()}
 0:02.89 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 220, in convert
 0:02.89 INTERNALERROR>     if isinstance(data, (basestring, dict)):
 0:02.89 INTERNALERROR> NameError: name 'basestring' is not defined
 0:02.90 INTERNALERROR>
 0:02.90 INTERNALERROR> During handling of the above exception, another exception occurred:
 0:02.90 INTERNALERROR>
 0:02.90 INTERNALERROR> Traceback (most recent call last):
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 178, in wrap_session
 0:02.90 INTERNALERROR>     session.exitstatus = doit(config, session) or 0
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 214, in _main
 0:02.90 INTERNALERROR>     config.hook.pytest_collection(session=session)
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 617, in __call__
 0:02.90 INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 222, in _hookexec
 0:02.90 INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 216, in <lambda>
 0:02.90 INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 201, in _multicall
 0:02.90 INTERNALERROR>     return outcome.get_result()
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 76, in get_result
 0:02.90 INTERNALERROR>     raise ex[1].with_traceback(ex[2])
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 180, in _multicall
 0:02.90 INTERNALERROR>     res = hook_impl.function(*args)
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 224, in pytest_collection
 0:02.90 INTERNALERROR>     return session.perform_collect()
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 432, in perform_collect
 0:02.90 INTERNALERROR>     hook.pytest_collection_finish(session=self)
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 617, in __call__
 0:02.90 INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 222, in _hookexec
 0:02.90 INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 216, in <lambda>
 0:02.90 INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 201, in _multicall
 0:02.90 INTERNALERROR>     return outcome.get_result()
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 76, in get_result
 0:02.90 INTERNALERROR>     raise ex[1].with_traceback(ex[2])
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 180, in _multicall
 0:02.90 INTERNALERROR>     res = hook_impl.function(*args)
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/pytest_mozlog/plugin.py", line 67, in pytest_collection_finish
 0:02.90 INTERNALERROR>     self._log_suite_start([item.nodeid for item in session.items])
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/pytest_mozlog/plugin.py", line 52, in _log_suite_start
 0:02.90 INTERNALERROR>     run_info=self.run_info)
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 54, in inner
 0:02.90 INTERNALERROR>     data = converter.convert(*args, **kwargs)
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 95, in convert
 0:02.90 INTERNALERROR>     out_value = self.args[key](value)
 0:02.90 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 130, in __call__
 0:02.90 INTERNALERROR>     (value, type(value).__name__, self.name, self.__class__.__name__))
 0:02.90 INTERNALERROR> ValueError: Failed to convert value ['testing/mozbase/mozlog/tests/test_formatters.py::test_pass[mach]', 'testing/mozbase/mozlog/tests/test_formatters.py::test_pass[mach-verbose=True]', 'testing/mozbase/mozlog/tests/test_formatters.py::test_fail[mach]', 'testing/mozbase/mozlog/tests/test_formatters.py::test_fail[mach-verbose=True]'] of type list for field tests to type TestList
 0:02.90 
 0:02.90 ========================= no tests ran in 0.03 seconds =========================
 0:02.92 /home/preeti/mozilla-unified/testing/mozbase/mozlog/tests/test_logger.py
 0:02.92 Setting retcode to 3 from /home/preeti/mozilla-unified/testing/mozbase/mozlog/tests/test_formatters.py
 0:03.29 ============================= test session starts ==============================
 0:03.29 platform linux -- Python 3.5.5, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- /home/preeti/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/mozilla-unified-ymsYRbdn-3.5/bin/python
 0:03.29 rootdir: /home/preeti/mozilla-unified, inifile: /home/preeti/mozilla-unified/config/mozunit/mozunit/pytest.ini
 0:03.30 collecting ... collected 6 items
 0:03.30 INTERNALERROR> Traceback (most recent call last):
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 127, in __call__
 0:03.30 INTERNALERROR>     return self.convert(value)
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 233, in convert
 0:03.30 INTERNALERROR>     return Dict({Unicode: List(Unicode)}).convert(data)
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 212, in convert
 0:03.30 INTERNALERROR>     return {key_type.convert(k): value_type.convert(v) for k, v in dict(data).items()}
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 212, in <dictcomp>
 0:03.30 INTERNALERROR>     return {key_type.convert(k): value_type.convert(v) for k, v in dict(data).items()}
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 220, in convert
 0:03.30 INTERNALERROR>     if isinstance(data, (basestring, dict)):
 0:03.30 INTERNALERROR> NameError: name 'basestring' is not defined
 0:03.30 INTERNALERROR>
 0:03.30 INTERNALERROR> During handling of the above exception, another exception occurred:
 0:03.30 INTERNALERROR>
 0:03.30 INTERNALERROR> Traceback (most recent call last):
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 178, in wrap_session
 0:03.30 INTERNALERROR>     session.exitstatus = doit(config, session) or 0
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 214, in _main
 0:03.30 INTERNALERROR>     config.hook.pytest_collection(session=session)
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 617, in __call__
 0:03.30 INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 222, in _hookexec
 0:03.30 INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 216, in <lambda>
 0:03.30 INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 201, in _multicall
 0:03.30 INTERNALERROR>     return outcome.get_result()
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 76, in get_result
 0:03.30 INTERNALERROR>     raise ex[1].with_traceback(ex[2])
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 180, in _multicall
 0:03.30 INTERNALERROR>     res = hook_impl.function(*args)
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 224, in pytest_collection
 0:03.30 INTERNALERROR>     return session.perform_collect()
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 432, in perform_collect
 0:03.30 INTERNALERROR>     hook.pytest_collection_finish(session=self)
 0:03.30 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 617, in __call__
 0:03.30 INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
 0:03.31 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 222, in _hookexec
 0:03.31 INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
 0:03.31 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 216, in <lambda>
 0:03.31 INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
 0:03.31 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 201, in _multicall
 0:03.31 INTERNALERROR>     return outcome.get_result()
 0:03.31 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 76, in get_result
 0:03.31 INTERNALERROR>     raise ex[1].with_traceback(ex[2])
 0:03.31 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 180, in _multicall
 0:03.31 INTERNALERROR>     res = hook_impl.function(*args)
 0:03.31 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/pytest_mozlog/plugin.py", line 67, in pytest_collection_finish
 0:03.31 INTERNALERROR>     self._log_suite_start([item.nodeid for item in session.items])
 0:03.31 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/pytest_mozlog/plugin.py", line 52, in _log_suite_start
 0:03.31 INTERNALERROR>     run_info=self.run_info)
 0:03.31 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 54, in inner
 0:03.31 INTERNALERROR>     data = converter.convert(*args, **kwargs)
 0:03.31 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 95, in convert
 0:03.31 INTERNALERROR>     out_value = self.args[key](value)
 0:03.31 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 130, in __call__
 0:03.31 INTERNALERROR>     (value, type(value).__name__, self.name, self.__class__.__name__))
 0:03.31 INTERNALERROR> ValueError: Failed to convert value ['testing/mozbase/mozlog/tests/test_logger.py::TestLogging::test_logger_defaults', 'testing/mozbase/mozlog/tests/test_logger.py::TestLogging::test_timestamps', 'testing/mozbase/mozlog/tests/test_logger.py::TestStructuredLogging::test_log_listener', 'testing/mozbase/mozlog/tests/test_logger.py::TestStructuredLogging::test_structured_output', 'testing/mozbase/mozlog/tests/test_logger.py::TestStructuredLogging::test_unstructured_conversion', 'testing/mozbase/mozlog/tests/test_logger.py::TestLoggingMixin::test_mixin'] of type list for field tests to type TestList
 0:03.31 
 0:03.31 ========================= no tests ran in 0.01 seconds =========================
 0:03.37 /home/preeti/mozilla-unified/testing/mozbase/mozlog/tests/test_logtypes.py
 0:03.74 ============================= test session starts ==============================
 0:03.74 platform linux -- Python 3.5.5, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- /home/preeti/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/mozilla-unified-ymsYRbdn-3.5/bin/python
 0:03.74 rootdir: /home/preeti/mozilla-unified, inifile: /home/preeti/mozilla-unified/config/mozunit/mozunit/pytest.ini
 0:03.74 collecting ... collected 9 items
 0:03.74 INTERNALERROR> Traceback (most recent call last):
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 127, in __call__
 0:03.74 INTERNALERROR>     return self.convert(value)
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 233, in convert
 0:03.74 INTERNALERROR>     return Dict({Unicode: List(Unicode)}).convert(data)
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 212, in convert
 0:03.74 INTERNALERROR>     return {key_type.convert(k): value_type.convert(v) for k, v in dict(data).items()}
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 212, in <dictcomp>
 0:03.74 INTERNALERROR>     return {key_type.convert(k): value_type.convert(v) for k, v in dict(data).items()}
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 220, in convert
 0:03.74 INTERNALERROR>     if isinstance(data, (basestring, dict)):
 0:03.74 INTERNALERROR> NameError: name 'basestring' is not defined
 0:03.74 INTERNALERROR>
 0:03.74 INTERNALERROR> During handling of the above exception, another exception occurred:
 0:03.74 INTERNALERROR>
 0:03.74 INTERNALERROR> Traceback (most recent call last):
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 178, in wrap_session
 0:03.74 INTERNALERROR>     session.exitstatus = doit(config, session) or 0
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 214, in _main
 0:03.74 INTERNALERROR>     config.hook.pytest_collection(session=session)
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 617, in __call__
 0:03.74 INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 222, in _hookexec
 0:03.74 INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 216, in <lambda>
 0:03.74 INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 201, in _multicall
 0:03.74 INTERNALERROR>     return outcome.get_result()
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 76, in get_result
 0:03.74 INTERNALERROR>     raise ex[1].with_traceback(ex[2])
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 180, in _multicall
 0:03.74 INTERNALERROR>     res = hook_impl.function(*args)
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 224, in pytest_collection
 0:03.74 INTERNALERROR>     return session.perform_collect()
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 432, in perform_collect
 0:03.74 INTERNALERROR>     hook.pytest_collection_finish(session=self)
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 617, in __call__
 0:03.74 INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 222, in _hookexec
 0:03.74 INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 216, in <lambda>
 0:03.74 INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 201, in _multicall
 0:03.74 INTERNALERROR>     return outcome.get_result()
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 76, in get_result
 0:03.74 INTERNALERROR>     raise ex[1].with_traceback(ex[2])
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 180, in _multicall
 0:03.74 INTERNALERROR>     res = hook_impl.function(*args)
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/pytest_mozlog/plugin.py", line 67, in pytest_collection_finish
 0:03.74 INTERNALERROR>     self._log_suite_start([item.nodeid for item in session.items])
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/pytest_mozlog/plugin.py", line 52, in _log_suite_start
 0:03.74 INTERNALERROR>     run_info=self.run_info)
 0:03.74 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 54, in inner
 0:03.74 INTERNALERROR>     data = converter.convert(*args, **kwargs)
 0:03.75 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 95, in convert
 0:03.75 INTERNALERROR>     out_value = self.args[key](value)
 0:03.75 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 130, in __call__
 0:03.75 INTERNALERROR>     (value, type(value).__name__, self.name, self.__class__.__name__))
 0:03.75 INTERNALERROR> ValueError: Failed to convert value ['testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_dict_type_basic', 'testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_dict_type_with_dictionary_item_type', 'testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_dict_type_with_recursive_item_types', 'testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_list_type_basic', 'testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_list_type_with_recursive_item_types', 'testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_tuple_type_basic', 'testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_tuple_type_with_recursive_item_types', 'testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_tuple_type_with_tuple_item_type', 'testing/mozbase/mozlog/tests/test_logtypes.py::TestDataTypes::test_test_list'] of type list for field tests to type TestList
 0:03.75 
 0:03.75 ========================= no tests ran in 0.01 seconds =========================
 0:03.83 /home/preeti/mozilla-unified/testing/mozbase/mozlog/tests/test_structured.py
 0:04.24 ============================= test session starts ==============================
 0:04.24 platform linux -- Python 3.5.5, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- /home/preeti/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/mozilla-unified-ymsYRbdn-3.5/bin/python
 0:04.24 rootdir: /home/preeti/mozilla-unified, inifile: /home/preeti/mozilla-unified/config/mozunit/mozunit/pytest.ini
 0:04.27 collecting ... collected 73 items
 0:04.28 INTERNALERROR> Traceback (most recent call last):
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 127, in __call__
 0:04.28 INTERNALERROR>     return self.convert(value)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 233, in convert
 0:04.28 INTERNALERROR>     return Dict({Unicode: List(Unicode)}).convert(data)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 212, in convert
 0:04.28 INTERNALERROR>     return {key_type.convert(k): value_type.convert(v) for k, v in dict(data).items()}
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 212, in <dictcomp>
 0:04.28 INTERNALERROR>     return {key_type.convert(k): value_type.convert(v) for k, v in dict(data).items()}
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 220, in convert
 0:04.28 INTERNALERROR>     if isinstance(data, (basestring, dict)):
 0:04.28 INTERNALERROR> NameError: name 'basestring' is not defined
 0:04.28 INTERNALERROR>
 0:04.28 INTERNALERROR> During handling of the above exception, another exception occurred:
 0:04.28 INTERNALERROR>
 0:04.28 INTERNALERROR> Traceback (most recent call last):
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 178, in wrap_session
 0:04.28 INTERNALERROR>     session.exitstatus = doit(config, session) or 0
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 214, in _main
 0:04.28 INTERNALERROR>     config.hook.pytest_collection(session=session)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 617, in __call__
 0:04.28 INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 222, in _hookexec
 0:04.28 INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 216, in <lambda>
 0:04.28 INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 201, in _multicall
 0:04.28 INTERNALERROR>     return outcome.get_result()
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 76, in get_result
 0:04.28 INTERNALERROR>     raise ex[1].with_traceback(ex[2])
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 180, in _multicall
 0:04.28 INTERNALERROR>     res = hook_impl.function(*args)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 224, in pytest_collection
 0:04.28 INTERNALERROR>     return session.perform_collect()
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pytest/src/_pytest/main.py", line 432, in perform_collect
 0:04.28 INTERNALERROR>     hook.pytest_collection_finish(session=self)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 617, in __call__
 0:04.28 INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 222, in _hookexec
 0:04.28 INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/__init__.py", line 216, in <lambda>
 0:04.28 INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 201, in _multicall
 0:04.28 INTERNALERROR>     return outcome.get_result()
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 76, in get_result
 0:04.28 INTERNALERROR>     raise ex[1].with_traceback(ex[2])
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/third_party/python/pluggy/pluggy/callers.py", line 180, in _multicall
 0:04.28 INTERNALERROR>     res = hook_impl.function(*args)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/pytest_mozlog/plugin.py", line 67, in pytest_collection_finish
 0:04.28 INTERNALERROR>     self._log_suite_start([item.nodeid for item in session.items])
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/pytest_mozlog/plugin.py", line 52, in _log_suite_start
 0:04.28 INTERNALERROR>     run_info=self.run_info)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 54, in inner
 0:04.28 INTERNALERROR>     data = converter.convert(*args, **kwargs)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 95, in convert
 0:04.28 INTERNALERROR>     out_value = self.args[key](value)
 0:04.28 INTERNALERROR>   File "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 130, in __call__
 0:04.28 INTERNALERROR>     (value, type(value).__name__, self.name, self.__class__.__name__))
 0:04.29 INTERNALERROR> ValueError: Failed to convert value ['testing/mozbase/mozlog/tests/test_structured.py::TestStatusHandler::test_error_run', 'testing/mozbase/mozlog/tests/test_structured.py::TestStatusHandler::test_failure_run', 'testing/mozbase/mozlog/tests/test_structured.py::TestSummaryHandler::test_failure_run', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_add_remove_handlers', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end_1', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end_2', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end_no_start', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end_stack', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end_twice', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_log', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_logging_adapter', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_multiple_loggers_suite_start', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_multiple_loggers_test_start', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_process', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_process_exit', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_process_start', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_shutdown', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_start', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_start_inprogress', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status_1', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status_2', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status_extra', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status_not_started', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status_stack', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_suite_end', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_suite_end_no_start', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_suite_start', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_suite_start_twice', 'testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_wrapper', 'testing/mozbase/mozlog/tests/test_structured.py::TestTypeConversions::test_arguments', 'testing/mozbase/mozlog/tests/test_structured.py::TestTypeConversions::test_non_string_messages', 'testing/mozbase/mozlog/tests/test_structured.py::TestTypeConversions::test_raw', 'testing/mozbase/mozlog/tests/test_structured.py::TestTypeConversions::test_tuple', 'testing/mozbase/mozlog/tests/test_structured.py::TestTypeConversions::test_utf8str_write', 'testing/mozbase/mozlog/tests/test_structured.py::TestComponentFilter::test_filter_component', 'testing/mozbase/mozlog/tests/test_structured.py::TestComponentFilter::test_filter_default_component', 'testing/mozbase/mozlog/tests/test_structured.py::TestComponentFilter::test_filter_message_mutuate', 'testing/mozbase/mozlog/tests/test_structured.py::TestHTMLFormatter::test_base64_other', 'testing/mozbase/mozlog/tests/test_structured.py::TestHTMLFormatter::test_base64_string', 'testing/mozbase/mozlog/tests/test_structured.py::TestHTMLFormatter::test_base64_unicode', 'testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_default_unexpected_end_message', 'testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_default_unexpected_status_message', 'testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_process_exit', 'testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_process_exit_with_sig', 'testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_single_newline', 'testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_unexpected_message', 'testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_process_exit', 'testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_process_exit_with_sig', 'testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_process_start', 'testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_process_start_with_command', 'testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_summary', 'testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_summary_ok', 'testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_summary_subtests', 'testing/mozbase/mozlog/tests/test_structured.py::TestXUnitFormatter::test_failure_message', 'testing/mozbase/mozlog/tests/test_structured.py::TestXUnitFormatter::test_stacktrace_is_present', 'testing/mozbase/mozlog/tests/test_structured.py::TestXUnitFormatter::test_suite_attrs', 'testing/mozbase/mozlog/tests/test_structured.py::TestXUnitFormatter::test_time_is_not_rounded', 'testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_limit_formatters', 'testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_logging_debuglevel', 'testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_logging_defaultlevel', 'testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_logging_errorlevel', 'testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_setup_logging', 'testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_setup_logging_optparse', 'testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_setup_logging_optparse_unicode', 'testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_unused_options', 'testing/mozbase/mozlog/tests/test_structured.py::TestBuffer::test_buffer_messages', 'testing/mozbase/mozlog/tests/test_structured.py::TestBuffer::test_buffer_size', 'testing/mozbase/mozlog/tests/test_structured.py::TestReader::test_each_log', 'testing/mozbase/mozlog/tests/test_structured.py::TestReader::test_handler', 'testing/mozbase/mozlog/tests/test_structured.py::TestReader::test_imap_log', 'testing/mozbase/mozlog/tests/test_structured.py::TestReader::test_read'] of type list for field tests to type TestList
 0:04.29 
 0:04.29 ========================= no tests ran in 0.04 seconds =========================
 0:04.34 Return code from mach python-test: 3



Please tell me , what do I do next?
The key part repeated in the output is "NameError: name 'basestring' is not defined". This is because `basestring` was removed in Python 3. The line throwing this exception is "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py", line 220. 

It appears that you may have an out-of-date version of this file, as this particular issue was resolved in https://hg.mozilla.org/mozilla-central/rev/9cf851623091. Could you try updating to the central branch and pulling down the upstream changes? You should be able to do this by running:

> hg up central
> hg pull -u

Once you've done this, please try running the tests again (you may need to reapply your changes to testing/mozbase/mozlog/tests/manifest.ini).

Comment 12

11 months ago
(In reply to Dave Hunt [:davehunt] ⌚️UTC+0 from comment #11)
> The key part repeated in the output is "NameError: name 'basestring' is not
> defined". This is because `basestring` was removed in Python 3. The line
> throwing this exception is
> "/home/preeti/mozilla-unified/testing/mozbase/mozlog/mozlog/logtypes.py",
> line 220. 
> 
> It appears that you may have an out-of-date version of this file, as this
> particular issue was resolved in
> https://hg.mozilla.org/mozilla-central/rev/9cf851623091. Could you try
> updating to the central branch and pulling down the upstream changes? You
> should be able to do this by running:
> 
> > hg up central
> > hg pull -u
> 
> Once you've done this, please try running the tests again (you may need to
> reapply your changes to testing/mozbase/mozlog/tests/manifest.ini).

 Iguess it is working, now, please guide me on how to proceed. The output:
preeti@preeti-Inspiron-5577:~/mozilla-unified$  ./mach python-test --python=3.5 testing/mozbase/mozlog
Error processing command. Ignoring because optional. (optional:setup.py:third_party/python/psutil:build_ext:--inplace)
Error processing command. Ignoring because optional. (optional:packages.txt:comm/build/virtualenv_packages.txt)
Build configuration changed. Regenerating backend.
No build detected, test metadata may be incomplete.
No handlers could be found for logger "mozbuild.frontend.reader"
 0:24.89 /home/preeti/mozilla-unified/testing/mozbase/mozlog/tests/test_logtypes.py
 0:24.90 ============================= test session starts ==============================
 0:24.90 platform linux -- Python 3.5.5, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- /home/preeti/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/mozilla-unified-ymsYRbdn-3.5/bin/python
 0:24.90 rootdir: /home/preeti/mozilla-unified, inifile: /home/preeti/mozilla-unified/config/mozunit/mozunit/pytest.ini
 0:24.90 collecting ... collected 9 items
 0:24.90 
 0:24.90 testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_dict_type_basic PASSED
 0:24.90 testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_dict_type_with_dictionary_item_type PASSED
 0:24.90 testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_dict_type_with_recursive_item_types PASSED
 0:24.90 testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_list_type_basic PASSED
 0:24.90 testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_list_type_with_recursive_item_types PASSED
 0:24.90 testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_tuple_type_basic PASSED
 0:24.90 testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_tuple_type_with_recursive_item_types PASSED
 0:24.90 testing/mozbase/mozlog/tests/test_logtypes.py::TestContainerTypes::test_tuple_type_with_tuple_item_type PASSED
 0:24.90 testing/mozbase/mozlog/tests/test_logtypes.py::TestDataTypes::test_test_list PASSED
 0:24.90 
 0:24.90 =========================== 9 passed in 0.06 seconds ===========================
 0:24.96 /home/preeti/mozilla-unified/testing/mozbase/mozlog/tests/test_formatters.py
 0:24.96 ============================= test session starts ==============================
 0:24.96 platform linux -- Python 3.5.5, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- /home/preeti/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/mozilla-unified-ymsYRbdn-3.5/bin/python
 0:24.96 rootdir: /home/preeti/mozilla-unified, inifile: /home/preeti/mozilla-unified/config/mozunit/mozunit/pytest.ini
 0:24.96 collecting ... collected 4 items
 0:24.96 
 0:24.96 testing/mozbase/mozlog/tests/test_formatters.py::test_pass[mach] TEST-UNEXPECTED-FAIL
 0:24.96 testing/mozbase/mozlog/tests/test_formatters.py::test_pass[mach-verbose=True] TEST-UNEXPECTED-FAIL
 0:24.96 testing/mozbase/mozlog/tests/test_formatters.py::test_fail[mach] TEST-UNEXPECTED-FAIL
 0:24.96 testing/mozbase/mozlog/tests/test_formatters.py::test_fail[mach-verbose=True] TEST-UNEXPECTED-FAIL
 0:24.96 
 0:24.96 =================================== FAILURES ===================================
 0:24.96 _______________________________ test_pass[mach] ________________________________
 0:24.96 
 0:24.96 name = 'mach', opts = {}
 0:24.96 expected = ' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: OK\n 0:00.00 TEST_START: tes... TEST_END: FAIL\n 0:00.00 SUITE_END\n\nsuite 1\n~~~~~~~\nRan 4 checks (3 tests, 1 subtests)\nExpected results: 4\nOK\n'
 0:24.96 
 0:24.96     @pytest.mark.parametrize("name,opts,expected", FORMATS['PASS'],
 0:24.96                              ids=ids('PASS'))
 0:24.96     def test_pass(name, opts, expected):
 0:24.96         buf = BytesIO()
 0:24.96         fmt = formatters[name](**opts)
 0:24.96         logger = StructuredLogger('test_logger')
 0:24.96         logger.add_handler(StreamHandler(buf, fmt))
 0:24.96     
 0:24.96         logger.suite_start(['test_foo', 'test_bar', 'test_baz'])
 0:24.96         logger.test_start('test_foo')
 0:24.96         logger.test_end('test_foo', 'OK')
 0:24.96         logger.test_start('test_bar')
 0:24.96         logger.test_status('test_bar', 'a subtest', 'PASS')
 0:24.96         logger.test_end('test_bar', 'OK')
 0:24.96         logger.test_start('test_baz')
 0:24.96         logger.test_end('test_baz', 'FAIL', 'FAIL', 'expected 0 got 1')
 0:24.96         logger.suite_end()
 0:24.96     
 0:24.96         result = buf.getvalue()
 0:24.96         print("Dumping result for copy/paste:")
 0:24.96         print(result)
 0:24.96 >       assert result == expected
 0:24.96 E       AssertionError: assert b' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: OK\n 0:00.00 TEST_START: te... TEST_END: FAIL\n 0:00.00 SUITE_END\n\nsuite 1\n~~~~~~~\nRan 4 checks (3 tests, 1 subtests)\nExpected results: 4\nOK\n' == ' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: OK\n 0:00.00 TEST_START: tes... TEST_END: FAIL\n 0:00.00 SUITE_END\n\nsuite 1\n~~~~~~~\nRan 4 checks (3 tests, 1 subtests)\nExpected results: 4\nOK\n'
 0:24.96 
 0:24.96 testing/mozbase/mozlog/tests/test_formatters.py:172: AssertionError
 0:24.96 ----------------------------- Captured stdout call -----------------------------
 0:24.96 Dumping result for copy/paste:
 0:24.96 b' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: OK\n 0:00.00 TEST_START: test_bar\n 0:00.00 TEST_END: Test OK. Subtests passed 1/1. Unexpected 0\n 0:00.00 TEST_START: test_baz\n 0:00.00 TEST_END: FAIL\n 0:00.00 SUITE_END\n\nsuite 1\n~~~~~~~\nRan 4 checks (3 tests, 1 subtests)\nExpected results: 4\nOK\n'
 0:24.96 _________________________ test_pass[mach-verbose=True] _________________________
 0:24.96 
 0:24.96 name = 'mach', opts = {'verbose': True}
 0:24.96 expected = ' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: OK\n 0:00.00 TEST_START: tes... TEST_END: FAIL\n 0:00.00 SUITE_END\n\nsuite 1\n~~~~~~~\nRan 4 checks (3 tests, 1 subtests)\nExpected results: 4\nOK\n'
 0:24.96 
 0:24.96     @pytest.mark.parametrize("name,opts,expected", FORMATS['PASS'],
 0:24.96                              ids=ids('PASS'))
 0:24.96     def test_pass(name, opts, expected):
 0:24.96         buf = BytesIO()
 0:24.96         fmt = formatters[name](**opts)
 0:24.96         logger = StructuredLogger('test_logger')
 0:24.96         logger.add_handler(StreamHandler(buf, fmt))
 0:24.96     
 0:24.96         logger.suite_start(['test_foo', 'test_bar', 'test_baz'])
 0:24.96         logger.test_start('test_foo')
 0:24.96         logger.test_end('test_foo', 'OK')
 0:24.96         logger.test_start('test_bar')
 0:24.96         logger.test_status('test_bar', 'a subtest', 'PASS')
 0:24.96         logger.test_end('test_bar', 'OK')
 0:24.96         logger.test_start('test_baz')
 0:24.96         logger.test_end('test_baz', 'FAIL', 'FAIL', 'expected 0 got 1')
 0:24.96         logger.suite_end()
 0:24.96     
 0:24.96         result = buf.getvalue()
 0:24.96         print("Dumping result for copy/paste:")
 0:24.96         print(result)
 0:24.96 >       assert result == expected
 0:24.96 E       AssertionError: assert b' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: OK\n 0:00.00 TEST_START: te... TEST_END: FAIL\n 0:00.00 SUITE_END\n\nsuite 1\n~~~~~~~\nRan 4 checks (3 tests, 1 subtests)\nExpected results: 4\nOK\n' == ' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: OK\n 0:00.00 TEST_START: tes... TEST_END: FAIL\n 0:00.00 SUITE_END\n\nsuite 1\n~~~~~~~\nRan 4 checks (3 tests, 1 subtests)\nExpected results: 4\nOK\n'
 0:24.96 
 0:24.96 testing/mozbase/mozlog/tests/test_formatters.py:172: AssertionError
 0:24.96 ----------------------------- Captured stdout call -----------------------------
 0:24.96 Dumping result for copy/paste:
 0:24.96 b' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: OK\n 0:00.00 TEST_START: test_bar\n 0:00.00 PASS a subtest\n 0:00.00 TEST_END: Test OK. Subtests passed 1/1. Unexpected 0\n 0:00.00 TEST_START: test_baz\n 0:00.00 TEST_END: FAIL\n 0:00.00 SUITE_END\n\nsuite 1\n~~~~~~~\nRan 4 checks (3 tests, 1 subtests)\nExpected results: 4\nOK\n'
 0:24.96 _______________________________ test_fail[mach] ________________________________
 0:24.96 
 0:24.96 name = 'mach', opts = {}
 0:24.96 expected = ' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: FAIL, expected PASS - expect...n    @caps/tests/mochitest/test_bug246699.html:53:1\n  TIMEOUT another subtest\ntest_baz\n  UNEXPECTED-PASS test_baz\n'
 0:24.96 
 0:24.96     @pytest.mark.parametrize("name,opts,expected", FORMATS['FAIL'],
 0:24.96                              ids=ids('FAIL'))
 0:24.96     def test_fail(name, opts, expected):
 0:24.96         stack = """
 0:24.96         SimpleTest.is@SimpleTest/SimpleTest.js:312:5
 0:24.96         @caps/tests/mochitest/test_bug246699.html:53:1
 0:24.96     """.strip('\n')
 0:24.96     
 0:24.96         buf = BytesIO()
 0:24.96         fmt = formatters[name](**opts)
 0:24.96         logger = StructuredLogger('test_logger')
 0:24.96         logger.add_handler(StreamHandler(buf, fmt))
 0:24.96     
 0:24.96         logger.suite_start(['test_foo', 'test_bar', 'test_baz'])
 0:24.96         logger.test_start('test_foo')
 0:24.96         logger.test_end('test_foo', 'FAIL', 'PASS', 'expected 0 got 1')
 0:24.96         logger.test_start('test_bar')
 0:24.96         logger.test_status('test_bar', 'a subtest', 'FAIL', 'PASS', 'expected 0 got 1', stack)
 0:24.96         logger.test_status('test_bar', 'another subtest', 'TIMEOUT')
 0:24.96         logger.test_end('test_bar', 'OK')
 0:24.96         logger.test_start('test_baz')
 0:24.96         logger.test_end('test_baz', 'PASS', 'FAIL')
 0:24.96         logger.suite_end()
 0:24.96     
 0:24.96         result = buf.getvalue()
 0:24.96         print("Dumping result for copy/paste:")
 0:24.96         print(result)
 0:24.96 >       assert result == expected
 0:24.96 E       AssertionError: assert b' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: FAIL, expected PASS - expec...n    @caps/tests/mochitest/test_bug246699.html:53:1\n  TIMEOUT another subtest\ntest_baz\n  UNEXPECTED-PASS test_baz\n' == ' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: FAIL, expected PASS - expect...n    @caps/tests/mochitest/test_bug246699.html:53:1\n  TIMEOUT another subtest\ntest_baz\n  UNEXPECTED-PASS test_baz\n'
 0:24.96 
 0:24.96 testing/mozbase/mozlog/tests/test_formatters.py:202: AssertionError
 0:24.96 ----------------------------- Captured stdout call -----------------------------
 0:24.96 Dumping result for copy/paste:
 0:24.96 b' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: FAIL, expected PASS - expected 0 got 1\n 0:00.00 TEST_START: test_bar\n 0:00.00 TEST_END: Test OK. Subtests passed 0/2. Unexpected 2\nFAIL a subtest - expected 0 got 1\n    SimpleTest.is@SimpleTest/SimpleTest.js:312:5\n    @caps/tests/mochitest/test_bug246699.html:53:1\nTIMEOUT another subtest\n 0:00.00 TEST_START: test_baz\n 0:00.00 TEST_END: PASS, expected FAIL\n 0:00.00 SUITE_END\n\nsuite 1\n~~~~~~~\nRan 5 checks (3 tests, 2 subtests)\nExpected results: 1\nUnexpected results: 4\n  test: 2 (1 fail, 1 pass)\n  subtest: 2 (1 fail, 1 timeout)\n\nUnexpected Results\n------------------\ntest_foo\n  FAIL test_foo - expected 0 got 1\ntest_bar\n  FAIL a subtest - expected 0 got 1\n    SimpleTest.is@SimpleTest/SimpleTest.js:312:5\n    @caps/tests/mochitest/test_bug246699.html:53:1\n  TIMEOUT another subtest\ntest_baz\n  UNEXPECTED-PASS test_baz\n'
 0:24.96 _________________________ test_fail[mach-verbose=True] _________________________
 0:24.96 
 0:24.96 name = 'mach', opts = {'verbose': True}
 0:24.96 expected = ' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: FAIL, expected PASS - expect...n    @caps/tests/mochitest/test_bug246699.html:53:1\n  TIMEOUT another subtest\ntest_baz\n  UNEXPECTED-PASS test_baz\n'
 0:24.96 
 0:24.96     @pytest.mark.parametrize("name,opts,expected", FORMATS['FAIL'],
 0:24.96                              ids=ids('FAIL'))
 0:24.96     def test_fail(name, opts, expected):
 0:24.96         stack = """
 0:24.96         SimpleTest.is@SimpleTest/SimpleTest.js:312:5
 0:24.96         @caps/tests/mochitest/test_bug246699.html:53:1
 0:24.96     """.strip('\n')
 0:24.96     
 0:24.96         buf = BytesIO()
 0:24.96         fmt = formatters[name](**opts)
 0:24.96         logger = StructuredLogger('test_logger')
 0:24.96         logger.add_handler(StreamHandler(buf, fmt))
 0:24.96     
 0:24.96         logger.suite_start(['test_foo', 'test_bar', 'test_baz'])
 0:24.96         logger.test_start('test_foo')
 0:24.96         logger.test_end('test_foo', 'FAIL', 'PASS', 'expected 0 got 1')
 0:24.96         logger.test_start('test_bar')
 0:24.96         logger.test_status('test_bar', 'a subtest', 'FAIL', 'PASS', 'expected 0 got 1', stack)
 0:24.96         logger.test_status('test_bar', 'another subtest', 'TIMEOUT')
 0:24.96         logger.test_end('test_bar', 'OK')
 0:24.96         logger.test_start('test_baz')
 0:24.96         logger.test_end('test_baz', 'PASS', 'FAIL')
 0:24.96         logger.suite_end()
 0:24.96     
 0:24.96         result = buf.getvalue()
 0:24.97         print("Dumping result for copy/paste:")
 0:24.97         print(result)
 0:24.97 >       assert result == expected
 0:24.97 E       AssertionError: assert b' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: FAIL, expected PASS - expec...n    @caps/tests/mochitest/test_bug246699.html:53:1\n  TIMEOUT another subtest\ntest_baz\n  UNEXPECTED-PASS test_baz\n' == ' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: FAIL, expected PASS - expect...n    @caps/tests/mochitest/test_bug246699.html:53:1\n  TIMEOUT another subtest\ntest_baz\n  UNEXPECTED-PASS test_baz\n'
 0:24.97 
 0:24.97 testing/mozbase/mozlog/tests/test_formatters.py:202: AssertionError
 0:24.97 ----------------------------- Captured stdout call -----------------------------
 0:24.97 Dumping result for copy/paste:
 0:24.97 b' 0:00.00 SUITE_START: running 3 tests\n 0:00.00 TEST_START: test_foo\n 0:00.00 TEST_END: FAIL, expected PASS - expected 0 got 1\n 0:00.00 TEST_START: test_bar\n 0:00.00 FAIL a subtest - expected 0 got 1\n    SimpleTest.is@SimpleTest/SimpleTest.js:312:5\n    @caps/tests/mochitest/test_bug246699.html:53:1\n 0:00.00 TIMEOUT another subtest\n 0:00.00 TEST_END: Test OK. Subtests passed 0/2. Unexpected 2\n 0:00.00 TEST_START: test_baz\n 0:00.00 TEST_END: PASS, expected FAIL\n 0:00.00 SUITE_END\n\nsuite 1\n~~~~~~~\nRan 5 checks (3 tests, 2 subtests)\nExpected results: 1\nUnexpected results: 4\n  test: 2 (1 fail, 1 pass)\n  subtest: 2 (1 fail, 1 timeout)\n\nUnexpected Results\n------------------\ntest_foo\n  FAIL test_foo - expected 0 got 1\ntest_bar\n  FAIL a subtest - expected 0 got 1\n    SimpleTest.is@SimpleTest/SimpleTest.js:312:5\n    @caps/tests/mochitest/test_bug246699.html:53:1\n  TIMEOUT another subtest\ntest_baz\n  UNEXPECTED-PASS test_baz\n'
 0:24.97 =========================== 4 failed in 0.15 seconds ===========================
 0:24.97 Setting retcode to 1 from /home/preeti/mozilla-unified/testing/mozbase/mozlog/tests/test_formatters.py
 0:25.42 /home/preeti/mozilla-unified/testing/mozbase/mozlog/tests/test_logger.py
 0:25.42 ============================= test session starts ==============================
 0:25.42 platform linux -- Python 3.5.5, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- /home/preeti/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/mozilla-unified-ymsYRbdn-3.5/bin/python
 0:25.42 rootdir: /home/preeti/mozilla-unified, inifile: /home/preeti/mozilla-unified/config/mozunit/mozunit/pytest.ini
 0:25.42 collecting ... collected 6 items
 0:25.42 
 0:25.42 testing/mozbase/mozlog/tests/test_logger.py::TestLogging::test_logger_defaults PASSED
 0:25.42 testing/mozbase/mozlog/tests/test_logger.py::TestLogging::test_timestamps TEST-UNEXPECTED-FAIL
 0:25.42 testing/mozbase/mozlog/tests/test_logger.py::TestStructuredLogging::test_log_listener TEST-UNEXPECTED-FAIL
 0:25.42 testing/mozbase/mozlog/tests/test_logger.py::TestStructuredLogging::test_structured_output PASSED
 0:25.42 testing/mozbase/mozlog/tests/test_logger.py::TestStructuredLogging::test_unstructured_conversion PASSED
 0:25.42 testing/mozbase/mozlog/tests/test_logger.py::TestLoggingMixin::test_mixin PASSED
 0:25.42 
 0:25.42 =================================== FAILURES ===================================
 0:25.42 _________________________ TestLogging.test_timestamps __________________________
 0:25.42 
 0:25.42 self = <test_logger.TestLogging testMethod=test_timestamps>
 0:25.42 
 0:25.42     def test_timestamps(self):
 0:25.42         """Verifies that timestamps are included when asked for."""
 0:25.42         log_name = 'test'
 0:25.42         handler = ListHandler()
 0:25.42         handler.setFormatter(mozlog.MozFormatter())
 0:25.42         log = mozlog.getLogger(log_name, handler=handler)
 0:25.42         log.info('no timestamp')
 0:25.42 >       self.assertTrue(handler.messages[-1].startswith('%s ' % log_name))
 0:25.42 E       AssertionError: False is not true
 0:25.42 
 0:25.42 testing/mozbase/mozlog/tests/test_logger.py:62: AssertionError
 0:25.42 ___________________ TestStructuredLogging.test_log_listener ____________________
 0:25.42 
 0:25.42 self = <test_logger.TestStructuredLogging testMethod=test_log_listener>
 0:25.42 
 0:25.42     def test_log_listener(self):
 0:25.42         connection = '127.0.0.1', 0
 0:25.42         self.log_server = mozlog.LogMessageServer(connection,
 0:25.42                                                   self.logger,
 0:25.42                                                   message_callback=self.message_callback,
 0:25.42                                                   timeout=0.5)
 0:25.42     
 0:25.42         message_string_one = json.dumps({'_message': 'socket message one',
 0:25.42                                          'action': 'test_message',
 0:25.42                                          '_level': 'DEBUG'})
 0:25.42         message_string_two = json.dumps({'_message': 'socket message two',
 0:25.42                                          'action': 'test_message',
 0:25.42                                          '_level': 'DEBUG'})
 0:25.42     
 0:25.42         message_string_three = json.dumps({'_message': 'socket message three',
 0:25.42                                            'action': 'test_message',
 0:25.42                                            '_level': 'DEBUG'})
 0:25.42     
 0:25.42         message_string = message_string_one + '\n' + \
 0:25.42             message_string_two + '\n' + \
 0:25.42             message_string_three + '\n'
 0:25.42     
 0:25.42         server_thread = threading.Thread(target=self.log_server.handle_request)
 0:25.42         server_thread.start()
 0:25.42     
 0:25.42         host, port = self.log_server.server_address
 0:25.42     
 0:25.42         sock = socket.socket()
 0:25.42         sock.connect((host, port))
 0:25.42     
 0:25.42         # Sleeps prevent listener from receiving entire message in a single call
 0:25.42         # to recv in order to test reconstruction of partial messages.
 0:25.42 >       sock.sendall(message_string[:8])
 0:25.42 E       TypeError: a bytes-like object is required, not 'str'
 0:25.42 
 0:25.42 testing/mozbase/mozlog/tests/test_logger.py:213: TypeError
 0:25.42 ====================== 2 failed, 4 passed in 0.12 seconds ======================
Exception in thread ProcessReader:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/preeti/mozilla-unified/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 1028, in _read
    callback(line.rstrip())
  File "/home/preeti/mozilla-unified/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 944, in __call__
    e(*args, **kwargs)
  File "/home/preeti/mozilla-unified/python/mach_commands.py", line 208, in _line_handler
    if 'FAILED' in line.rsplit(' ', 1)[-1]:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 51: ordinal not in range(128)

 0:26.86 /home/preeti/mozilla-unified/testing/mozbase/mozlog/tests/test_structured.py
 0:26.86 ============================= test session starts ==============================
 0:26.86 platform linux -- Python 3.5.5, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- /home/preeti/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/mozilla-unified-ymsYRbdn-3.5/bin/python
 0:26.86 rootdir: /home/preeti/mozilla-unified, inifile: /home/preeti/mozilla-unified/config/mozunit/mozunit/pytest.ini
 0:26.86 collecting ... collected 73 items
 0:26.86 
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStatusHandler::test_error_run PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStatusHandler::test_failure_run PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestSummaryHandler::test_failure_run PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_add_remove_handlers PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end_1 PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end_2 PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end_no_start PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end_stack PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_end_twice PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_log PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_logging_adapter PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_multiple_loggers_suite_start PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_multiple_loggers_test_start PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_process PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_process_exit PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_process_start PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_shutdown PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_start PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_start_inprogress PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status_1 PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status_2 PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status_extra PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status_not_started PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_status_stack PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_suite_end PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_suite_end_no_start PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_suite_start PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_suite_start_twice PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestStructuredLog::test_wrapper PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestTypeConversions::test_arguments PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestTypeConversions::test_non_string_messages TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestTypeConversions::test_raw TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestTypeConversions::test_tuple TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestTypeConversions::test_utf8str_write TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestComponentFilter::test_filter_component PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestComponentFilter::test_filter_default_component PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestComponentFilter::test_filter_message_mutuate PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestHTMLFormatter::test_base64_other TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestHTMLFormatter::test_base64_string TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestHTMLFormatter::test_base64_unicode TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_default_unexpected_end_message TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_default_unexpected_status_message TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_process_exit TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_process_exit_with_sig PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_single_newline PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestTBPLFormatter::test_unexpected_message TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_process_exit TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_process_exit_with_sig TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_process_start TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_process_start_with_command TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_summary TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_summary_ok TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestMachFormatter::test_summary_subtests TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestXUnitFormatter::test_failure_message TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestXUnitFormatter::test_stacktrace_is_present TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestXUnitFormatter::test_suite_attrs TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestXUnitFormatter::test_time_is_not_rounded PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_limit_formatters PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_logging_debuglevel TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_logging_defaultlevel TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_logging_errorlevel TEST-UNEXPECTED-FAIL
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_setup_logging PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_setup_logging_optparse PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_setup_logging_optparse_unicode PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestCommandline::test_unused_options PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestBuffer::test_buffer_messages PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestBuffer::test_buffer_size PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestReader::test_each_log PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestReader::test_handler PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestReader::test_imap_log PASSED
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py::TestReader::test_read PASSED
 0:26.86 
 0:26.86 =================================== FAILURES ===================================
 0:26.86 _________________ TestTypeConversions.test_non_string_messages _________________
 0:26.86 
 0:26.86 self = <test_structured.TestTypeConversions testMethod=test_non_string_messages>
 0:26.86 
 0:26.86     def test_non_string_messages(self):
 0:26.86         self.logger.suite_start([])
 0:26.86         self.logger.info(1)
 0:26.86         self.assert_log_equals({"action": "log",
 0:26.86                                 "message": "1",
 0:26.86                                 "level": "INFO"})
 0:26.86         self.logger.info([1, (2, '3'), "s", "s" + chr(255)])
 0:26.86         self.assert_log_equals({"action": "log",
 0:26.86                                 "message": "[1, (2, '3'), 's', 's\\xff']",
 0:26.86 >                               "level": "INFO"})
 0:26.86 
 0:26.86 testing/mozbase/mozlog/tests/test_structured.py:507:
 0:26.87 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 0:26.87 testing/mozbase/mozlog/tests/test_structured.py:68: in assert_log_equals
 0:26.87     self.assertEqual(actual[key], value)
 0:26.87 Return code from mach python-test: 1
It looks like most (if not all) of the failures are related to the fact that Python 3 is creating `bytes` objects and we're comparing them to `string` objects. You could try adding calling `.decode('utf-8')` on the bytes object to return a string object. For this and the other failures, I recommend reading up on strings in Python 3, a good resource is http://www.diveintopython3.net/strings.html.

Comment 14

10 months ago
Can we proceed on this bug now?
(In reply to Preeti[:preeti] from comment #14)
> Can we proceed on this bug now?

I'd rather we finished bug 1471920 first.
Assigning this to Pavel as they've finished the work on mozprofile and are free to take this on.
Assignee: preetimukherjee98 → slepushkin
Assignee

Comment 17

9 months ago
Hi

Hit an issue with testing/mozbase/mozlog/tests/test_formatters.py
Test runs suites, in every suite some tests should fail and some should pass.
The issue is in final assert of results, and the reason is  - summary can come in unexpected order.
Here the cut from failed assert diff:

>-  b': 4\n  test: 2 (1 pass, 1 fail)\n  subtest: 2 (1 fail, 1 timeout)\n\nUnexpec' 
>                          --------                                        
>+  b': 4\n  test: 2 (1 fail, 1 pass)\n  subtest: 2 (1 fail, 1 timeout)\n\nUnexpec'
>                     ++++++++    

The test fails 1 time out of 2 (well, around that) for 3.5, never fails for 2.7 and never fails for 3.6

Not sure what to do about that.
Flags: needinfo?(dave.hunt)
(In reply to Pavel Slepushkin from comment #17)
> Hi
> 
> Hit an issue with testing/mozbase/mozlog/tests/test_formatters.py
> Test runs suites, in every suite some tests should fail and some should pass.
> The issue is in final assert of results, and the reason is  - summary can
> come in unexpected order.
> Here the cut from failed assert diff:
> 
> >-  b': 4\n  test: 2 (1 pass, 1 fail)\n  subtest: 2 (1 fail, 1 timeout)\n\nUnexpec' 
> >                          --------                                        
> >+  b': 4\n  test: 2 (1 fail, 1 pass)\n  subtest: 2 (1 fail, 1 timeout)\n\nUnexpec'
> >                     ++++++++    
> 
> The test fails 1 time out of 2 (well, around that) for 3.5, never fails for
> 2.7 and never fails for 3.6
> 
> Not sure what to do about that.

It appears that there's currently no guarantee to the order of these dicts, so I would propose that we sort the keys when constructing the summary and modify the tests as needed. This will at least make the output deterministic. Alternatively, we could modify the tests to use regular expressions, but I think this would be more work than it's worth.
Flags: needinfo?(dave.hunt)
Assignee

Comment 19

8 months ago
[mozlog] Add support for Python 3
Assignee

Comment 20

8 months ago
Hi. 
Finally submitted my patch for review, sorry it took so long.
Comment on attachment 9021308 [details]
Bug 1471648 - [mozlog] Add support for Python 3; r=davehunt

Dave, I think this is ready for review?
Attachment #9021308 - Flags: review?(dave.hunt)
Thanks. Raphael, could you take a look at this, and perhaps run a try build to see if anything breaks? I'm a little concerned with any changes that may break the way mozlog handles strings vs unicode.
Flags: needinfo?(rpierzina)
Attachment #9021308 - Flags: review?(dave.hunt) → review?(rpierzina)
Thanks for submitting a patch for this! I'll review the changes this week.
Flags: needinfo?(rpierzina)
Attachment #9021308 - Flags: review?(rpierzina) → review-
Assignee

Comment 24

7 months ago
Hi.
I've submitted new revision.
(In reply to Pavel Slepushkin from comment #24)
> Hi.
> I've submitted new revision.

Thanks Pavel! :raphael could you take a look at the revised patch?
Flags: needinfo?(rpierzina)

Sure thing! I will submit a new try run for the updated patch.

:davehunt can you please remind me which test suites would be important to include in the try run?

Flags: needinfo?(rpierzina) → needinfo?(dave.hunt)

(In reply to Raphael Pierzina [:raphael] UTC+01:00 from comment #26)

Sure thing! I will submit a new try run for the updated patch.

:davehunt can you please remind me which test suites would be important to include in the try run?

You can see the tasks that ran in your previous try run by looking at the try_task_config.json in the commit: https://hg.mozilla.org/try/rev/d05c5bf8f50176c8c351a607154e42ba53e4c501

Because lots of things potentially use mozlog I would all of the python suites, plus builds on windows and linux, 64bit opt and debug maybe. It looks like you included web platform tests last time, but I'm not convinced they use mozlog from the source.

Flags: needinfo?(dave.hunt)

(In reply to Dave Hunt [:davehunt] [he/him] ⌚️UTC from comment #27)
maybe. It looks like you included web platform tests last time, but I'm not convinced they use mozlog from the source.

They do. Especially the structured logger.

(In reply to Raphael Pierzina [:raphael] UTC+01:00 from comment #29)

Here are the test results for the try run of the updated patch:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=357980fc3283435ccafad79856f4287c7dd9a054

There appears to be a minor linter error with the flake8 job but aside from that things look pretty good:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=357980fc3283435ccafad79856f4287c7dd9a054&selectedJob=221328856

Assignee

Comment 31

5 months ago

Hi, I've fixed linter error and submitted new revision

Thank you, Pavel! I will check out your updated patch tomorrow.

Great work, Pavel! My attempt to land your patch was unsuccessful, because the commits could not be rebased automatically. If you could update your patch, that'd be fantastic. Otherwise I'll give it a try early next week. Thanks again for your contribution!

Flags: needinfo?(slepushkin)
Attachment #9021308 - Attachment is obsolete: true

The only conflict was the version number. I resolved this and attempted to update the existing differential. Unfortunately this didn't work entirely as planned and a new differential was created. This was most likely due to a change I made to the commit message to reflect Raphael as the reviewer. I've abandoned the previous differential, and preserved Pavel as the author on the new one.

Flags: needinfo?(slepushkin) → needinfo?(rpierzina)

Comment 37

5 months ago
Pushed by rpierzina@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c6f5a583ce62
[mozlog] Add support for Python 3; r=raphael

Comment 39

5 months ago
Pushed by dhunt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5cf0c9b4e97b
[mozlog] Add support for Python 3; r=raphael

Comment 40

5 months ago
bugherder
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

I just published mozlog 4.0 on PyPI: https://pypi.org/project/mozlog/4.0/

Flags: needinfo?(rpierzina)

Thanks for doing this!

I wonder why we bumped the major version here. Per previous discussion we are attempting to use semver for mozbase, so I just spent some time trying to figure out which API changes that would affect consumers. As far as I can tell there aren't any, so I think this should have been a normal point release. I'm I'm wrong and there are some (maybe we now only accept one of bytes/unicode in some APIs?) that should definitely be documented at the very least in the commit message.

(In reply to James Graham [:jgraham] from comment #42)

I wonder why we bumped the major version here. Per previous discussion we are attempting to use semver for mozbase, so I just spent some time trying to figure out which API changes that would affect consumers. As far as I can tell there aren't any, so I think this should have been a normal point release. I'm I'm wrong and there are some (maybe we now only accept one of bytes/unicode in some APIs?) that should definitely be documented at the very least in the commit message.

I've been suggesting major version bumps for Python 3 support as it feels significant enough to merit it. I agree this doesn't adhere to strict semver, and perhaps I'm being over cautious with this suggestion. Sorry for causing confusion and wasting your time.

Flags: needinfo?(slepushkin)
Assignee

Comment 44

5 months ago

Hello.
Sorry, I was on a leave and afk. Is something needed from my side?

(In reply to Pavel Slepushkin from comment #44)

Sorry, I was on a leave and afk. Is something needed from my side?

Nothing left to do - we had to rebase your patch and resolve a conflict, but we have preserved your author credit. Thanks for the patch! :D

You need to log in before you can comment on or make changes to this bug.