Граф коммитов

45 Коммитов

Автор SHA1 Сообщение Дата
James Graham 37c0e62643 Bug 1613975 - Convert mozrunner to Rust 2018, r=whimboo,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D62211

--HG--
extra : moz-landing-system : lando
2020-02-10 14:53:42 +00:00
Andreas Tolfsen d4712b7542 bug 1579902: mozrunner: supply mozprofile version dependency; r=webdriver-reviewers,jgraham
Depending on mozprofile by relative path makes it hard to publish
mozrunner to crates.io because cargo is unable to work out the
version range the crate needs.

By specifying both a path and a semver range we ensure mozrunner
uses the in-tree version of mozprofile when building locally,
and the upstream crates.io version when published and used elsewhere.

This means this version number must be bumped every time a new
(backwards incompatible) mozversion is released.

It is debatable whether the version range should be exact, i.e. "0.6.0",
but I opted to go with "0.6" which is how I would normally define
a crate dependency.  As long as mozprofile continues to follow the
principles of semantic versioning this should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D45511

--HG--
extra : moz-landing-system : lando
2019-09-11 12:16:35 +00:00
Andreas Tolfsen 353dfe9cf9 bug 1580269: mozrunner: remove unused moz.build file; r=webdriver-reviewers,whimboo
The moz.build file for the mozrunner crate is not included by the
build system, and the Bugzilla categorisation it attempts to define
is already provided by testing/mozbase/moz.build.

Differential Revision: https://phabricator.services.mozilla.com/D45408

--HG--
extra : moz-landing-system : lando
2019-09-10 19:14:31 +00:00
David Heiberg 94473e6ea9 Bug 1577504 - Replace single match with if let r=jgraham
Depends on D45357

Differential Revision: https://phabricator.services.mozilla.com/D45358

--HG--
extra : moz-landing-system : lando
2019-09-10 15:02:38 +00:00
David Heiberg 9fe96fa22c Bug 1577504 - Remove redundant closures r=jgraham
Depends on D45356

Differential Revision: https://phabricator.services.mozilla.com/D45357

--HG--
extra : moz-landing-system : lando
2019-09-10 15:02:27 +00:00
David Heiberg 7c13b008af Bug 1577504 - Remove explicit lifetimes that can be elided r=jgraham
When there is an input of either &self or &mut self, its lifetime is automatically assigned to the elided output lifetimes

Depends on D45355

Differential Revision: https://phabricator.services.mozilla.com/D45356

--HG--
extra : moz-landing-system : lando
2019-09-10 15:02:15 +00:00
David Heiberg e700524875 Bug 1577504 - Remove redundant field names r=jgraham
Differential Revision: https://phabricator.services.mozilla.com/D45355

--HG--
extra : moz-landing-system : lando
2019-09-10 15:01:37 +00:00
Andreas Tolfsen 43d63b0975 bug 1520585: mozrunner: release 0.10.0; r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D44661

--HG--
extra : moz-landing-system : lando
2019-09-09 11:00:08 +00:00
Andreas Tolfsen 2462dad1df bug 1520585: mozrunner: upgrade plist to 0.5; r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D44659

--HG--
extra : moz-landing-system : lando
2019-09-09 10:59:48 +00:00
Andreas Tolfsen 208fc409a5 bug 1575134: mozrunner: drop fallback firefox_default_path(); r=webdriver-reviewers,jgraham
With bug 1566778 we started searching the system path on BSDs
similarly to how we had done it on Linux.  The patch forgot to
adapt the fallback implementation of the platform module, causing
a compile issue on BSDs since they are now covered by the same
implementation as what used to be Linux-specific.

Differential Revision: https://phabricator.services.mozilla.com/D42625

