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
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
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
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
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
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
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
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
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
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
Removes an unnecessary as_ref() cast, a path coercion, and replaces
try!() with ?.
MozReview-Commit-ID: ASd9kNxDZ3n
--HG--
extra : rebase_source : fa88def64fc3c7ea4520403bfc7b5c391d7f83da
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
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
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
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
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
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
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
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
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
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
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