Commit Graph

151 Commits

Author SHA1 Message Date
Francesco Pischedda
f45ed99748 Bug 1280573 - Add testing/mozbase to flake8 linter: r=ahal
added testing/mozbase to tools/lint/flake8.lint
fixed a first batch of PEP8 errors/warnings

at first the commad autopep8 -i --max-line-length 99 -r -j 8 .
has been used to fix simpler problems, run from testing/mozbase

some of the issues can not easily fixed :
- undefined 'names' in code for example isLinux - isLinux and isBsd "fixed" with # noqa
- undefined 'message' resolved with return fmt.format(...
- undefined 'structured' resolved replacing those with mozlog
- long comments - some remaining - addressed with # noqa
- package level import everything - addressed with # flake8: noqa

restored testing/mozbase/mozdevice/mozdevice/Zeroconf.py
fixed issues reported on mozreview
fixed ')' in testing/mozbase/mozprocess/mozprocess/qijo.py imports
finally fixed multiline string at testing/mozbase/manifestparser/tests/test_manifestparser.py:114
^^^ and again, but now with ./mach python-test --path-only testing/mozbase/manifestparser/tests/test_manifestparser.py passing
fixed testing/mozbase/manifestparser/tests/test_convert_directory.py assert

fixed this error:
10:15:21     INFO -      return lambda line: stack_fixer_module.fixSymbols(line)
10:15:21     INFO -  TypeError: fixSymbols() takes exactly 2 arguments (1 given)

fixed two spaces lint error even of #  noqa comments
restored assignement to lambda with #  noqa to silence the lint error
global noqa for testing/mozbase/manifestparser/tests/test_filters.py
stupid is/is not error...

MozReview-Commit-ID: 1FpJF54GqIi

--HG--
extra : rebase_source : 3cf0277fb36a296e3506aeacc2ff05e1b03f9eac
2016-09-30 16:08:37 +02:00
James Graham
2cbfbc0ec6 Bug 1265582 - Fix reftest structured logs to match wpt, r=ahal
This allows the logs to work with the structured reftest viewer.

MozReview-Commit-ID: CY71vSdDjLP

--HG--
extra : rebase_source : 6b83d98aff1c5e73ac0a802b5a83b8be95adf59a
2016-09-27 22:54:50 +01:00
James Graham
bba975bca2 Bug 1302796 - Add integration between structured logging and lints, r=ahal
MozReview-Commit-ID: K3tu0Zdg5go

--HG--
extra : rebase_source : 2b78059908c3a297b8ce7d134af20733fc082df5
2016-09-13 14:18:41 +01:00
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
Anjana Vakil
3e7feb1ea6 Bug 1285299 - Optionally ignore unused Mozlog formatter options; r=jgraham
Add a parameter `allow_unused_options` to the `setup_logging` and
`setup_handlers` methods in mozlog.commandline. When this parameter
is True, do not raise a ValueError in `setup_handlers` if the
command line arguments include formatter options for unused formatters.
(Default value is False.)

This allows parsed arguments from e.g. the pytest-mozlog plugin
to be passed directly to `setup_logging`, without filtering out
unused formatter options.

MozReview-Commit-ID: 8el0oaT4y1X

--HG--
extra : rebase_source : 0e969a783b1754885e6c25d35c552134773f1b5e
2016-09-07 20:55:21 +02:00
James Graham
8bdb6331c6 Bug 1293250 - Make reftest log generation less magical, r=ahal
Ensure that the first line of the log for failing tests is identical to
one that would be produced by the tbplformatter from mozlog. This means
that treeherder will be able to sucessfully cross-match error lines.

Also make the data structures used for storing screenshots identical
between reftests and web-platform-tests so that we can start to move
toward removing the reftest-specific codepath here.

MozReview-Commit-ID: FZQXLjj9Ejv

--HG--
extra : rebase_source : 3e9bf70ff7915817b8c02032c8da0d0a659e4661
2016-08-08 17:48:39 +01:00
Jeremy Chen
77cad258aa Bug 1287480 - Release mozlog 3.3. r=jmaher
MozReview-Commit-ID: D6UsFueHmPB

--HG--
extra : rebase_source : 8a667495b5efbe9849e8b64dccc3ac76fa257954
2016-07-19 09:50:09 +08:00
Henrik Skupin
3caa86c072 Bug 1255986 - [moztest] Safe-guard structured logging for exceptions from bad handlers. r=jgraham
Any exception which gets thrown by a log handler while test results are getting generated, should
not cause test harnesses to stop immediately. To achive that the exception details are written to
stderr and not propagated up the stack.

MozReview-Commit-ID: ChyYxApYSGx

--HG--
extra : rebase_source : 9fc3fe597061bedb1df2f5b8de1daa4bd127ea1e
2016-06-03 22:20:59 +02:00
Jeremy Chen
f0831c1624 Bug 1287019 - part2: prevent saving redundant screenshots in mozlog's HTML format result. r=jmaher
There are two identical pairs of screenshots (test/reference pair) which are
png/base64 raw files generated from mozlog's HTML formatter. One pair is stored
in the img element to present the visual result; the other pair is stored as a
hyperlink source in the visual result's title.

After part1 patch, we may have one more pair. It appears that the hyperlinks of
the visual result's titles could be eliminated since they are visually closed to
the visual results, and clicking the visual results provides the exact same
function.

DONTBUILD (NPOTB)

MozReview-Commit-ID: 4CLfYXX8g69

--HG--
extra : rebase_source : d4d3b4e08b66e737d75a2ca21b6e84b344a29fc8
2016-07-18 13:53:58 +08:00
Jeremy Chen
824b568df5 Bug 1287019 - part1: make mozlog's HTML format support wptrunner screenshot. r=jmaher
Current mozlog (v3.2) doesn't support screenshot logs exported from wptrunner.
Add this support so we could run css test with --log-html to see more detail
information, such as screenshots of test/reference pages.

DONTBUILD (NPOTB)

MozReview-Commit-ID: AUJwYfvNfda

--HG--
extra : rebase_source : 1d3d1fcdc396638d256336d3dfaf5ba5bad35168
2016-07-18 13:53:58 +08:00
Henrik Skupin
37ac3002c3 Bug 1271612 - Release mozlog 3.2. r=jmaher
MozReview-Commit-ID: I8JcpkeLzkv

--HG--
extra : rebase_source : 79bcb3512ba9b55c1c925287052beaf6ed084a81
2016-05-11 10:17:45 +02:00
Henrik Skupin
ce5263701a Bug 1258343 - [mozlog] Fix HTML report generation for unicode characters. r=jmaher
MozReview-Commit-ID: 79l2BuNRIxq

--HG--
extra : rebase_source : 7d31e35abcb6f9b6dc44a19c07b4e5393e31e16d
2016-05-09 23:14:05 +02:00
James Graham
ea86fedb84 Bug 1270507 - Elide subtest results from web-platform-tests on treeherder when they match expectations, r=ahal
MozReview-Commit-ID: DyatYcpdjvQ

--HG--
extra : rebase_source : 8947cfc0084a2523c570ff2f832a7ce79852ba1d
2016-05-03 23:21:07 +01:00
Shing Lyu
1a12b45ba9 Bug 1258616 - Swap the order of test and ref images in html reftest report to match reftest-analyzer convention. r=jmaher
--HG--
extra : rebase_source : 35f476935f5b40aecba5552c0faad553efb9d03a
2016-03-30 20:13:00 -04:00
Shing Lyu
dc62409f53 Bug 1253219 - Add reftest screenshots to html report for easier debugging. r=jmaher
--HG--
extra : rebase_source : d9d03001e3b597908b0f241db2cfda02afc51072
2016-03-14 05:16:00 +01:00
Shing Lyu
2507afb6b9 Bug 1253209 - Fixed reftest html report generation failure. r=jmaher 2016-03-06 20:09:00 +01:00
Julian Seward
9c5cac6016 Bug 1245566 - Enable taskcluster scheduling for valgrind-mochitest runs: mochitest_valgrind_mods. r=jgraham. 2016-02-18 11:34:40 +01:00
Andrew Halberstadt
f94d7e71d8 Bug 1034290 - Use structured log output for test results in reftest, r=jmaher
Structured logs bring many benefits. We can stop parsing the logs for magic strings, we
can modify the format without breaking things, and we can stream results into systems like
ActiveData. The structured logs originate primarily in reftest.js. StructuredLog.jsm is
used to generate the JSON-based log stream. Finally OutputHandler in the python harness
reads structured output from stdout, and formats it into human readable form.

MozReview-Commit-ID: G3ZLkMRl6p7

--HG--
extra : commitid : J3ui9XYWR3Q
extra : rebase_source : 77ed0ba842cc8e557141fb3494212b06868c728a
extra : amend_source : 735d48225a2e627e0fe45fc11b50b6c49a885a4b
extra : source : d1779fe421c3c7cd8e3d191816776390dc104f37
2016-02-05 15:44:20 -05:00
Phil Ringnalda
66e6da78e6 Back out d1779fe421c3 (bug 1034290) for UnicodeDecodeErrors in things run by the reftest harness
CLOSED TREE
2016-02-05 08:18:47 -08:00
Andrew Halberstadt
8a462fd84b Bug 1034290 - Use structured log output for test results in reftest, r=jmaher
Structured logs bring many benefits. We can stop parsing the logs for magic strings, we
can modify the format without breaking things, and we can stream results into systems like
ActiveData. The structured logs originate primarily in reftest.js. StructuredLog.jsm is
used to generate the JSON-based log stream. Finally OutputHandler in the python harness
reads structured output from stdout, and formats it into human readable form.

--HG--
extra : commitid : J3ui9XYWR3Q
extra : rebase_source : 6bae978126dbd5beddc39332c7cbce0c1354cd87
extra : amend_source : 735d48225a2e627e0fe45fc11b50b6c49a885a4b
2015-10-29 15:01:44 -04:00
Julien Pagès
88a3456247 Bug 1226554 - [mozlog] bump version to 3.1. r=jgraham
--HG--
extra : commitid : IxovQzi5gyE
extra : rebase_source : ae3cf006bba8676cf66edaecd01b30de03bd3c0a
2015-11-20 13:40:24 +01:00
Julien Pagès
dfdc7dc7de Bug 1226554 - [mozlog] add a ProxyLogger concept. r=jgraham
--HG--
extra : commitid : Ez3CFCMZVYb
extra : rebase_source : f2515b3bf0fc813a3f10613fb8d1bc94878a6e60
2015-11-20 12:42:51 +01:00
Andrew Halberstadt
e7029d44aa Bug 1219870 - [mozlog] ensure correct suite state when logging suite_start/suite_end via StructuredLogger.log_raw, r=chmanchester
--HG--
extra : commitid : L5aVgE5euqR
extra : rebase_source : 3b7f3b105503a7cc3e0ba8d8c15a85b18a06ce30
2015-10-29 15:11:25 -04:00
Julian Seward
0ce48c0f5e Bug 1185244 - Improve mach support for running mochitests on Valgrind. r=jgraham, njn. 2015-09-28 12:01:42 +02:00
Wes Kocher
d4897fa1ef Backed out changeset feceb41f1c3c (bug 1185244) for breaking running tests locally CLOSED TREE a=backout 2015-09-22 17:08:37 -07:00
Julian Seward
b3bc139b1e Bug 1185244 - Improve mach support for running mochitests on Valgrind. r=jgraham, njn. 2015-09-22 12:00:57 +02:00
Andrew Halberstadt
20cae47299 Bug 1193522 - [mozlog] Use ultrajson instead of stdlib json if available for performance, r=jgraham
--HG--
extra : commitid : IQGf0ENQujg
extra : rebase_source : 1d29af9a7871d595952b776998f66bc7c9b41735
2015-08-13 13:37:07 -04:00
Julien Pagès
6ad9fb9172 Bug 1192024 - Remove the word status from the human readable string of a process exit code in mozlog on Windows. r=jgraham 2015-08-12 00:43:00 -04:00
James Graham
3cc0515703 Bug 1191267 - Fix mozlog log buffering command line option, r=chmanchester 2015-08-06 11:52:20 +01:00
Julien Pagès
78ef1c279b Bug 1186551 - [mozlog] add structured action process_start/process_exit. r=jgraham
--HG--
extra : transplant_source : %23%B9%0D%23%93Kf%8F%3F%1A%F5%8DP%97%AA%81%8D%1C%8D%7E
2015-07-22 21:00:25 +02:00
Andrew Halberstadt
2b977b797d Bug 1186888 - [mozlog] Ability to use a pre-existing logger with commandline.setup_logging(), r=jgraham
--HG--
extra : commitid : 786tOojSwTl
extra : rebase_source : 3df091de3afee6838a40c0c858da97fd04b32739
extra : amend_source : 5a5ea71fd9a8ede744d281cb0b2dae190575230d
2015-07-22 15:27:31 -04:00
Andrew Halberstadt
2be5ff0c10 Bug 1014760 - Move mozlog.structured to mozlog; Move mozlog to mozlog.unstructured, r=jgraham
Mozlog currently has two implementations. The top level package is based on the logging module and is
deprecated. The newer structured logging implementation lives in mozlog.structured. This patch swaps the
two, so the top level mozlog module contains the recommended implementation, while mozlog.unstructured
contains the old one.

--HG--
rename : testing/mozbase/docs/mozlog_structured.rst => testing/mozbase/docs/mozlog.rst
rename : testing/mozbase/mozlog/mozlog/structured/commandline.py => testing/mozbase/mozlog/mozlog/commandline.py
rename : testing/mozbase/mozlog/mozlog/structured/formatters/__init__.py => testing/mozbase/mozlog/mozlog/formatters/__init__.py
rename : testing/mozbase/mozlog/mozlog/structured/formatters/base.py => testing/mozbase/mozlog/mozlog/formatters/base.py
rename : testing/mozbase/mozlog/mozlog/structured/formatters/errorsummary.py => testing/mozbase/mozlog/mozlog/formatters/errorsummary.py
rename : testing/mozbase/mozlog/mozlog/structured/formatters/html/__init__.py => testing/mozbase/mozlog/mozlog/formatters/html/__init__.py
rename : testing/mozbase/mozlog/mozlog/structured/formatters/html/html.py => testing/mozbase/mozlog/mozlog/formatters/html/html.py
rename : testing/mozbase/mozlog/mozlog/structured/formatters/html/main.js => testing/mozbase/mozlog/mozlog/formatters/html/main.js
rename : testing/mozbase/mozlog/mozlog/structured/formatters/html/style.css => testing/mozbase/mozlog/mozlog/formatters/html/style.css
rename : testing/mozbase/mozlog/mozlog/structured/formatters/html/xmlgen.py => testing/mozbase/mozlog/mozlog/formatters/html/xmlgen.py
rename : testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py => testing/mozbase/mozlog/mozlog/formatters/machformatter.py
rename : testing/mozbase/mozlog/mozlog/structured/formatters/tbplformatter.py => testing/mozbase/mozlog/mozlog/formatters/tbplformatter.py
rename : testing/mozbase/mozlog/mozlog/structured/formatters/unittest.py => testing/mozbase/mozlog/mozlog/formatters/unittest.py
rename : testing/mozbase/mozlog/mozlog/structured/formatters/xunit.py => testing/mozbase/mozlog/mozlog/formatters/xunit.py
rename : testing/mozbase/mozlog/mozlog/structured/handlers/__init__.py => testing/mozbase/mozlog/mozlog/handlers/__init__.py
rename : testing/mozbase/mozlog/mozlog/structured/handlers/base.py => testing/mozbase/mozlog/mozlog/handlers/base.py
rename : testing/mozbase/mozlog/mozlog/structured/handlers/bufferhandler.py => testing/mozbase/mozlog/mozlog/handlers/bufferhandler.py
rename : testing/mozbase/mozlog/mozlog/structured/handlers/statushandler.py => testing/mozbase/mozlog/mozlog/handlers/statushandler.py
rename : testing/mozbase/mozlog/mozlog/structured/logtypes.py => testing/mozbase/mozlog/mozlog/logtypes.py
rename : testing/mozbase/mozlog/mozlog/structured/reader.py => testing/mozbase/mozlog/mozlog/reader.py
rename : testing/mozbase/mozlog/mozlog/structured/scripts/__init__.py => testing/mozbase/mozlog/mozlog/scripts/__init__.py
rename : testing/mozbase/mozlog/mozlog/structured/scripts/format.py => testing/mozbase/mozlog/mozlog/scripts/format.py
rename : testing/mozbase/mozlog/mozlog/structured/scripts/logmerge.py => testing/mozbase/mozlog/mozlog/scripts/logmerge.py
rename : testing/mozbase/mozlog/mozlog/structured/scripts/unstable.py => testing/mozbase/mozlog/mozlog/scripts/unstable.py
rename : testing/mozbase/mozlog/mozlog/structured/stdadapter.py => testing/mozbase/mozlog/mozlog/stdadapter.py
rename : testing/mozbase/mozlog/mozlog/structured/structuredlog.py => testing/mozbase/mozlog/mozlog/structuredlog.py
rename : testing/mozbase/mozlog/mozlog/logger.py => testing/mozbase/mozlog/mozlog/unstructured/logger.py
rename : testing/mozbase/mozlog/mozlog/loggingmixin.py => testing/mozbase/mozlog/mozlog/unstructured/loggingmixin.py
rename : testing/mozbase/mozlog/mozlog/loglistener.py => testing/mozbase/mozlog/mozlog/unstructured/loglistener.py
extra : commitid : 3JWk75JY4N0
extra : rebase_source : 229bad7a7bf8ead013ce62d128c0896a75cad393
2015-07-16 10:38:40 -04:00
James Graham
0b0e2d0aaf Bug 1177630 - Add formatter to mozlog for producing a machine readable error summary, r=chmanchester
--HG--
extra : commitid : FeIqwyCNz06
extra : rebase_source : 32141de7decef684b241e674d02a709b5f87f09f
2015-07-08 11:32:57 +01:00
James Graham
43a3f73c63 Bug 1171849 Let consumers override mozlog default formatter options, r=chmanchester 2015-06-05 17:48:06 +01:00
James Graham
e07b9de9bf Bug 1171032 - Log raw messages at debug level by default, r=chmanchester
Also add --log-raw-level option to control this.

--HG--
extra : rebase_source : 9cb319c94b3f6b5e88bdc514dd0e22dc56277d85
2015-06-03 15:55:00 +01:00
Manish Goregaokar
f10df76074 Bug 1170591 - Remove trailing whitespace in mozlog. r=jdm 2015-06-02 11:30:00 -04:00
Nick Alexander
c1f14290e2 Bug 1160324 - Handle missing robocopApk files in runtestsremote.py. r=gbrown
--HG--
extra : source : 7d8043298e133ab903b55ba9c8530b2ea28a3180
2015-04-30 14:28:14 -07:00
Hiroyuki Ikezoe
66b928b10a Bug 1154111 - Colorize SKIP in test logs. r=jgraham
--HG--
extra : rebase_source : ca0862950be526bda05711c369cef38b0d2a516c
2015-04-13 23:18:00 +02:00
Dave Hunt
729813836c Bug 1146292 - [mozlog] Bump version to 2.11. r=jgraham 2015-03-23 11:00:58 +00:00
Julien Pagès
5bf31af53c Bug 1132409 - [mozlog] Create directories for log specified on the command line if not present. r=jgraham
--HG--
extra : rebase_source : f895f820c97796573a665ecc28358931700b0c43
2015-03-06 06:17:00 -05:00
Julien Pagès
2756b8c420 Bug 1066643 - [mozlog] Allow users of mozlog's command line options to exclude inappropriate log types. r=jgraham 2015-02-24 14:01:00 -05:00
Julien Pagès
ecf2ab744f Bug 1132076 - [mozlog] Incorrect skip count in HTML log summary. r=davehunt 2015-02-11 09:19:00 -05:00
Andrew Halberstadt
bc64a1699e Bug 1129495 - [mozlog] Add optional 'path' attribute to test_start, r=jgraham
--HG--
extra : rebase_source : d26387e9674a97c4571d29ee80e0e00609ed2a72
2015-02-10 17:11:35 -05:00
Dave Hunt
9cb2cd3d6f Bug 1130358 - [mozlog] Bump version to 2.10. r=jgraham 2015-02-06 04:47:00 -05:00
Julien Pagès
337d9012ea Bug 1016929 - [mozlog] html formatter imports py.xml, doesn't declare it as a dependency. r=jgraham
--HG--
extra : rebase_source : 249b6ee7f576ce466f77fc063fef4c7fddffa9ec
2015-02-04 09:54:00 +01:00
Maciek
2d6f742885 Bug 1103945 - Add command line tool to merge multiple raw structured logs, r=jgraham
--HG--
extra : rebase_source : e2e07270a584c61bc01d6e68d7bf4e3ff9a451e2
2015-02-02 20:13:50 +01:00
Dave Hunt
7c60600fd9 Bug 1118738 - Fix HTML report colours for expected skips and unexpected errors. r=jgraham 2015-01-07 06:36:00 -05:00
Julien Pagès
ae85f164f2 Bug 1065406 - [mozlog] Split test class and name for XUnit formatter. r=jgraham 2014-12-16 16:02:00 +01:00
Ms2ger
f2b16bc10f No bug - Bump the mozlog package version; rs=jgraham 2014-12-19 11:27:28 +01:00
Ms2ger
de702b2126 Bug 1113095 - Handle failing reftests in machformatter's summarizing code; r=jgraham 2014-12-19 11:25:51 +01:00