--HG--
extra : moz-landing-system : lando
2019-08-20 12:07:24 +00:00
James Graham d289d43116 Bug 1573414 - Make geckodriver, webdriver and mozbase #![forbid(unsafe_code)], r=ato
We don't expect to use any unsafe and doing this helps static analysis tools
determine that the library is low risk from the point of view of memory unsafety,
and makes it less likely someone will add in some unsafe code in the future without
appropriate care.

Differential Revision: https://phabricator.services.mozilla.com/D41730

--HG--
extra : moz-landing-system : lando
2019-08-13 13:27:51 +00:00
Andreas Tolfsen 2ce9924f6c bug 1569143: mozrunner: lint; r=webdriver-reviewers,automatedtester
Differential Revision: https://phabricator.services.mozilla.com/D39487

--HG--
extra : moz-landing-system : lando
2019-07-26 12:03:22 +00:00
Andreas Tolfsen bb030bafa9 bug 1566778: mozrunner: search system path on assorted Unices; r=webdriver-reviewers,jgraham
Makes the Linux platform implementation of firefox_default_path()
apply to all flavours of Unix.

It was reported in https://github.com/mozilla/geckodriver/issues/1585
that geckodriver does not search the system path for the Firefox
binary on FreeBSD.

Differential Revision: https://phabricator.services.mozilla.com/D39196

--HG--
extra : moz-landing-system : lando
2019-07-24 14:45:27 +00:00
Emilio Cobos Álvarez 3a16c93150 Bug 1556602 - Fix various warnings with rust 1.37 nightly. r=froydnj
In particular:

 * trait objects without an explicit `dyn` are deprecated
 * `...` range patterns are deprecated

I think these shouldn't really warn by default and should be clippy / opt-in
lints, but anyway, doesn't hurt.

Differential Revision: https://phabricator.services.mozilla.com/D35135

--HG--
extra : moz-landing-system : lando
2019-06-18 21:32:16 +00:00
Nupur Baghel 2c34e28fb4 bug 1529278: mozrunner: support macOS application bundle paths; r=ato 2019-03-15 16:22:37 +00:00
Kriti Singh 1301ea21a7 bug 1529282: mozrunner: support searching for Nightly’s default path on macOS. r=ato 2019-03-15 14:53:07 +00:00
Henrik Skupin 927eabeb98 Bug 1495062 - [mozrunner-rust] Release 0.9.0. r=ato
Depends on D17678

Differential Revision: https://phabricator.services.mozilla.com/D17679

--HG--
extra : moz-landing-system : lando
2019-01-28 15:22:44 +00:00
Henrik Skupin 5c33925458 Bug 1508670 - [mozrunner] Fix Rust code to be compatible with Rust 2018 edition. r=ato
Depends on D13397

Differential Revision: https://phabricator.services.mozilla.com/D13398

--HG--
extra : moz-landing-system : lando
2018-11-29 20:44:15 +00:00
Alex Gaynor 8c784a6c6d Bug 1498247 - Part 3 - switch from using the deprecated env::home_dir() to the dirs crate; r=jgraham
Depends on D8578

Differential Revision: https://phabricator.services.mozilla.com/D8579

--HG--
extra : moz-landing-system : lando
2018-10-12 17:26:21 +00:00
Alex Gaynor b796049372 Bug 1498247 - Part 1 - Add a dependency on dirs for getting the home directory; r=jgraham
Differential Revision: https://phabricator.services.mozilla.com/D8577

--HG--
extra : moz-landing-system : lando
2018-10-12 17:24:43 +00:00
Andreas Tolfsen 3d48e987b5 bug 1466818: mozrunner: release 0.8.0; r=me 2018-09-16 00:32:18 +01:00
ui.manish a5ea6dfab9 Bug 1435552 Remove NO_EM_RESTART from test harnesses; r=gbrown 2018-08-31 15:33:32 +02:00
Andreas Tolfsen 26a47a902a Bug 1441204 - Release mozrunner 0.7.0. r=maja_zf
MozReview-Commit-ID: HszLaFJv2w5

