Commit Graph

191 Commits

Author SHA1 Message Date
Alex Gaynor
478321d9d3 Bug 1294641 - whitelist reads from the .app directory in the macOS sandbox r=froydnj,haik
This patch does a few things:
a) Adds the resources location from the .app directory to the read whitelist
b) When it's a non-packaged build, mach run (and various mach tests) set an environment variable for the repo location which we allow reads from.

r=haik,froydnj

MozReview-Commit-ID: KNvAoUs5Ati
2017-04-07 14:53:19 -04:00
Sebastian Hengst
155e26d497 Backed out changeset 225683fed1d1 (bug 1294641) for breaking crashtests, reftests and Windows builds. r=backout on a CLOSED TREE 2017-04-17 16:29:52 +02:00
Alex Gaynor
d7af07ecbe Bug 1294641 - whitelist reads from the .app directory in the macOS sandbox r=froydnj,haik
This patch does a few things:
a) Adds the resources location from the .app directory to the read whitelist
b) When it's a non-packaged build, mach run (and various mach tests) set an environment variable for the repo location which we allow reads from.

r=haik,froydnj

MozReview-Commit-ID: KNvAoUs5Ati
2017-04-07 14:53:19 -04:00
Jan Henning
376f5627c0 Bug 1348114 - Use correct default path for Robocop APK when building with Gradle. r=nalexander
./mach robocop calls through to mochitest_options.py to validate the passed command line options, so it's not necessary to define a default Robocop APK path from two different places.

MozReview-Commit-ID: 8CryDqOKDBF
2017-03-16 22:22:25 +01:00
Andrew Halberstadt
dafb643dec Bug 1328549 - Fix mochitest import error when running via mach, r=jmaher
MozReview-Commit-ID: DulWm9tOIBd
2017-01-04 09:39:42 -05:00
Andrew Halberstadt
c687b7c9a9 Bug 1312739 - Move mochitest 'ALL_FLAVORS' dict from mach_commands.py to mochitest_options.py, r=jmaher
Information in the ALL_FLAVORS dict is needed by interactive loaners (in the mach_test_package_commands.py
file). Because the normal mach_commands.py file doesn't get copied to the tests.zip, this commit refactors
ALL_FLAVORS into mochitest_options.py (which is copied to tests.zip) to avoid duplicating it. A side
benefit of moving ALL_FLAVORS to mochitest_options.py, is that mochitest_options.py itself can make use of
this dict. This means we no longer need to redefine the --flavor argument in the mach command.

The __init__.py file is added to turn the testing/mochitest directory into a python module. This allows
things like mach_commands.py to do things like 'from mochitest import runtests'. Mach commands are able to
find this module because the 'testing' directory is already added to sys.path in the mach bootstrap.

In the future, having mochitest as an importable module should help with running it from the srcdir. So this
is a change we should start making anyway. Unfortunately, we still need to import the main runtests.py file
from the objdir, as lots of things depend on the SCRIPT_DIR variable being in the objdir. We could probably
fix this with minimal work, but that is scope bloat for this bug.

MozReview-Commit-ID: KtWCk91bX0K
2016-12-20 10:50:43 -05:00
Al Tsai
f9c0496764 Bug 1299944 - use default runtests.py if objdir doesn't exists. r=gps
MozReview-Commit-ID: LCMslgCDkVS
2016-12-27 17:33:15 +08:00
Phil Ringnalda
5d05be41ea Backed out 3 changesets (bug 1312739) for "'NoneType' object has no attribute 'startswith'" bustage in everything mochitest
CLOSED TREE

Backed out changeset 1f3f88337227 (bug 1312739)
Backed out changeset ecb1d15e8075 (bug 1312739)
Backed out changeset b2adce340421 (bug 1312739)
2016-12-21 20:19:24 -08:00
Andrew Halberstadt
884161c923 Bug 1312739 - Move mochitest 'ALL_FLAVORS' dict from mach_commands.py to mochitest_options.py, r=jmaher
Information in the ALL_FLAVORS dict is needed by interactive loaners (in the mach_test_package_commands.py
file). Because the normal mach_commands.py file doesn't get copied to the tests.zip, this commit refactors
ALL_FLAVORS into mochitest_options.py (which is copied to tests.zip) to avoid duplicating it. A side
benefit of moving ALL_FLAVORS to mochitest_options.py, is that mochitest_options.py itself can make use of
this dict. This means we no longer need to redefine the --flavor argument in the mach command.

