Merge branch 'master' into avery/add-e2e-generate-build-test

master
ashley williams 5 years ago committed by GitHub
commit 5f03a21a76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      RELEASE_CHECKLIST.md
  2. 64
      src/test/webdriver/geckodriver.rs

@ -26,6 +26,9 @@ This is a list of the things that need to happen during a release.
1. Run `cargo update`.
1. Run `cargo test`.
1. Run `cargo build`.
1. Copy `README.md` to `npm/README.md`
1. Bump the version number in `npm/package.json`
1. `cd npm && npm install`
1. Push up a commit with the `Cargo.toml`, `Cargo.lock`, `docs/index.html`,
and `CHANGELOG.md` changes. The commit message can just be "#.#.#".
1. Request review from `@ashleygwilliams` and `@drager`.
@ -39,4 +42,5 @@ This is a list of the things that need to happen during a release.
1. `git checkout master` and `git pull --rebase origin master`
1. Run `cargo test`.
1. `cargo publish`
1. `cd npm && npm publish`
1. Tweet.

@ -9,7 +9,8 @@ use target;
// Keep it up to date with each `wasm-pack` release.
// https://github.com/mozilla/geckodriver/releases/latest
const DEFAULT_GECKODRIVER_VERSION: &str = "v0.24.0";
const DEFAULT_GECKODRIVER_VERSION: &str = "v0.26.0";
const DEFAULT_WINDOWS_GECKODRIVER_VERSION: &str = "v0.24.0";
const GECKODRIVER_LAST_UPDATED_STAMP: &str = "geckodriver_last_updated";
const GECKODRIVER_VERSION_STAMP: &str = "geckodriver_version";
@ -20,8 +21,18 @@ pub fn get_or_install_geckodriver(
cache: &Cache,
mode: InstallMode,
) -> Result<PathBuf, failure::Error> {
if let Ok(path) = which::which("geckodriver") {
return Ok(path);
// geckodriver Windows binaries >v0.24.0 have an additional
// runtime dependency that we cannot be sure is present on the
// user's machine
//
// https://github.com/mozilla/geckodriver/issues/1617
//
// until this is resolved, always install v0.24.0 on windows
if !target::WINDOWS {
if let Ok(path) = which::which("geckodriver") {
log::info!("[geckodriver] Found geckodriver at {:?}", path);
return Ok(path);
}
}
install_geckodriver(cache, mode.install_permitted())
}
@ -78,26 +89,37 @@ fn get_geckodriver_url(target: &str, ext: &str) -> String {
.and_then(save_geckodriver_version)
};
let geckodriver_version = match stamps::read_stamps_file_to_json() {
Ok(json) => {
if should_load_geckodriver_version_from_stamp(&json) {
stamps::get_stamp_value(GECKODRIVER_VERSION_STAMP, &json)
} else {
fetch_and_save_version()
let geckodriver_version = if target::WINDOWS {
log::info!(
"[geckodriver] Windows detected, holding geckodriver version to {}",
DEFAULT_WINDOWS_GECKODRIVER_VERSION
);
DEFAULT_WINDOWS_GECKODRIVER_VERSION.to_owned()
} else {
log::info!("[geckodriver] Looking up latest version of geckodriver...");
match stamps::read_stamps_file_to_json() {
Ok(json) => {
if should_load_geckodriver_version_from_stamp(&json) {
stamps::get_stamp_value(GECKODRIVER_VERSION_STAMP, &json)
} else {
fetch_and_save_version()
}
}
Err(_) => fetch_and_save_version(),
}
Err(_) => fetch_and_save_version(),
}
.unwrap_or_else(|error| {
log::warn!(
"Cannot load or fetch geckodriver's latest version data, \
the default version {} will be used. Error: {}",
DEFAULT_GECKODRIVER_VERSION,
error
);
DEFAULT_GECKODRIVER_VERSION.to_owned()
});
assemble_geckodriver_url(&geckodriver_version, target, ext)
.unwrap_or_else(|error| {
log::warn!(
"[geckodriver] Cannot load or fetch geckodriver's latest version data, \
the default version {} will be used. Error: {}",
DEFAULT_GECKODRIVER_VERSION,
error
);
DEFAULT_GECKODRIVER_VERSION.to_owned()
})
};
let url = assemble_geckodriver_url(&geckodriver_version, target, ext);
log::info!("[geckodriver] Fetching geckodriver at {}", url);
url
}
// ------ `get_geckodriver_url` helpers ------

Loading…
Cancel
Save