Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .skipped-tests
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@
-//rb/spec/integration/selenium/webdriver:element-chrome-bidi
-//rb/spec/integration/selenium/webdriver:element-chrome-remote
-//rb/spec/integration/selenium/webdriver:action_builder-firefox-beta-remote
-//rust/tests/...
1 change: 1 addition & 0 deletions common/remote-build/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ platform(
exec_properties = {
"container-image": "docker://docker.io/selenium/selenium-remote-build@sha256:ca164352826812f02eaa1b4dab89adcf5b3e57deb6798dd9f15d004099db59fe",
"OSFamily": "Linux",
"dockerNetwork": "standard", # Allow internet access for the Rust tests
"dockerReuse": "True",
"dockerRunAsRoot": "False",
"dockerUseEntrypoint": "True",
Expand Down
2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ fs_extra = "1.3.0"

[dev-dependencies]
assert_cmd = "2.0.16"
rstest = "0.19.0"
is_executable = "1.0.4"
rstest = "0.19.0"

[profile.release]
opt-level = 'z' # Optimize for size
Expand Down
15 changes: 12 additions & 3 deletions rust/tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@crates//:defs.bzl", "all_crate_deps")
load("//rust:defs.bzl", "rust_test_suite", "rustfmt_config")
load("//rust:defs.bzl", "rust_library", "rust_test_suite", "rustfmt_config")

rustfmt_config(
name = "enable-rustfmt",
Expand All @@ -10,15 +10,24 @@ rust_test_suite(
size = "small",
srcs = glob(["**/*_tests.rs"]),
data = [
"common.rs",
"//rust:selenium-manager",
],
edition = "2021",
rustc_env = {
"CARGO_BIN_EXE_selenium-manager": "rust/selenium-manager",
},
shared_srcs = glob(
["**/*.rs"],
exclude = ["**/*_tests.rs"],
),
tags = [
"no-sandbox",
"requires-network",
],
deps = ["//rust:selenium_manager"] + all_crate_deps(
deps = [
"//rust:selenium_manager",
"@rules_rust//tools/runfiles",
] + all_crate_deps(
package_name = "rust",
normal = True,
normal_dev = True,
Expand Down
8 changes: 7 additions & 1 deletion rust/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ use std::path::Path;

#[allow(dead_code)]
pub fn get_selenium_manager() -> Command {
Command::new(env!("CARGO_BIN_EXE_selenium-manager"))
let path = env!("CARGO_BIN_EXE_selenium-manager");

if Path::new(path).exists() {
return Command::new(path);
}

panic!("Binary not found {}", path)
}

#[allow(dead_code)]
Expand Down
Loading