Commit Graph

110 Commits

Author SHA1 Message Date
James Graham
5cb6f28c55 Bug 1678663 - Support passing adb binary in to wptrunner, r=bc
Differential Revision: https://phabricator.services.mozilla.com/D99254
2020-12-14 14:10:41 +00:00
James Graham
d1994d2409 Bug 1676655 - Enable additional root paths when running mach wpt-serve, r=karlcow
This replicates the logic in
testing/web-platform/tests/tools/wptrunner/wptrunner/environment.py to
ensure that all the configured URL base paths are added to the
wptserve router configuration when starting via mach wpt-serve.

Differential Revision: https://phabricator.services.mozilla.com/D96723
2020-11-12 10:26:14 +00:00
Ricky Stewart
31b8ca9716 Bug 1654103: Standardize on Black for Python code in mozilla-central.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara
612312a64c Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart
065d2eb893 Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca
95b44c982f Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart
43baed3c18 Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
James Graham
539c7b3478 Bug 1668458 - Load specialPowers web extension in gecko-only wpt tests, r=jmaher,twisniewski,whimboo
Lack of support for specialPowers is often cited as a reason for
developers to write mochitests rather than wpt. Although using
specialPowers means that the tests can't be upstreamed, having it
available in gecko-only tests should reduce the need to write
mochitests and potentially means that a patch which previously would
be written with just mochitests would instead be written with just
wpt, a fraction of which would be unsuitable for sharing.

Nevertheless a gecko-only specialPowers-using test should be
considered the option of last resort when cross-browser APIs such as
testdriver aren't sufficient.

This patch installs the specialPowers extension when the path to the
XPI is provided via a --specialpowers-path command line argument. To
ensure this only happens for gecko-only tests, the url_base is added
to the Test object, and the firefox settings() method is updated to
contain a specialpowers setting, which uses the url_base of the test
to determine if this is a gecko-only test.

Because the extension has to be enabled using marionette, we also need
to route this setting through the to executor, along with the provided
XPI path.

Differential Revision: https://phabricator.services.mozilla.com/D92035
2020-10-06 14:01:24 +00:00
Bogdan Tara
1d1257bbd6 Backed out changeset 5f2252c9e774 (bug 1668458) for wpt failures CLOSED TREE 2020-10-06 16:32:01 +03:00
James Graham
7e1f050863 Bug 1668458 - Load specialPowers web extension in gecko-only wpt tests, r=jmaher,twisniewski,whimboo
Lack of support for specialPowers is often cited as a reason for
developers to write mochitests rather than wpt. Although using
specialPowers means that the tests can't be upstreamed, having it
available in gecko-only tests should reduce the need to write
mochitests and potentially means that a patch which previously would
be written with just mochitests would instead be written with just
wpt, a fraction of which would be unsuitable for sharing.

Nevertheless a gecko-only specialPowers-using test should be
considered the option of last resort when cross-browser APIs such as
testdriver aren't sufficient.

This patch installs the specialPowers extension when the path to the
XPI is provided via a --specialpowers-path command line argument. To
ensure this only happens for gecko-only tests, the url_base is added
to the Test object, and the firefox settings() method is updated to
contain a specialpowers setting, which uses the url_base of the test
to determine if this is a gecko-only test.

Because the extension has to be enabled using marionette, we also need
to route this setting through the to executor, along with the provided
XPI path.

Differential Revision: https://phabricator.services.mozilla.com/D92035
2020-10-06 12:54:36 +00:00
Noemi Erli
644fc033b2 Backed out 2 changesets (bug 1668458) for causing web platform test failures CLOSED TREE
Backed out changeset 8739d75e13dc (bug 1668458)
Backed out changeset e45a73a47c37 (bug 1668458)
2020-10-05 18:24:36 +03:00
James Graham
273a52b544 Bug 1668458 - Load specialPowers web extension in gecko-only wpt tests, r=jmaher,twisniewski
Lack of support for specialPowers is often cited as a reason for
developers to write mochitests rather than wpt. Although using
specialPowers means that the tests can't be upstreamed, having it
available in gecko-only tests should reduce the need to write
mochitests and potentially means that a patch which previously would
be written with just mochitests would instead be written with just
wpt, a fraction of which would be unsuitable for sharing.