The __init__.py file is added to turn the testing/mochitest directory into a python module. This allows
things like mach_commands.py to do things like 'from mochitest import runtests'. Mach commands are able to
find this module because the 'testing' directory is already added to sys.path in the mach bootstrap.

In the future, having mochitest as an importable module should help with running it from the srcdir. So this
is a change we should start making anyway. Unfortunately, we still need to import the main runtests.py file
from the objdir, as lots of things depend on the SCRIPT_DIR variable being in the objdir. We could probably
fix this with minimal work, but that is scope bloat for this bug.

MozReview-Commit-ID: KtWCk91bX0K
2016-12-20 10:50:43 -05:00
Andrew Halberstadt
8f58c68c91 Bug 1290765 - Install websocketprocessbridge requirements when running media mochitests with mach, r=gps
Automatically install websocketprocessbridge_requirements.txt if we detect the 'media' subsuite will be run.
We need to modify sys.executable so the virtualenv python gets used when starting up the
websocketproccessbridge. We probably should use multiprocessing instead, but that is out of scope for this
bug.

MozReview-Commit-ID: 3lOutbcSzIY
2016-08-23 11:13:19 -04:00
Chris Manchester
8a7e61e6ba Bug 1313716 - Don't provide a blank subsuite as a default in the manifestparser. r=ahal
This causes consumers managing defaults themselves to fail to find a default
subsuite for tests, because the manifestparser will have provided a blank
default value by the time they incorporate defaults into a test definition.
This patch removes the provided defaults and updates a number of places assuming
the 'subsuite' field is always present.

MozReview-Commit-ID: 1jPy52VmEPr
2016-10-31 10:04:42 -07:00
Kris Maglione
247e5c5860 Backed out changeset 425c0602ccb4 (bug 1313716) for breaking mach mochitest. r=backout
MozReview-Commit-ID: pTW1acQYLV
2016-10-30 19:17:13 -07:00
Chris Manchester
168be1651b Bug 1313716 - Don't provide a blank subsuite as a default in the manifestparser. r=ahal
This causes consumers managing defaults themselves to fail to find a default
subsuite for tests, because the manifestparser will have provided a blank
default value by the time they incorporate defaults into a test definition.
This patch removes the provided defaults and updates a number of places assuming
the 'subsuite' field is always present.

MozReview-Commit-ID: 1jPy52VmEPr
2016-10-28 11:07:21 -07:00
Andrew Halberstadt
0b5479bf7c Bug 1308202 - Remove all b2g and mulet related code from testing/mochitest, r=jmaher
MozReview-Commit-ID: BfIJLp6oGHO
2016-10-06 10:05:27 -04:00
Dan Minor
df2c6d0a4d Bug 1306717 - Mach command for mochitests ignores --manifest option; r=ahal
MozReview-Commit-ID: E97QUfdG3sY
2016-10-03 08:23:14 -04:00
Prabhjyot Singh Sodhi
55ca3ed6d4 Bug 1280571 - Add testing/mochitest to the flake8 linter, r=ahal
MozReview-Commit-ID: INBZaZzcPmF
2016-09-28 08:28:04 -04:00
Wes Kocher
18fb5792ef Backed out changeset e1d144423657 (bug 1280571) for making leaks hard to diagnose a=backout CLOSED TREE 2016-09-21 16:56:50 -07:00
Prabhjyot Singh Sodhi
ade7a9a0d9 Bug 1280571 - Add testing/mochitest to the flake8 linter, r=ahal
This also adds E402 (no imports at top of file) to the global ignore list. The
other error codes added were previously ignored by default, but now that we
have started a custom ignore list, need to be listed explicitly.

MozReview-Commit-ID: RtMuVEX6i5
2016-09-21 08:49:46 -04:00
Andrew Halberstadt
0078df5cbd Bug 1294099 - Fix 'Namespace object has no attribute 'flavor'' error when running |mach mochitest|, r=jgriffin
MozReview-Commit-ID: Du2fvVCNeHU
2016-08-10 11:50:29 -04:00
Andrew Halberstadt
9e6b28f4ea Bug 1293295 - Replace all mochitest 'flavor' options with a single --flavor argument, r=jmaher
This accomplishes three things:

