gecko-dev/testing/mozbase
Anjana Vakil 4168a526cd Bug 1285299 - Add pytest_mozlog plugin to mozlog; r=jgraham
Add the `pytest_mozlog` module (from https://github.com/davehunt/pytest-mozlog)
to mozbase/mozlog/mozlog, so that we can use it in the logging of the
Marionette harness tests.

Add an entry point for the plugin to mozlog/setup.py so that
when mozlog is installed, pytest will register the pytest_mozlog
plugin.py module as the plugin 'mozlog'.


Make the following modifications to pytest_mozlog/plugin.py:

- Disable stdout logging by default in pytest-mozlog

  In the pytest-mozlog plugin, disable logging to stdout by
  default when setting up the mozlog logger, so that the
  default output seen when using the plugin is just the
  Pytest terminal output. The user can specify a mozlog
  logger to write to stdout by using the '--log-* -' option,
  in which case both Pytest and pytest-mozlog will log to stdout.

- Record error msg and lineno in pytest-mozlog logs

  Extract the error message and line number for tests with failures/
  errors from the Pytest test report, and pass these to the Mozlog
  logs output by the pytest-mozlog plugin. For skipped tests,
  pass the skip reason, and for unexpected passes allow Mozlog to
  report its default message "expected FAIL".

- Report collected item count in pytest-mozlog

  Add/modify Pytest hooks in the pytest-mozlog plugin so that the
  suite_start event sent to the logger contains the correct list
  of tests to be run, i.e. items collected by Pytest, instead
  of an empty list. This allows mozlog to log the correct number
  of tests to be run.

- Log skipped/xfailed tests with corresponding status (not 'PASS')

  Log skipped tests with status 'SKIP' and expected failures
  that do indeed fail with status 'FAIL'/expected 'FAIL'
  so that these can be distinguished from true passing tests.

- Pass parsed arguments directly to mozlog.commandline.setup_logging

  Pass the entire Pytest config's argument namespace to `setup_logging`
  instead of copying over only the non-None formatters/formatter option
  arguments. Use the new `allow_unused_options` parameter to stop
  Mozlog from raising an error about options for unused formatters.

MozReview-Commit-ID: 4WpprytS5cI

--HG--
extra : rebase_source : 409de7a89e860471870e3adfd7634bc06f6e1873
2016-09-08 11:43:11 +02:00
..
docs Backed out changeset 200da85932e9 (bug 1230862) for valgrind perma failures 2016-02-10 11:04:50 +01:00
manifestparser Bug 1296735 - [manifestparser] pathprefix filter should use absolute paths if the filter is also absolute, r=jmaher 2016-08-22 13:31:56 -04:00
mozcrash Bug 1274395 - Delete pending crash reports before running tests; r=jmaher 2016-05-25 14:48:42 -06:00
mozdebug Bug 1282184 - Use lldb from Xcode install rather than system install if possible. r=ted 2016-06-28 11:50:16 -07:00
mozdevice Bug 1300163 - Add a --adbpath argument to mochitest Android to allow explicitly setting the adb binary, r=gbrown 2016-09-02 14:26:16 -04:00
mozfile Bug 1287496 - Increment sleep timespan by (attempts * delay) seconds. r=ted 2016-07-18 18:12:01 +01:00
mozhttpd Bug 1257510 - Use modern exception syntax in mozbase; r=ahal 2016-03-18 09:03:25 +01:00
mozinfo Bug 1270082 - mozinfo: Use the kernel version if the distribution is not supported by python platform function. r=gps 2016-05-27 14:50:03 +00:00
mozinstall
mozleak Bug 1227347, part 3 - Remove object-count leak suppression infrastructure. r=erahm 2016-04-26 11:46:28 -07:00
mozlog Bug 1285299 - Add pytest_mozlog plugin to mozlog; r=jgraham 2016-09-08 11:43:11 +02:00
moznetwork
mozprocess Bug 1176758 - Release mozprocess 0.23 and mozrunner 6.12. r=ahal 2016-06-30 16:45:21 +02:00
mozprofile Bug 1284887 - Replaced references to mxr.mozilla.org in the codebase with dxr.mozilla.org r=dolske 2016-08-15 17:28:05 -07:00
mozrunner Bug 1284874 - Represent am command as one string in FennecRunner; r=ahal 2016-07-25 20:40:36 -04:00
mozscreenshot
mozsystemmonitor Bug 1272782 - Bump mozsystemmonitor version to 0.3; r=ahal 2016-05-13 14:11:40 -07:00
moztest
mozversion
README.md
moz.build Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
packages.txt Backed out changeset 200da85932e9 (bug 1230862) for valgrind perma failures 2016-02-10 11:04:50 +01:00
setup_development.py
test-manifest.ini Backed out changeset 200da85932e9 (bug 1230862) for valgrind perma failures 2016-02-10 11:04:50 +01:00
test.py
versioninfo.py

README.md

Mozbase

Mozbase is a set of easy-to-use Python packages forming a supplemental standard library for Mozilla. It provides consistency and reduces redundancy in automation and other system-level software. All of Mozilla's test harnesses use mozbase to some degree, including Talos, mochitest, reftest, Autophone, and Eideticker.

Learn more about mozbase at the project page.

Read detailed docs online, or build them locally by running "make html" in the docs directory.

Consult open bugs and feel free to file new bugs.