Nevertheless a gecko-only specialPowers-using test should be
considered the option of last resort when cross-browser APIs such as
testdriver aren't sufficient.

This patch installs the specialPowers extension when the path to the
XPI is provided via a --specialpowers-path command line argument. To
ensure this only happens for gecko-only tests, the url_base is added
to the Test object, and the firefox settings() method is updated to
contain a specialpowers setting, which uses the url_base of the test
to determine if this is a gecko-only test.

Because the extension has to be enabled using marionette, we also need
to route this setting through the to executor, along with the provided
XPI path.

Differential Revision: https://phabricator.services.mozilla.com/D92035
2020-10-02 19:34:10 +00:00
Philipp Fischbeck
b5b0b92ba5 Bug 1622686 - Make testing/web-platform flake8 compliant. r=sylvestre,jgraham
This also enables py3 linting for testing/web-platform. The external testing/web-platform/tests is excluded from linting.

Differential Revision: https://phabricator.services.mozilla.com/D90744
2020-09-29 14:22:49 +00:00
James Graham
ae8a22bae2 Bug 1663653 - Make wptrunner use the same manifest for non-gecko products, r=whimboo
This utilises the fact that we can now specify the manifest
independently of the metadata path, which wasn't possible before. We
need to edit the default (i.e. Firefox) configuration to update the
metadata path (only) to point at something product-specific so we
don't end up using fx metadata for everything.

Differential Revision: https://phabricator.services.mozilla.com/D89461
2020-09-09 09:44:22 +00:00
James Graham
9ee2d6946b Bug 1658296 - Add extra kwargs required by wpt run, r=maja_zf
Differential Revision: https://phabricator.services.mozilla.com/D86567
2020-08-10 19:21:44 +00:00
Andrew Halberstadt
5a92cf368a Bug 985141 - [mozbuild] Remove leading underscore from MozbuildObject._activate_virtualenv, r=firefox-build-system-reviewers,perftest-reviewers,andi,AlexandruIonescu,rstewart
This function is used all across the tree and should be considered a public API.

Differential Revision: https://phabricator.services.mozilla.com/D85045
2020-07-28 16:06:10 +00:00
James Graham
f0a3725202 Bug 1646801 - Fix mach test with wpt, r=ahal
Don't require setting include as an empty list. Use the subsuite name if known.

Differential Revision: https://phabricator.services.mozilla.com/D80500
2020-06-22 18:17:00 +00:00
James Graham
6090c8d08b Bug 1628647 - Don't use preload-browser for local runs, r=maja_zf
Differential Revision: https://phabricator.services.mozilla.com/D70332
2020-04-09 13:49:04 +00:00
Brendan Dahl
603520b784 Bug 1566930 - Default to auto install on the various android mach commands. r=gbrown,perftest-reviewers,whimboo,sparky
Differential Revision: https://phabricator.services.mozilla.com/D64230
2020-03-13 20:48:52 +00:00
James Graham
582b82d55c Bug 1613624 - Make it possible to disable system fonts in wpt, r=maja_zf
wpt previously required Ahem as a system font. That requirement is now
relaxed and installing fonts is only required in order to see bugs
that result from differences between the system font loader and the
webfont loader. Since installing fonts can cause problems on some
systems, make this possible to disable.

Differential Revision: https://phabricator.services.mozilla.com/D61801
2020-02-06 21:07:10 +00:00
Botond Ballo
8b977f6440 Bug 1599930 - Support --no-install for web platform tests. r=jgraham
Differential Revision: https://phabricator.services.mozilla.com/D55046
2020-01-28 15:28:19 +00:00
James Graham
0f3698995d Bug 1600695, Add mach wpt-test-paths command, r=dheiberg
This command takes a list of test ids and returns the list of test
files that correspond to those test ids. The mapping is one-to-many
between files and test ids i.e. a single file can generate many tests.

