Skip to content

Commit

Permalink
fix: Interop runner now uses wasm-browser-run to install chromedriver
Browse files Browse the repository at this point in the history
  • Loading branch information
OtaK committed Jul 31, 2023
1 parent c78f741 commit 14ba9e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion interop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ tokio = { version = "1.20", features = ["full"] }
# Http Server
warp = { version = "0.3", default-features = false }
# Webdriver stuff
webdriver-install = "0.3"
wasm-browser-run = { path = "../extras/wasm-browser-run" }
fantoccini = "0.19"

[dependencies.proteus-wasm]
Expand Down
8 changes: 4 additions & 4 deletions interop/src/build/web/webdriver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ use crate::util::RunningProcess;
use crate::TEST_SERVER_URI;
use color_eyre::eyre::Result;

pub fn setup_webdriver(force: bool) -> Result<()> {
pub async fn setup_webdriver(force: bool) -> Result<()> {
let mut spinner = RunningProcess::new("Setting up WebDriver & co...", false);

let wd_dir = dirs::home_dir().unwrap().join(".webdrivers");
let chrome = webdriver_install::Driver::Chrome;
let chrome = wasm_browser_run::WebdriverKind::Chrome;

if force {
spinner.update("FORCE_WEBDRIVER_INSTALL is set. Forcefully removing webdrivers...");
std::fs::remove_dir(&wd_dir)?;
}

if !wd_dir.join(chrome.as_str()).exists() {
if !wd_dir.join(chrome.as_exe_name()).exists() {
spinner.update("Chrome WebDriver isn't installed. Installing...");
chrome.install()?;
chrome.install_webdriver(&wd_dir, force).await?;
}

spinner.update("Chrome WebDriver installed");
Expand Down
3 changes: 1 addition & 2 deletions interop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ fn run_test() -> Result<()> {
.unwrap();

runtime.block_on(async {
let _ = tokio::task::spawn_blocking(move || build::web::webdriver::setup_webdriver(force_webdriver_install))
.await?;
build::web::webdriver::setup_webdriver(force_webdriver_install).await?;

build::web::wasm::build_wasm().await?;

Expand Down

0 comments on commit 14ba9e3

Please sign in to comment.