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
As part of converting WPT to run from a source checkout in automation,
I ran into problems where mozinfo.json wasn't being loaded, causing
several tests to fail. This is because mozinfo.json is only found
from a source directory or from a parent of the WPT meta directory.
Before, mozinfo.json was provided by the "common" tests zip file
and extracted to the base of the destination directory. WPT files
were extracted to a "web-platform" sub-directory. So mozinfo.json
was in a parent directory of "web-platform/meta" and was loaded
automatically.
Now that we want to run WPT out of the source directory, there is
no mozinfo.json and the source directory and no mozinfo.json can be
loaded.
This commit teaches mozinfo.json to look in a MOZINFO_PATH environment
variable for the path to mozinfo.json. This allows mozinfo.json
to exist anywhere on the filesystem. This provides a lot more
flexibility for loading the file.
MozReview-Commit-ID: 1I1cxS1IeyY
--HG--
extra : rebase_source : b06de2b53d3fb26df2c7b1c6d034644c20e47577
This allows the logs to work with the structured reftest viewer.
MozReview-Commit-ID: CY71vSdDjLP
--HG--
extra : rebase_source : 6b83d98aff1c5e73ac0a802b5a83b8be95adf59a
As part of converting WPT to run from a source checkout in automation,
I ran into problems where mozinfo.json wasn't being loaded, causing
several tests to fail. This is because mozinfo.json is only found
from a source directory or from a parent of the WPT meta directory.
Before, mozinfo.json was provided by the "common" tests zip file
and extracted to the base of the destination directory. WPT files
were extracted to a "web-platform" sub-directory. So mozinfo.json
was in a parent directory of "web-platform/meta" and was loaded
automatically.
Now that we want to run WPT out of the source directory, there is
no mozinfo.json and the source directory and no mozinfo.json can be
loaded.
This commit teaches mozinfo.json to look in a MOZINFO_PATH environment
variable for the path to mozinfo.json. This allows mozinfo.json
to exist anywhere on the filesystem. This provides a lot more
flexibility for loading the file.
MozReview-Commit-ID: 1I1cxS1IeyY
--HG--
extra : rebase_source : 6fb60257b6a20f6bd79461f1bf1f4f5be1f28072
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
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
In mozdevice, it's possible to pass in the path to the adb binary (rather than requiring it to be on the path). The
mochitest android options don't provide any means to set this however (even though the b2g options do). This patch
adds that option in.
This will be used by the mach environment on interactive loaners.
MozReview-Commit-ID: 4lsKGpizfH7
--HG--
extra : rebase_source : 07ad43c8fff3eb83a1eaab9ad0532cd85c4532c7
When running the command for starting Fennec, quotation marks aren't
processed properly when the 'am' portion of the command is represented
with one string token per argument; the args must be joined into one string
instead.
Also add log message about command being run in BaseRunner.
MozReview-Commit-ID: KZLnOdu9UGq
--HG--
extra : rebase_source : c8072c003afec3aba18f307b8cc64332736e55fc
This fixes an error when attempting to run xpcshell-test with a test path from an interactive loaner.
MozReview-Commit-ID: 20kg5zKplhT
--HG--
extra : rebase_source : cda8e17dd6ad7b606711630e90df8d5e65c8bda3
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
This fixes a regression from bug 1288827. It happened because I moved the logic that finds
the application path a little later on in the test harness. But there was an instance where
it was being used in the android mach command before that point.
As it turned out, we don't really *need* that value there. This patch grabs the same value
from build_obj.substs which is already an argument to the function.
MozReview-Commit-ID: 3IsI4VzEIIF
--HG--
extra : rebase_source : ceb718b265c7886b831e0378436baebf2b4e7598
This removes the unnecessary setting of c-basic-offset from all
python-mode files.
This was automatically generated using
perl -pi -e 's/; *c-basic-offset: *[0-9]+//'
... on the affected files.
The bulk of these files are moz.build files but there a few others as
well.
MozReview-Commit-ID: 2pPf3DEiZqx
--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
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
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
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
This is a refactor. |start_logcat| allows filtering by tag and is used for
recording gecko.log for Marionette tests on Fennec.
MozReview-Commit-ID: 9NO6jQDMQ9E
--HG--
extra : rebase_source : e4f60b5d1c9c4ed6bb6dd237d9c1433b5f04a8d6
This works around issues with System Integrity Protection kicking in on OSX when
trying to run /usr/bin/lldb by attempting to using the version installed with
XCode's command line utilities.
In particular SIP prevents us from setting DYLD_LIBRARY_PATH which is needed
to run DMD.
Add FennecEmulatorRunner (for convenience), FennecRunner, FennecContext
and EmulatorAVD.
Common behaviour is defined in BaseEmulator and RemoteContext to distinguish
from B2G and Fennec specifics. I've tried to decouple ArchContext from
B2GContext, as well.
The emulator/adb commands in FennecRunner and EmulatorAVD are intended to
match the behaviour seen in current Android automation (e.g. mochitest).
MozReview-Commit-ID: 1tqD0DStdHR
--HG--
extra : rebase_source : 1450f3b03f82a0f9d33e43d19632a06a51ef7253
MozReview-Commit-ID: 9e6HNAaF0Yo
In case of in-process restarts it can happen that the new process gets forked into a new process group.
When that happens we loose the capability to kill the process. To prevent a hang when joining the output
reader threads in wait(), we simply skip that call by passing-through the IO error.
--HG--
extra : rebase_source : 702dfec407ed13114f59fa6ccb0d82c5b0790550
Sometimes the IO completion port doesn't shutdown child processes. When this happens,
mozprocess will attempt to force kill the child processes manually. However, there is
a bug here which causes the OSError to get raised.
Although this fixes that bug, the original issue(s) which prevented the IOC port
from signaling shutdown remain and are still undiagnosed.
MozReview-Commit-ID: L3DQPW0Is5v
--HG--
extra : rebase_source : cf6320cffea5a4c8fb5d62861c41065d9dcefa52
We can set MOZPROCESS_DEBUG to help debug windows process code. However on try
it is unreadable as there are multiple things using mozprocess, and each process
has multiple threads. It's impossible to tell which log message comes from where.
This improves the debug logs a bit by always specifying the PID and thread name.
There are a few other drive-by cleanups in this thread. The only one of note is
removing a python 2.5 only code path.
MozReview-Commit-ID: L3DQPW0Is5v
--HG--
extra : rebase_source : f07c07f53b06b1160cd3e70cb06b8dc12a89c3ab
This code is no longer used by Marionette client or elsewhere.
MozReview-Commit-ID: 4lx9CN7XIeH
--HG--
extra : rebase_source : e0a895c02939c51ee40be5be5f999cc41420a2a7
I believe this is the source of hangs/timeouts in automation.
join() waits forever. We add code to wait at most N seconds before
force terminating the process. The timeout is a bit high. But it is
better than infinite.
MozReview-Commit-ID: KwyO4RZ9OqL
--HG--
extra : rebase_source : 767d8ff5b48d7e75ab8fe72b18145446a38d439a
Before, we kept waiting for data in the pipe after receiving the
"done" message. This didn't really make much sense because the
"done" message should be the final thing sent over the pipe!
e9113fd6cdb8 (bug 1239939) recently dropped the poll interval
of the pipe from 1.0 to 0.1s. This appears to have introduced
an intermittent failure in a test. The race condition was
between the child process sending data and the parent process
timing out (after only 0.1s) waiting for that data. Increasing
the timeout makes the failure reproduce less often. Although
technically the race condition is still present! I'm not
inclined to fix it at this time, however.
The rationale for dropping the pipe timeout was that it was
causing lag when terminating short-lived processes. Now that
we abort the pipe reading/polling loop as soon as the "done"
message is received, we no longer poll the pipe after receiving
"done" and no longer have to worry about its timeout impacting
shutdown time.
MozReview-Commit-ID: EeENQ95RAs1
--HG--
extra : rebase_source : ce2502f32841a55f912aafdba7cc81e3a58e3ff5
Found this bug when auditing the code for issues. We are attempting
to send a tuple but were forgetting the trailing comma on a single
element tuple.
Fortunately, this doesn't appear to impact anything because
the receiving end of the pipe doesn't care what data it receives.
MozReview-Commit-ID: E34fBqxgUSq
--HG--
extra : rebase_source : 3701a28979a8b53d40ea68acef3ee2cb6d8a50f2
We add some system information including processor count
and memory sizes. We also add an "overall" section describing
total resource usage. This (surprisingly) wasn't defined.
This commit is the first in a series to reconcile the differences
between the JSON format in mozsystemmonitor and what
`mach build` writes so we can write a single tool to visualize
the data.
MozReview-Commit-ID: 9mdbKxeV9Ta
--HG--
extra : rebase_source : 3aadf5e83c91ba9553595f3da77ed7ca0e4d5541
We're currently running version 0.0 in automation. This version
doesn't have as_dict(), which means we can't easily save data
to JSON.
Bump the version to 0.1 in preparation of releasing a new
version.
MozReview-Commit-ID: Kr3JqyRXk5j
--HG--
extra : rebase_source : 89f763acaa12e4357f4a23f8772f99c1a0fdb56f
We have packages for 3.1.1 uploaded to our PyPI server used
for automation. There have been a number of bug fixes since the
version of psutil currently listed. Let's ensure we're running
a modern psutil to minimize our exposure to bugs on older
versions.
MozReview-Commit-ID: 6rDapZ8miFD
--HG--
extra : rebase_source : c66295828e0c95c4ffe57e579df41af508875027
This requires a change to how we process test manifests in the build system:
now, whenever we see a support file mentioned in a manifest, we require that
file isn't already in that test's support files, but if we see a support file
that was already seen in some other test, the entry is ignored, but it is not
an error. As a result of this change, several duplicate support-files entries
needed to be removed.
MozReview-Commit-ID: G0juyxzcaB8
--HG--
rename : testing/mozbase/manifestparser/tests/test_default_skipif.py => testing/mozbase/manifestparser/tests/test_default_overrides.py
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
This approach lets us get rid of the .App <activity-alias> definitions, at
least.
In Bug 1237755, I tried pretty hard to use real intent filters, rather
than a different hard-code path name, but ran into significant issues,
and finally into the hard reality that Android 2.3 doesn't support
bare package names. (It only supports package/class component names.)
Android 2.3 can't die fast enough.
Sadly, this approach doesn't address the issues I see loading URLs
that prompted Bug 1237755.
This is the path of least resistance. Onwards!
Tested via:
nalexander@chocho ~/M/gecko> ./mach run
Starting: Intent { act=android.activity.MAIN cmp=org.mozilla.fennec_nalexander/org.mozilla.gecko.BrowserApp }
Warning: Activity not started, its current task has been brought to the front
nalexander@chocho ~/M/gecko> ./mach run https://mozilla.org
Starting: Intent { act=android.activity.MAIN dat=https://mozilla.org cmp=org.mozilla.fennec_nalexander/org.mozilla.gecko.BrowserApp }
nalexander@chocho ~/M/gecko> ./mach run file:///mnt/sdcard/test.html
Starting: Intent { act=android.activity.MAIN dat=file:///mnt/sdcard/test.html cmp=org.mozilla.fennec_nalexander/org.mozilla.gecko.BrowserApp }
--HG--
extra : commitid : JUIJj13Q0Py
extra : rebase_source : a62d8a74ca2772fd3933597589e386cf56caa396
extra : amend_source : 234f3b6b8ef6c6f2cce991375f5c28fe1cb32cad
extra : histedit_source : 5476222279f6be0927879a1136def94673885071%2Cca4aad42479731c97586003ee8bcdfe22a147776
Currently we poll at an interval of 1 second when shutting down
mozsystemmonitor. This causes a noticeable shutdown delay on short
running processes. Reducing the interval to 0.1 reduces this delay without
seeming to have any adverse effects.
--HG--
extra : rebase_source : da59ee8d09ada188d011e3a7138b30d91850aacd