Differential Revision: https://phabricator.services.mozilla.com/D56192
2019-12-09 10:46:50 +00:00
Botond Ballo
2fca46c2e4 Bug 1590857 - Don't prompt to install Android app if the user is running 'mach install'. r=gbrown
Differential Revision: https://phabricator.services.mozilla.com/D54381
2019-11-25 22:17:59 +00:00
Christian Holler
09aa3cd1b1 Bug 1589612 - Remove remaining lsan_dir from WPT mach command. r=jgraham
Differential Revision: https://phabricator.services.mozilla.com/D49721
2019-10-18 10:02:52 +00:00
James Graham
e8a877b378 Bug 1583603 - Set formatter defaults correctly for mozlog, r=maja_zf
Gecko was trying to pass formatter options in by default, which
doesn't work if the user overrides the formatter. Instead pass in the
default options explicitly using the designed mechanism, which
previously wasn't exposed in wpt.

Differential Revision: https://phabricator.services.mozilla.com/D47117
2019-09-25 19:37:38 +00:00
James Graham
caa86b9b60 Bug 1571755 - Add a command for merging wpt metadata, r=maja_zf
This command is inteded to be usable as a git mergetool for the
specific case of merging ini files in a way that should always
succeed, produces reasonably likely output, but isn't reliably
correct.

The main use case is for the sync bot where we update metadata on
branches and experience conflicts when we also have changes on
master. We don't necessarily need to resolve these perfectly but we do
need to provide a resolution automatically since otherwise it blocks
syncs. Since the ini parser is in-tree we want to make this an in-tree
command that the sync can use to provide the resolution.

The general strategy is that we want to prefer the "new" metadata
where possible. This won't always be correct e.g. if a test got fixed
on master and simultaneously got edited to go from TIMEOUT to FAIL in
a browser without the fix. But it's not a bad approximation (and
generally a human will struggle to do the merge better by hand, so we
have to assume later try jobs will fix things).

Differential Revision: https://phabricator.services.mozilla.com/D40832
2019-08-09 17:48:53 +00:00
Geoff Brown
152af6df34 Bug 1570051 - Minor updates to android mach commands; r=bc
Various cleanup:
 - remove extraneous calls to grant_runtime_permissions
 - remove unused legacy jimdb support code
 - remove "This may take a while" logging
 - emphasize x86/x86_64 capabilities of emulator

Differential Revision: https://phabricator.services.mozilla.com/D40302
2019-08-03 01:52:39 +00:00
Edwin Gao
815e09bc23 Bug 1519369 - support 'debugger' parser argument for mach test command r=ahal,gbrown
Differential Revision: https://phabricator.services.mozilla.com/D39229
2019-07-26 15:18:18 +00:00
Maja Frydrychowicz
90fa488e22 Bug 1560023 - Rename wpt product fennec to firefox_android; r=jgraham,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D36630
2019-07-09 18:10:03 +00:00
Geoff Brown
5abd8775e3 Bug 1560073 - Change default android package name for most mach test commands; r=snorp,nalexander,maja_zf
Use the geckoview TestRunnerActivity, org.mozilla.geckoview.test, by default
for all types of mochitests, reftests, and web-platform tests. TRA is already
the default for gtest and geckoview-junit. Fennec, based on ANDROID_PACKAGE_NAME,
remains the default for robocop and marionette-test and I have no plans to
change those. There is a related issue for xpcshell-test -- not the package
name, but the default apk -- but I am reluctant to handle that until bug 1553225
is resolved.

