Skip to content

Commit

Permalink
Update async client test
Browse files Browse the repository at this point in the history
  • Loading branch information
rustworthy committed Jan 18, 2024
1 parent d4fe2e0 commit e5c8b35
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/async/proto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ impl<'a, S: AsyncBufReadExt + AsyncWriteExt + Unpin + Send> ReadToken<'a, S> {
#[cfg(test)]
mod test {
use super::{single, AsyncClient};
use crate::proto::{ClientOptions, Hello, Push, EXPECTED_PROTOCOL_VERSION};
use crate::proto::{
get_env_url, host_from_url, url_parse, ClientOptions, Hello, Push,
EXPECTED_PROTOCOL_VERSION,
};
use crate::JobBuilder;
use tokio::io::BufStream;
use tokio::net::TcpStream;
Expand All @@ -189,7 +192,9 @@ mod test {
if std::env::var_os("FAKTORY_URL").is_none() {
return None;

Check warning on line 193 in src/async/proto/mod.rs

View check run for this annotation

Codecov / codecov/patch

src/async/proto/mod.rs#L193

Added line #L193 was not covered by tests
}
let stream = BufStream::new(TcpStream::connect("127.0.0.1:7419").await.unwrap());
let url = url_parse(&get_env_url()).unwrap();
let host = host_from_url(&url);
let stream = BufStream::new(TcpStream::connect(host).await.unwrap());
let opts = ClientOptions::default();
Some(AsyncClient { stream, opts })
}
Expand Down

0 comments on commit e5c8b35

Please sign in to comment.