Skip to content

Commit

Permalink
chore: cargo format
Browse files Browse the repository at this point in the history
  • Loading branch information
w1am committed Feb 6, 2025
1 parent 38d1e8e commit 85a2301
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
3 changes: 2 additions & 1 deletion eventstore/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,8 @@ impl NodeConnection {
roots.add(cert).unwrap();
}
} else {
for cert in rustls_native_certs::load_native_certs().expect("could not load platform certs")
for cert in
rustls_native_certs::load_native_certs().expect("could not load platform certs")
{
roots.add(cert).unwrap();
}
Expand Down
10 changes: 6 additions & 4 deletions eventstore/tests/integration.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
mod api;
mod common;
mod images;
mod plugins;
mod misc;
mod plugins;

use crate::common::{fresh_stream_id, generate_events};
use eventstore::{Client, ClientSettings};
Expand Down Expand Up @@ -161,7 +161,7 @@ async fn wait_for_admin_to_be_available(client: &Client) -> eventstore::Result<(
enum Tests {
Api(ApiTests),
Plugins(PluginTests),
Misc(MiscTests)
Misc(MiscTests),
}

impl Tests {
Expand Down Expand Up @@ -198,7 +198,9 @@ enum MiscTests {
}

impl From<MiscTests> for Tests {
fn from(test: MiscTests) -> Self { Tests::Misc(test) }
fn from(test: MiscTests) -> Self {
Tests::Misc(test)
}
}

enum Topologies {
Expand Down Expand Up @@ -278,7 +280,7 @@ async fn run_test(test: impl Into<Tests>, topology: Topologies) -> eyre::Result<
},

Tests::Misc(test) => match test {
MiscTests::RootCertificates => misc::root_certificates::tests(container_port).await
MiscTests::RootCertificates => misc::root_certificates::tests(container_port).await,
},
};

Expand Down
33 changes: 16 additions & 17 deletions eventstore/tests/misc/root_certificates.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
pub async fn tests(port: u16) -> eyre::Result<()> {
let root_cert = "certs/ca/ca.crt";

let setts = format!(
"esdb://admin:changeit@localhost:{}?tlsVerifyCert=true&tls=true&tlsCaFile={}",
port,
root_cert
)
.parse()?;
let client = eventstore::Client::new(setts)?;

let mut streams = client.read_all(&Default::default()).await?;

streams.next().await?;

Ok(())
}
pub async fn tests(port: u16) -> eyre::Result<()> {
let root_cert = "certs/ca/ca.crt";

let setts = format!(
"esdb://admin:changeit@localhost:{}?tlsVerifyCert=true&tls=true&tlsCaFile={}",
port, root_cert
)
.parse()?;
let client = eventstore::Client::new(setts)?;

let mut streams = client.read_all(&Default::default()).await?;

streams.next().await?;

Ok(())
}

0 comments on commit 85a2301

Please sign in to comment.