1) Easier to use CLI when running without the benefit of testing/mochitest/mach_commands.py
2) Guarantees these arguments are mutually exclusive
3) Simplifies a bunch of logic in the test harness

The primary motivation for this change is to slightly improve the UX when running mochitest
from a taskcluster interactive loaner. However, this is more of a bandaid solution that was
easy to implement before the proper fix in bug 1293259 can be landed.

MozReview-Commit-ID: IeHBGrJ0Sji
2016-08-08 11:48:49 -04:00
Andrew Halberstadt
89985d276b Bug 1292660 - Fix |mach mochitest| kwargs['app'] is None error on android, r=gbrown
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
2016-08-05 16:40:08 -04:00
Andrew Halberstadt
cfc6df1ca7 Bug 1288827 - Allow running mochitest from test-package without specifying --appname, r=armenzg
Because it is now possible for options.app to get set after 'parse_args' time, we need to make sure
the argument validation happens later. To accomplish this we pass in the parser instance to
'run_test_harness' and do parser.validate there. This unfortunately requires some minor uses of
global to accomplish easily due to how mach handles parsers.

MozReview-Commit-ID: s3Js1aZlSE
2016-07-20 11:13:30 -04:00
Carsten "Tomcat" Book
2d709b2fa1 Backed out changeset 6dcb52d270c7 (bug 1288827) for breaking mochitests 2016-07-28 17:04:42 +02:00
Andrew Halberstadt
e77f6c00c3 Bug 1288827 - Allow running mochitest from test-package without specifying --appname, r=armenzg
Because it is now possible for options.app to get set after 'parse_args' time, we need to make sure
the argument validation happens later. To accomplish this we pass in the parser instance to
'run_test_harness' and do parser.validate there. This unfortunately requires some minor uses of
global to accomplish easily due to how mach handles parsers.

MozReview-Commit-ID: s3Js1aZlSE
2016-07-20 11:13:30 -04:00
Wes Kocher
7721e2c661 Backed out changesets baa6c68ec413,5b8583070c9e,2942bb31152c,dd2ad6863f53,c68772362633,c8db6695b991 (bug 1231981) a=backout
MozReview-Commit-ID: EoGyz071RoN
2016-04-27 10:24:37 -07:00
Byron Campen [:bwc]
e66ab5d91c Bug 1231981 - Part 5: Install python packages we need in the virtualenv if not present. r=gps
MozReview-Commit-ID: 9PUHLMxHhQP
2016-03-16 15:40:17 -05:00
Carsten "Tomcat" Book
90b3aaa279 Backed out changeset 5a0d061f7548 (bug 1231981) 2016-04-25 16:28:50 +02:00
Byron Campen [:bwc]
c15bf3c87c Bug 1231981 - Part 5: Install python packages we need in the virtualenv if not present. r=gps
MozReview-Commit-ID: 9PUHLMxHhQP
2016-03-16 15:40:17 -05:00
Chris Manchester
a22312511f Bug 1242051 - Install test files to the objdir lazily rather than with each invocation of mach. r=gps
This moves test installation for test files out of the monolithic install
manifest for $objdir/_tests, and determines the test and support files
to install based on the object derived from all-tests.json. Additionally,
the files resulting from TEST_HARNESS_FILES are installed, as some tests
will depend on them.

As a result, the time to install tests when invoking the test runner will
scale with the number of tests requested to run rather than the entire set
of tests in the tree, resulting in significantly less overhead.

