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.
This commit is contained in:
Jon Seager 2026-02-10 10:44:36 +00:00
parent f6b51ccb38
commit c2b252824d
No known key found for this signature in database
3 changed files with 112 additions and 4 deletions

104
Cargo.lock generated
View file

@ -101,6 +101,15 @@ version = "1.0.101"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" 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]] [[package]]
name = "askama" name = "askama"
version = "0.15.4" version = "0.15.4"
@ -419,6 +428,7 @@ dependencies = [
"slug", "slug",
"sqlx", "sqlx",
"tempfile", "tempfile",
"thirtyfour",
"thiserror 1.0.69", "thiserror 1.0.69",
"tokio", "tokio",
"tower", "tower",
@ -557,6 +567,26 @@ version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" 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]] [[package]]
name = "cookie" name = "cookie"
version = "0.18.1" version = "0.18.1"
@ -780,7 +810,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.52.0", "windows-sys 0.61.2",
] ]
[[package]] [[package]]
@ -1943,7 +1973,7 @@ dependencies = [
"once_cell", "once_cell",
"socket2", "socket2",
"tracing", "tracing",
"windows-sys 0.52.0", "windows-sys 0.60.2",
] ]
[[package]] [[package]]
@ -2168,7 +2198,7 @@ dependencies = [
"errno", "errno",
"libc", "libc",
"linux-raw-sys", "linux-raw-sys",
"windows-sys 0.52.0", "windows-sys 0.61.2",
] ]
[[package]] [[package]]
@ -2320,6 +2350,7 @@ version = "1.0.149"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
dependencies = [ dependencies = [
"indexmap",
"itoa", "itoa",
"memchr", "memchr",
"serde", "serde",
@ -2338,6 +2369,17 @@ dependencies = [
"serde_core", "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]] [[package]]
name = "serde_urlencoded" name = "serde_urlencoded"
version = "0.7.1" version = "0.7.1"
@ -2681,6 +2723,15 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
[[package]]
name = "stringmatch"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6aadc0801d92f0cdc26127c67c4b8766284f52a5ba22894f285e3101fa57d05d"
dependencies = [
"regex",
]
[[package]] [[package]]
name = "stringprep" name = "stringprep"
version = "0.1.5" version = "0.1.5"
@ -2756,7 +2807,46 @@ dependencies = [
"getrandom 0.3.4", "getrandom 0.3.4",
"once_cell", "once_cell",
"rustix", "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]] [[package]]
@ -3114,6 +3204,12 @@ version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
[[package]]
name = "unicode-xid"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]] [[package]]
name = "unicode_categories" name = "unicode_categories"
version = "0.1.1" version = "0.1.1"

View file

@ -40,6 +40,9 @@ uuid = { version = "1", features = ["v4"] }
webauthn-rs = { version = "0.5", features = ["danger-allow-state-serialisation"] } webauthn-rs = { version = "0.5", features = ["danger-allow-state-serialisation"] }
webauthn-rs-proto = "0.5" webauthn-rs-proto = "0.5"
[features]
e2e = []
[dev-dependencies] [dev-dependencies]
portpicker = "0.1" portpicker = "0.1"
reqwest = { version = "0.12", default-features = false, features = ["blocking", "cookies", "rustls-tls"] } 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"] } webauthn-authenticator-rs = { version = "0.5", features = ["softpasskey"] }
wiremock = "0.6" wiremock = "0.6"
paste = "1.0.15" paste = "1.0.15"
thirtyfour = "0.36"
[[test]] [[test]]
name = "cli" name = "cli"
@ -67,6 +71,12 @@ name = "server"
path = "tests/server/main.rs" path = "tests/server/main.rs"
harness = true harness = true
[[test]]
name = "e2e"
path = "tests/e2e/main.rs"
harness = true
required-features = ["e2e"]
[lints.clippy] [lints.clippy]
# Enable pedantic lints with lower priority so individual allows take precedence # Enable pedantic lints with lower priority so individual allows take precedence
pedantic = { level = "warn", priority = -1 } pedantic = { level = "warn", priority = -1 }

View file

@ -137,6 +137,8 @@
] ]
++ (with pkgs; [ ++ (with pkgs; [
cargo-watch cargo-watch
chromedriver
chromium
clang clang
flyctl flyctl
lld lld