fix: add rustls provider for HTTPS tests
Some checks failed
Test / rust-clippy (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Has been cancelled
Test / frontend-typecheck (pull_request) Has been cancelled
Test / rust-tests (pull_request) Has been cancelled
Test / rust-fmt-check (pull_request) Has been cancelled
PR Review Automation / review (pull_request) Successful in 2m44s
Some checks failed
Test / rust-clippy (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Has been cancelled
Test / frontend-typecheck (pull_request) Has been cancelled
Test / rust-tests (pull_request) Has been cancelled
Test / rust-fmt-check (pull_request) Has been cancelled
PR Review Automation / review (pull_request) Successful in 2m44s
- Add rustls dependency with aws_lc_rs feature to dev-dependencies - Initialize rustls provider in MCP transport tests - Fixes pre-existing test failures in mcp::transport::http module
This commit is contained in:
parent
c4bb08b462
commit
7ff4f690a3
@ -64,6 +64,7 @@ portable-pty = "0.8"
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tokio-test = "0.4"
|
tokio-test = "0.4"
|
||||||
mockito = "1.2"
|
mockito = "1.2"
|
||||||
|
rustls = { version = "0.23", features = ["aws_lc_rs"] }
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = "s"
|
opt-level = "s"
|
||||||
|
|||||||
@ -260,6 +260,7 @@ mod tests {
|
|||||||
// Transport building tests (verify no panics with Tokio runtime)
|
// Transport building tests (verify no panics with Tokio runtime)
|
||||||
#[test]
|
#[test]
|
||||||
fn test_builds_transport_with_http() {
|
fn test_builds_transport_with_http() {
|
||||||
|
init_rustls_provider();
|
||||||
let rt = tokio::runtime::Runtime::new().unwrap();
|
let rt = tokio::runtime::Runtime::new().unwrap();
|
||||||
let _guard = rt.enter();
|
let _guard = rt.enter();
|
||||||
let _transport = build_http_transport("http://localhost:8080", None, HashMap::new());
|
let _transport = build_http_transport("http://localhost:8080", None, HashMap::new());
|
||||||
@ -267,6 +268,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_builds_transport_with_https() {
|
fn test_builds_transport_with_https() {
|
||||||
|
init_rustls_provider();
|
||||||
let rt = tokio::runtime::Runtime::new().unwrap();
|
let rt = tokio::runtime::Runtime::new().unwrap();
|
||||||
let _guard = rt.enter();
|
let _guard = rt.enter();
|
||||||
let _transport = build_http_transport("https://example.com/mcp", None, HashMap::new());
|
let _transport = build_http_transport("https://example.com/mcp", None, HashMap::new());
|
||||||
@ -274,6 +276,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_builds_transport_with_auth() {
|
fn test_builds_transport_with_auth() {
|
||||||
|
init_rustls_provider();
|
||||||
let rt = tokio::runtime::Runtime::new().unwrap();
|
let rt = tokio::runtime::Runtime::new().unwrap();
|
||||||
let _guard = rt.enter();
|
let _guard = rt.enter();
|
||||||
let _transport = build_http_transport(
|
let _transport = build_http_transport(
|
||||||
@ -282,4 +285,10 @@ mod tests {
|
|||||||
HashMap::new(),
|
HashMap::new(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
fn init_rustls_provider() {
|
||||||
|
// Initialize rustls crypto provider for HTTPS tests
|
||||||
|
let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user