From c2b252824dfbf551878253d5a756d9ce0d0e4aef Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 10 Feb 2026 10:44:36 +0000 Subject: [PATCH] feat(test): add e2e test infrastructure with thirtyfour Add thirtyfour WebDriver client as dev-dependency, feature-gated behind --features e2e so normal cargo test is unaffected. Add chromedriver and chromium to the nix devShell. --- Cargo.lock | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++--- Cargo.toml | 10 ++++++ flake.nix | 2 ++ 3 files changed, 112 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da83491..75a55a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -101,6 +101,15 @@ version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" +[[package]] +name = "arc-swap" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ded5f9a03ac8f24d1b8a25101ee812cd32cdc8c50a4c50237de2c4915850e73" +dependencies = [ + "rustversion", +] + [[package]] name = "askama" version = "0.15.4" @@ -419,6 +428,7 @@ dependencies = [ "slug", "sqlx", "tempfile", + "thirtyfour", "thiserror 1.0.69", "tokio", "tower", @@ -557,6 +567,26 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const_format" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "cookie" version = "0.18.1" @@ -780,7 +810,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1943,7 +1973,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -2168,7 +2198,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2320,6 +2350,7 @@ version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ + "indexmap", "itoa", "memchr", "serde", @@ -2338,6 +2369,17 @@ dependencies = [ "serde_core", ] +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2681,6 +2723,15 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "stringmatch" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aadc0801d92f0cdc26127c67c4b8766284f52a5ba22894f285e3101fa57d05d" +dependencies = [ + "regex", +] + [[package]] name = "stringprep" version = "0.1.5" @@ -2756,7 +2807,46 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", +] + +[[package]] +name = "thirtyfour" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48f1edfb88bbdf0365c6dc161e8694ce8414c0b79d0d3a3663b4baac62236be0" +dependencies = [ + "arc-swap", + "async-trait", + "base64 0.22.1", + "bytes", + "cfg-if", + "const_format", + "futures-util", + "http", + "indexmap", + "paste", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "stringmatch", + "thirtyfour-macros", + "thiserror 2.0.18", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "thirtyfour-macros" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cf0ffc3ba4368e99597bd6afd83f4ff6febad66d9ae541ab46e697d32285fc0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", ] [[package]] @@ -3114,6 +3204,12 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "unicode_categories" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 122a353..4a8c07c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,9 @@ uuid = { version = "1", features = ["v4"] } webauthn-rs = { version = "0.5", features = ["danger-allow-state-serialisation"] } webauthn-rs-proto = "0.5" +[features] +e2e = [] + [dev-dependencies] portpicker = "0.1" reqwest = { version = "0.12", default-features = false, features = ["blocking", "cookies", "rustls-tls"] } @@ -48,6 +51,7 @@ once_cell = "1.19" webauthn-authenticator-rs = { version = "0.5", features = ["softpasskey"] } wiremock = "0.6" paste = "1.0.15" +thirtyfour = "0.36" [[test]] name = "cli" @@ -67,6 +71,12 @@ name = "server" path = "tests/server/main.rs" harness = true +[[test]] +name = "e2e" +path = "tests/e2e/main.rs" +harness = true +required-features = ["e2e"] + [lints.clippy] # Enable pedantic lints with lower priority so individual allows take precedence pedantic = { level = "warn", priority = -1 } diff --git a/flake.nix b/flake.nix index 34fb99c..a2e4a84 100644 --- a/flake.nix +++ b/flake.nix @@ -137,6 +137,8 @@ ] ++ (with pkgs; [ cargo-watch + chromedriver + chromium clang flyctl lld