--HG--
extra : rebase_source : d3b32046bb8c6c5db4c578a84ee91ab270e2efbc
2018-06-14 13:26:59 -07:00
Andreas Tolfsen 3239875a26 Bug 1466573 - Start Firefox with -foreground and -no-remote. r=jgraham
Start Firefox with -foreground and -no-remote arguments if they
have not already been given by the user.

-foreground will ensure the application window gets focus when
Firefox is started, and -no-remote will prevent remote commands to
this instance of Firefox and also ensure we always start a new instance.

MozReview-Commit-ID: LGEqgyHYapc

--HG--
extra : rebase_source : 50054e89106421dc6b43bc1f109dc75db37dfd2d
2018-06-05 18:02:34 +01:00
Andreas Tolfsen 93b417ca3d Bug 1466573 - Avoid resetting stdout + stderr. r=jgraham
The std::process::Command's stdout and stderr is configured earlier in
::start(), and resetting it to a static value below would invalidate the
configured stdout and stderr stored in FirefoxRunner::stdout and ::stderr.

We did not notice this bug because geckodriver does not
yet use this feature.  It was added as a precursor for
https://bugzilla.mozilla.org/show_bug.cgi?id=1466573.

MozReview-Commit-ID: CmwqCZpEMqq

--HG--
extra : rebase_source : 209d7cdde8b05db9b7e6f02b221c32a436f2ecdf
2018-06-05 15:08:52 +01:00
Andreas Tolfsen 9dbf303c69 Bug 1466573 - Write profile prefs before constructing command. r=whimboo
MozReview-Commit-ID: 5XWglxjQvZh

--HG--
extra : rebase_source : 98f68088fe81746e7e878c1fa6b8fea3fb3dd150
2018-06-05 15:08:07 +01:00
Andreas Tolfsen 16e1247e4d Bug 1467728 - Fix mozrunner build on macOS. r=whimboo
Bug 1464995 broke mozrunner on macOS, but we did not notice because
geckodriver is not compiled on macOS.  This fixes the build.

MozReview-Commit-ID: GnvZTT30wHG

--HG--
extra : rebase_source : 6e5b5b37d0c962c75a2a4b41c004f9cf47c2e8a2
2018-06-08 14:24:58 +01:00
Andreas Tolfsen 16b85ecaa0 Bug 1464995 - Ensure found Firefox is an executable binary. r=jgraham,whimboo
mozrunner fails to locate the correct binary if Firefox is found
under a "firefox" or "firefox-bin" (depending on the system)
because it thinks the parent directory is the executable.

On Unix systems, mozrunner also falsely reports non-executable
files as valid binaries.

This patch introduces a new mozrunner::path module that provides
two functions: one for searching the system path for a binary by a
given name, and another for checking whether a path is an executable
binary file.

MozReview-Commit-ID: 6N06CXZZWqd

--HG--
extra : rebase_source : dbcb4d6d8478bafc23c1aa2a3081589074908bbc
2018-05-29 17:10:26 +01:00
Andreas Tolfsen eb6512097e Bug 1464995 - Minor readability lints. r=whimboo
Removes an unnecessary as_ref() cast, a path coercion, and replaces
try!() with ?.

MozReview-Commit-ID: ASd9kNxDZ3n

--HG--
extra : rebase_source : fa88def64fc3c7ea4520403bfc7b5c391d7f83da
2018-05-29 17:10:07 +01:00
Andreas Tolfsen 50aa8dc506 Bug 1464995 - Document mozrunner::firefox_default_path(). r=whimboo
The method we use to find the Firefox binary varies from platform
to platform.  It can be useful to document how each of the system
specific implementations are meant to work.

MozReview-Commit-ID: 4SrNmlp3AdS