MozReview-Commit-ID: LeIrUVh1yD4
2016-04-04 14:56:52 -07:00
Myk Melez
11388a70ad Bug 1238079 - remove the desktop web runtime; r=fabrice,mossop,gps,jryans,jmaher,marco 2016-03-07 13:33:12 -08:00
Geoff Brown
b96201780b Bug 1241907 - Grant runtime permissions before running browser tests; r=jmaher 2016-02-01 15:52:34 -07:00
Geoff Brown
5b39049b84 Bug 1240767 - Handle incorrect test paths in 'mach robocop'; r=jmaher 2016-01-21 16:59:44 -07:00
Simon Gareste
d03ddfa385 Bug 1231806 - Fix abnormal blank lines quantity. r=ted 2015-12-28 03:23:37 -05:00
Simon Gareste
a31a4bcb8a Bug 1231806 - Fix continuation line under-indented for visual indent. r=ted 2015-12-21 14:22:06 -05:00
Simon Gareste
e4de72b111 Bug 1231806 - Useless import. r=ted 2015-12-21 14:21:51 -05:00
Andrew Halberstadt
91a712cc51 Bug 1225903 - Drop support for b2g desktop in mochitest, r=jgriffin
Mochitests on b2g desktop are no longer being run on any trunk branches, including
b2g-inbound. Dropping support for it significantly reduces complexity
in the mochitest harness.
2015-11-18 13:35:38 -05:00
Wes Kocher
c0a054438a Backed out changeset 6ab228593820 (bug 1225903) for android robocop bustage CLOSED TREE 2015-11-19 11:54:17 -08:00
Andrew Halberstadt
d6e9ed3e7f Bug 1225903 - Drop support for b2g desktop in mochitest, r=jgriffin
Mochitests on b2g desktop are no longer being run on any trunk branches, including
b2g-inbound. Dropping support for it significantly reduces complexity
in the mochitest harness.
2015-11-18 13:35:38 -05:00
Nick Alexander
0354170ec8 Bug 938994 - Move build/mobile/robocop into mobile/android/tests/browser/robocop. r=gbrown
This builds the Robocop tests with |mach build mobile/android|, making
it easier for developers to build Fennec and the tests at the same
time.
2015-11-09 12:55:38 -08:00
Edgar Chen
10b301890f Bug 1211407 - Make |mach mochitest| use the adb under out/host/*/bin if no --adbpath specified. r=ahal 2015-10-05 19:11:52 +08:00
Xidorn Quan
db8948e4e1 Bug 1205144 - Remove 'REMOVED' commands from output of mach-commands and mach-debug-commands. r=gps DONTBUILD 2015-09-21 11:32:03 +10:00
Geoff Brown
7168e54593 Bug 1199377 - Fetch host-utils for Android tests when needed; r=jmaher 2015-09-16 16:58:52 -06:00
Geoff Brown
8c4381b5df Bug 1164596 - Add mach android-emulator command; r=ahal 2015-09-01 15:07:53 -06:00
Vaibhav Agrawal
f103ea8e3b Bug 999450 - Add find-test-chunk command in mach to discover the chunk for a mochitest on a platform. r=chmanchester 2015-08-26 16:51:15 -07:00
Andrew Halberstadt
67cec80bd8 Bug 1185761 - [mochitest] Allow boolean values to --keep-open for overriding the default, r=ted
Most of the time the default is to close the browser after tests run. And that can be overridden with
--keep-open. But in some corner cases, the default is to leave the browser open after tests have run.
In these cases, it is not currently possible to override.

This patch allows the syntax --keep-open or --keep-open=false, the latter overrides the edge case
default.
2015-08-06 17:40:54 -04:00
Myk Melez
d63a645223 Bug 1181867 - move -runtime flag to runtests.py so it gets set in automation; r=jland,ahalberstadt 2015-07-20 09:38:49 -07:00
Geoff Brown
149d025aa3 Bug 1179981 - A new test harness for robocop; r=jmaher 2015-07-09 12:30:01 -06:00
Myk Melez
4eb07e7938 Bug 1168737 - specify runtime with command-line arg on Mac for tests; r=jmaher,marco 2015-06-26 09:22:40 -07:00
Gregory Szorc
d993a444fa Bug 1176642 - Use absolute_import in mach_commands.py files; r=glandium
This removes ambiguity as to which modules are being imported, making
import slightly faster as Python doesn't need to test so many
directories for file presence.

All files should already be using absolute imports because mach command
modules aren't imported to the package they belong to: they instead
belong to the "mach" package. So relative imports shouldn't have been
used.
2015-06-21 17:39:09 -07:00
Andrew Halberstadt
2651e9f398 Bug 1171971 - Move test_paths argument out of mach and into mochitest; remove --test-path, r=chmanchester 2015-06-05 13:28:29 -04:00