marionette_test.py is a bloated module which contains everything around the Marionette testcase classes.
We should split this up into distinct modules, so each new module covers specific code. The two new modules
introduced are errors, and decorators. This split would also be aligned to the structure of the driver.
To not loose backward compatibility we have to keep the import from marionette_test. It means the new
modules have to live in a sub folder named like that.
MozReview-Commit-ID: DQg55M258ST
--HG--
extra : rebase_source : 2c4150e56b4489518bd1c87b4c3f7cc25e0c5133
- When one of the parameters to isDeeply is an object/function
and the other is not, isDeeply returned false. Well, isDeeply
is supposed to report an error instead of returning a value...
- Change the implementation of isDeeply to have SameValue semantics
instead of weak equality.
- Change the representation of arrays to look like an array, instead
of its default toString() value which is indistinguishable from a
string due to the lack of brackets and quotes.
- Account for missing object properties;
Distinguish them from "undefined" with the special DNE tag.
MozReview-Commit-ID: F1OJhbXcptl
--HG--
extra : rebase_source : 26091a40445064da3f87d61438bd74bbe7491363
eQueryTextRect is used by widget and eQueryTextRectArray is used by ContentCacheInChild. So, matching their result guarantees that widget can get same result both in non-e10s mode and e10s mode. So, the matching should be tested.
MozReview-Commit-ID: 6GfbyvZ9X7H
--HG--
extra : rebase_source : 12511d84cbd94b3f4edf42367a84ee45abc66d9e
Because execute_async_script() has it's own timeout value, there shouldn't be another timeout
check inside the script. Even with this check we return immediately now, which can cause test
failures if setting the permission is delayed.
MozReview-Commit-ID: Aqsbfc6Ayy6
--HG--
extra : rebase_source : c1107a48644129d9e55ed07e049a60ad809d2ed0
Add tests to ensure that the arguments passed to the call to
`manifest.active_tests` from within `runner.add_test` are correct,
based on the runner's settings for e.g. e10s and test tags.
Add helper function for setup for these tests to avoid duplication.
MozReview-Commit-ID: CsaDm7cSyZf
--HG--
extra : rebase_source : fe3687aea4d342962074bfef7f5c43385710f8fa
Move the ManifestFixture class out of the `manifest_fixture` function,
and rename that function to `manifest_with_tests`. Create a new,
simpler manifest fixture without parametrization, called `manifest`.
This allows us to use the mocking-out done in the ManifestFixture class
in tests where we don't actually need the parametrization of the
`active_tests` attribute.
MozReview-Commit-ID: xuBn4QxApf
--HG--
extra : rebase_source : c570086a6ec4556fc634f7e18f998a5fca042a01
Modify the mozharness script for the Marionette harness tests
to use the new pytest_mozlog plugin, so that the logs produced
will be parseable by Treeherder.
Change the arguments passed to `pytest.main` to instruct pytest_mozlog
to write log files in TBPL, mach, and raw (structured log) formats.
Read the TBPL log into the mozharness script log itself,
and upload all pytest-mozlog log files to the default
blob upload dir as specified in the Mozharness BaseScript.
MozReview-Commit-ID: HoEK2M1XGwN
--HG--
extra : rebase_source : 9042d89c6ab2befefe945fdcfd6999c35b9d7340
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
The MP4 used in the tests was invalid:
1- It contains out of order and overlapping frames
2- The first frame for each of the first 9 media segments were marked as keyframe, even though they weren't
The new file was encoded such that:
- The total bitrate remains the same as in the previous files
- The total duration is similar
- Each media segment starts with a valid keyframe
- Frames are properly ordered
- GOP is made of 24 frames
- The video track doesn't start at 0, which helps testing the proper behaviour regarding buffered range calculation.
- Like in the previous video, the audio track is present but made of silence (which is puzzling for a video initially designed to test A/V sync)
The webm file presents the same characteristics.
MozReview-Commit-ID: 6AKKmInaenE
--HG--
extra : rebase_source : e1ce95452a063872f345114ed19d57f19e0c08fc
With this change, we could share this EnumTypeTraits between files easily.
MozReview-Commit-ID: 9Q2augati7l
--HG--
extra : rebase_source : b7d9fc95d9d7722ba3eb99ec9798a64ebdbeb484
This will allow developers to request a loaner for an Android mochitest job and then use
|mach mochitest| to run tests.
MozReview-Commit-ID: 4lsKGpizfH7
--HG--
extra : rebase_source : fba9adb6e2d50cc9ac27532bc91b5eb1d909d874
I noticed that if you request a loaner for a non-e10s job then run mach, it will be run with e10s
enabled. The mach command should accurately reflect the type of job that got requested. This patch
grabs the 'e10s' argument from the mozharness localconfig.json and uses that.
MozReview-Commit-ID: 4lsKGpizfH7
--HG--
extra : rebase_source : 6f7b45146bb7f3431c242d92b4206d41f7217c03
You can set attributes on a mach context by using the 'key' argument to the context_handler. Basically,
whatever gets returned by the handler when <key> is passed in, will get set (i.e cached) on the context
object for fast retrieval next time. This is a way to lazy load these attributes.
Previously I was setting functions like 'find_firefox()' on the context object, and then having the
mach_commands call that directly. But this way is much cleaner.
Now, the loaded 'mozharness_config' can be stored as an attribute on the context. Also 'find_firefox()'
is now an attribute called 'firefox_bin'.
MozReview-Commit-ID: 4lsKGpizfH7
--HG--
extra : rebase_source : af5e32e05a29b8e91d4cd0005689baa8079ec137
I had a mistake in my code that resulted in an exception being thrown when starting the
mochitest servers. However, the log just showed a timeout. It was very confusing.
After some digging, I found that there's a large try/finally block (with no except) in
runtests.py. The exception wasn't being displayed because of the finally block. This
try/finally block had an inner try/except/finally that wrapped part of the code. This
patch simply removes that inner block and dedents the 'except' clause to attach to the
original try/finally.
MozReview-Commit-ID: 4lsKGpizfH7
--HG--
extra : rebase_source : 9d55b967c8384498a4d104730a7bb91c4885bbea
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
Currently 'stop-emulator' is its own action in mozharness. This means that anytime the mozharness
script finishes emulators will get shutdown. Usually, this is what we want to do. But if the user passes
in --no-run-tests, then presumably they are intending to run tests at a later time for some reason.
But when they do this, the emulator will be terminated, and then running tests later no longer works.
The main place where this becomes a problem is on interactive loaners in taskcluster. This patch fixes
the problem by instead running 'stop-emulator' only after the 'run-tests' step finishes. So if
--no-run-tests is passed in, the emulator will be left open.
MozReview-Commit-ID: 4lsKGpizfH7
--HG--
extra : rebase_source : e29733a4a69d4d063f225754d2ad8886e22b4782