--HG--
extra : rebase_source : f1d54548edb416912af3a0a6d41188d0640a3ffb
2018-05-29 17:08:14 +01:00
Andreas Tolfsen 2efb6af857 Bug 1448900 - Release mozrunner 0.6.1. r=whimboo
One change since 0.6.0, which is a regression fix for a fallout
from bug 1443853.

MozReview-Commit-ID: 56GbEV4HM4v

--HG--
extra : rebase_source : 0e14fa63f00f1661cae01a10c76c2813d349ba1b
2018-03-28 17:28:29 +01:00
Andreas Tolfsen 73c11c00a8 Bug 1448900 - Avoid killing exited process. r=jgraham,whimboo
std::process::Child::kill() will return Err if the process has
already exited.  The assumption in bug 1443853 was that calling
::kill() would consistently return the std::process::ExitStatus
was the process already dead.

This patches the regression from bug 1443853 by employing
Child::try_wait() in a loop.  When the process gives some exit status,
this is return directly without relying on Child::kill() as before.

If the process has not exited and the timeout has elapsed, we kill
the process and return its return value.  If the process has not
exited but the timeout duration has not elapsed, we wait 100 ms as before.

MozReview-Commit-ID: 4VENbrKtcEh

--HG--
extra : rebase_source : 7f27ed057da740306367ef2b6a87f8ac6a242541
2018-03-28 17:17:29 +01:00
Andreas Tolfsen 6b09cf8df1 Bug 1401129 - Release mozrunner 0.6.0. r=whimboo
MozReview-Commit-ID: 2nljPi3HN5b

--HG--
extra : rebase_source : 7e1cd2201937b5bb47fe81bcdbd6c1bc068b92b5
2018-03-08 14:26:10 +00:00
Andreas Tolfsen 98cdaaee72 Bug 1443853 - Move browser process shutdown monitor to mozrunner. r=jgraham
This moves the shutdown monitor for the Firefox process from
geckodriver to mozrunner, which is a more suitable home for it.
We will likely need specialised versions of this in the future with
products such as GeckoView and Fennec.

In addition to the move it also cleans up the polling loop by
employing std::time::SystemTime which lets us match on the elapsed
time since its construction.  This seems nicer than having to perform
division operations on integers, which in Rust are inherently unsafe
(there is no guard against SIGFPE).

This change should be functionally equivalent to the existing code.

MozReview-Commit-ID: 1asnFbixhcY

--HG--
extra : rebase_source : f21f734862bfbbc1ed665dc9c9f611c5968d662f
2018-03-07 21:57:53 +00:00
Andreas Tolfsen 1509c2ba22 Bug 1443853 - Rename RunnerProcess::status() to ::try_wait(). r=jgraham
This renames RunnerProcess::status() to ::try_wait() for symmetry
with std::process::Child::try_wait() in the standard library.

The patch also makes an attempt at cleaning up its usage in geckodriver,
however this can be further improved.

MozReview-Commit-ID: 14ihT7MpM7l

--HG--
extra : rebase_source : 4e96c79c6ebbb256c4a08cb4dd86c99aacaa13ac
2018-03-07 21:43:49 +00:00
Andreas Tolfsen f57be4355e Bug 1443853 - Avoid std::io::{Result,Error} renaming. r=jgraham
We can pick up std::io::Result and std::io::Error directly from
the std::io namespace without having to rename them.

MozReview-Commit-ID: 9Xz92HvcFpO

--HG--
extra : rebase_source : 89a006c40e11d9e7fc5706d3a6612f916e00f919
2018-03-07 21:31:31 +00:00
Andreas Tolfsen a1615d76ac Bug 1443853 - Rename RunnerProcess::stop() to ::kill(). r=jgraham
This renames RunnerProcess::stop() to ::kill() for symmetry with
the standard library's std::process::Child.

MozReview-Commit-ID: 20vSni9bA0X