Differential Revision: https://phabricator.services.mozilla.com/D35479
2019-06-26 02:34:49 +00:00
James Graham
04c71a1333 Bug 1557079 - Add mach command for running wpt unittests, r=maja_zf,nikkis
./mach wpt-unittest command will run tox in testing/web-platform/tests/tools
and testing/web-platform/tests/tools/wptrunner. It does some hacking to update
the requirements.txt files so that we use the in-tree versions of packages
rather than updating from pypi; this involves temporarily rewriting the files
since I couldn't figure out a good way to get tox to install something different.

Differential Revision: https://phabricator.services.mozilla.com/D33811
2019-06-13 14:24:25 +00:00
Geoff Brown
2387db4b6c Bug 1556517 - Avoid attribute error when installing geckoview from 'mach wpt'; r=KWierso
Differential Revision: https://phabricator.services.mozilla.com/D33583
2019-06-04 00:11:18 +00:00
James Graham
0714c3a5d6 Bug 1555212 - Make wpt --product install the dependencies in the mach layer, r=ato
This avoids a mismatch in the available arguments between upstream pip and
the version vendored into m-c at the cost of the code being more liable
to break when upstream changes.

Differential Revision: https://phabricator.services.mozilla.com/D32991
2019-05-29 11:30:45 +00:00
James Graham
b753bc6c22 Bug 1543073 - Add mach wpt-serve for running the wpt server, r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D26705
2019-04-11 16:47:58 +00:00
James Graham
0aea86db7b Bug 1536804 - Add a mach command to summarise wpt metadata, r=ato
This parses the metadata files without evaluating the conditional
expressions, producing a JSON summary file in which each possible
condition is represented as a string.

Not all data from the metadata files appears in the summary, only
exceptional cases likely to be of interest to engineers and unlikely
to be on wpt.fyi e.g. tests that have lsan leaks or tests that crash,
not just tests that fail. This is intended to keep the filesize down.

Depends on D24177

Depends on D24177

Differential Revision: https://phabricator.services.mozilla.com/D24178
2019-04-11 16:40:07 +00:00
James Graham
8b732aedd9 Bug 1543244 - Refactor mach addtest support, r=ahal,bgrins
Add addtest support for per-suite arguments and multiple files. Also
support opening the created test in an editor. This allowed supporting
the wpt suite and replaces `mach wpt-create`.

 # Create a wpt test
 ./mach addtest testing/web-platform/tests/accelerometer/test.html

 # Create a wpt reftest
 ./mach addtest --suite wpt-reftesttesting/web-platform/tests/css/example.html --ref example-ref.html

The files created will be opened in the default editor if --editor is
supplied or a specified editor if the argument is given a value.

Differential Revision: https://phabricator.services.mozilla.com/D26339
2019-04-11 09:44:32 +00:00
Bogdan Tara
f95f20625f Backed out 3 changesets (bug 1536804) for /css/css-* failures CLOSED TREE
Backed out changeset e8758002d7d4 (bug 1536804)
Backed out changeset 795287b1e059 (bug 1536804)
Backed out changeset 9a680e886248 (bug 1536804)
2019-03-26 18:41:16 +02:00
James Graham
37806f36c9 Bug 1536804 - Add a mach command to summarise wpt metadata, r=ato
This parses the metadata files without evaluating the conditional
expressions, producing a JSON summary file in which each possible
condition is represented as a string.

Not all data from the metadata files appears in the summary, only
exceptional cases likely to be of interest to engineers and unlikely
to be on wpt.fyi e.g. tests that have lsan leaks or tests that crash,
not just tests that fail. This is intended to keep the filesize down.

Depends on D24177

Differential Revision: https://phabricator.services.mozilla.com/D24178
2019-03-21 12:44:34 +00:00
James Graham
07196f07cc Bug 1511764 - Fixup launching Chrome from ./mach wpt, r=whimboo
Differential Revision: https://phabricator.services.mozilla.com/D19486
2019-02-12 14:32:09 +00:00
James Graham
0de47ec94e Bug 1521072 - Log wpt reftest screenshots on fail when running mach, r=ato
On CI we only want to log screenshots when something unexpected happens since anything
else is rather wasteful of resources. But locally getting screenshots for expected
failures seems helpful for debugging, so worth making the default. Hopefully this isn't
too confusing for people just checking if their patch regresses anything rather than
actively working on fixing failures.