--HG--
extra : rebase_source : 112b29249563154b50d9a72c141034e5cdf7f19b
2018-03-07 21:29:23 +00:00
Andreas Tolfsen ecbbc100b2 Bug 1443853 - Rename RunnerProcess::is_running() to ::running(). r=jgraham
The ideom for getters in Rust is to not prefix them with "is_".
Setters should, however, have the "set_" prefix.

MozReview-Commit-ID: 9kXHBYGK7aL

--HG--
extra : rebase_source : 6c2591771646c8b7c5b0e6b1af5427455938b4cf
2018-03-07 21:23:57 +00:00
Andreas Tolfsen 8e428fe6bb Bug 1443853 - Drop unused std::ascii::AsciiExt trait. r=jgraham
Silences another compiler warning.

MozReview-Commit-ID: 6Bcw7Ej9uIC

--HG--
extra : rebase_source : 4f6d8522434fed7e673b71d028dce53753f4a3e5
2018-03-07 21:27:18 +00:00
Andreas Tolfsen 86adc06b32 Bug 1439331 - Upgrade mozrunner log dependency to 0.4. r=jgraham
MozReview-Commit-ID: 96rHwvsIEik

--HG--
extra : rebase_source : 8dc84880d8b1f9cba778c55dabb1cfd2cd31257f
2018-02-19 12:46:53 +01:00
Andreas Tolfsen 14bddc03aa Bug 1437571 - Upgrade to winreg v0.5.0. r=jgraham
Output from "./mach vendor rust":

    Removing advapi32-sys v0.1.2
    Removing kernel32-sys v0.1.4
    Removing ktmw32-sys v0.1.0
      Adding winapi v0.3.4
      Adding winapi-i686-pc-windows-gnu v0.4.0
      Adding winapi-x86_64-pc-windows-gnu v0.4.0
    Updating winreg v0.3.5 -> v0.5.0

MozReview-Commit-ID: 5IP63yfo34S
2018-02-14 20:48:17 +00:00
Andreas Tolfsen 6505810ac8 Bug 1430157 - Move geckodriver to use in-tree mozprofile. r=jgraham
The third_party/rust/mozprofile has not been deleted because mozrunner
also depends on it.  We will have to run "./mach vendor rust" again
once both these changes have landed in order to remove the third-party
dependency from crates.io.  This work is tracked in bug 1430158.

MozReview-Commit-ID: 5Q3PdTS03wm

--HG--
extra : rebase_source : a3b52bcb4c2047ddd81b830e4e2f349d8396ee79
2018-01-12 16:21:17 +00:00
James Graham 3ecd324bdc Bug 1431459 - Update rust_mozrunner to use a Builder API, r=ato
This is a major API revision to replace the Python-like API with
something more idiomatically Rust. In particular you now create a
FirefoxRunner object and then call start() and end up with a
FirefoxProcess. This is pretty similar to the Command builder in std.

MozReview-Commit-ID: DmEfIfKSukA

--HG--
extra : rebase_source : 30fba6b2d9584a8a4128b641747beda1d264f7c5
2017-12-19 18:39:10 +00:00
Andreas Tolfsen 3191505dda Bug 1429511 - Update mozrunner crate repo URL. r=jgraham
MozReview-Commit-ID: 8NCsKp4q2JQ

--HG--
extra : rebase_source : 1a5974df3f7305c475da6e098ffb3e8d845f8949
2018-01-12 16:12:30 +00:00
Andreas Tolfsen 20a835e1f9 Bug 1429511 - Move Rust port of mozrunner to central. r=ahal
This moves the Rust crate mozrunner into central from GitHub.
The old repository will be graveyarded:

	https://github.com/jgraham/rust_mozrunner

The git history is not considered important, hence this does not
overlay that onto central like we did for testing/geckodriver and
testing/webdriver.

MozReview-Commit-ID: J4ZYdow2Lkw

--HG--
extra : rebase_source : 1b499b708105a89a5fa3ae6ecac71c4946e20755
2018-01-12 15:31:20 +00:00