Depends on D16973

Differential Revision: https://phabricator.services.mozilla.com/D16974
2019-01-18 14:21:56 +00:00
James Graham
b5ff92c98b Bug 1521072 - Fix logging screenshots from wpt with mach logger, r=ato
When the logging setup moved to earlier in the setup we ended up setting the
option to enable tbpl-style screenshots from mach after the loggers were already
initalised. Move this to earlier in the command so this option starts working again.

Differential Revision: https://phabricator.services.mozilla.com/D16973
2019-01-18 14:21:32 +00:00
James Graham
f5fd862ef2 Bug 1517322 - Allow LSAN suppressions path to be set from wptrunner command line, r=mccr8
Previously we assumed that the path for the lsan_suppressions.txt file was the same as the prefs path,
which is correct in CI but wrong for local builds. This adds a --lsan-dir command line argument and sets
it in mach to the correct value for local builds and uses the prefs directory as a default for backwards
compatibility

Differential Revision: https://phabricator.services.mozilla.com/D16024
2019-01-09 20:39:40 +00:00
Wes Kocher
9c6e5d8dea Bug 1378310 - Add descriptions to wpt mach commands r=gbrown
Differential Revision: https://phabricator.services.mozilla.com/D15166
2018-12-21 18:55:27 +00:00
James Graham
9853f6a4c2 Bug 1511335 - Fix logging setup for ./mach wpt --product, r=ahal
When running non-Firefox products in wpt we go through the run.py
script from upstream. Therefore we need to initialise the logger in
that module as well as the one in wptrunner now that it's been
properly converted to use logging rather than print statements.

In addition, we change the run.py module to allow passing in logging
defaults for the case where nothing is specified on the command line
since the behaviour for wpt upstream is different to the behaviour for
gecko.

Differential Revision: https://phabricator.services.mozilla.com/D13547
2018-12-04 21:53:27 +00:00
James Graham
cb9bf32b03 Bug 1509983 - Enable wpt android reftests on try/m-c, r=gbrown,ato
Depends on D13089

Differential Revision: https://phabricator.services.mozilla.com/D13090
2018-11-30 15:31:50 +00:00
James Graham
5364532a67 Bug 1508593 - Update the manifest before doing a metadata update, r=ato
The manifest data is used to determine which tests exist, and what type they are

Differential Revision: https://phabricator.services.mozilla.com/D12408
2018-11-20 11:04:30 +00:00
Geoff Brown
c3d7308f77 Bug 1507502 - Check for correct installed package when running mach wpt --package; r=kwierso 2018-11-19 08:28:15 -07:00
James Graham
484bedd512 Bug 1507532 - Set up mach defaults to match working wpt android reftest settings, r=KWierso
The fast internal reftest harness doesn't work yet, so in the meantime
default to the functional but slower external harness. Also ensure
that the Ahem font is installed by default.

Depends on D12035

Differential Revision: https://phabricator.services.mozilla.com/D12036
2018-11-15 20:41:18 +00:00
James Graham
f3c543b3c7 Bug 1500001 - Fixup using non-firefox browsers via mach wpt, r=automatedtester
We need to pass in the extra kwargs that wpt run understands but
wptrunner does not. Ideally we could switch to using the run frontend
always and allow users to actually supply these kwargs, although that
might have some unwanted behaviour, and is a larger change. For now
this gets things working again.

Depends on D9081

Differential Revision: https://phabricator.services.mozilla.com/D9082
2018-10-18 13:39:23 +00:00
James Graham
98541d31a4 Bug 1500081 - Use --install-fonts to install fonts for wptrunner, r=automatedtester
This replaces a previous Firefox-only method except on Windows 7 where
it seems that we have some issues with the registry.

Differential Revision: https://phabricator.services.mozilla.com/D9091
2018-10-18 13:44:36 +00:00