Skip to content

Commit a29312f

Browse files
committed
fix test in async
because the api change ,fix the marco in prost Signed-off-by: jokemanfire <[email protected]>
1 parent 4a76b7b commit a29312f

File tree

8 files changed

+26
-7
lines changed

8 files changed

+26
-7
lines changed

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ Cargo.lock
77
*.o
88
example/protocols/**/*.rs
99
src/ttrpc.rs
10-
example2/protocols/**/*.rs
10+
example2/protocols/**/*.rs
11+
!example2/protocols/**/mod.rs

Diff for: Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ build: debug
2525
test:
2626

2727
ifeq ($OS,Windows_NT)
28-
# async isn't enabled for windows, don't test that feature
2928
cargo test --features sync,async,rustprotobuf
3029
else
3130
# cargo test --all-features --verbose
@@ -38,7 +37,10 @@ endif
3837
check:
3938
cargo fmt --all -- --check
4039
cargo clippy --all-targets --features sync,async -- -D warnings
41-
cargo clippy --all-targets --no-default-features --features sync,async,prost -- -D warnings
40+
# now not test prost in windows
41+
ifneq ($OS,Windows_NT)
42+
cargo clippy --all-targets --no-default-features --features sync,async,prost -- -D warnings
43+
endif
4244

4345
.PHONY: check-all
4446
check-all:

Diff for: example/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ description = "An example of ttrpc."
1313
[dev-dependencies]
1414
protobuf = "3.1.0"
1515
bytes = "0.4.11"
16-
libc = "0.2.79"
16+
libc = "0.2.158"
1717
byteorder = "1.3.2"
1818
log = "0.4.6"
1919
simple-logging = "2.0.2"

Diff for: example2/async_client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use ttrpc::r#async::Client;
1212

1313
#[tokio::main(flavor = "current_thread")]
1414
async fn main() {
15-
let c = Client::connect(utils::SOCK_ADDR).unwrap();
15+
let c = Client::connect(utils::SOCK_ADDR).await.unwrap();
1616
let hc = health::HealthClient::new(c.clone());
1717
let ac = agent::AgentServiceClient::new(c);
1818

Diff for: example2/async_stream_client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use ttrpc::r#async::Client;
1414
async fn main() {
1515
simple_logging::log_to_stderr(log::LevelFilter::Info);
1616

17-
let c = Client::connect(utils::SOCK_ADDR).unwrap();
17+
let c = Client::connect(utils::SOCK_ADDR).await.unwrap();
1818
let sc = streaming::StreamingClient::new(c);
1919

2020
let _now = std::time::Instant::now();

Diff for: example2/protocols/asynchronous/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright (c) 2020 Ant Financial
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
#![allow(dead_code)]
7+
8+
include!("_include.rs");

Diff for: example2/protocols/sync/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright (c) 2020 Ant Financial
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
#![allow(dead_code)]
7+
8+
include!("_include.rs");

Diff for: src/asynchronous/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ macro_rules! async_client_stream_receive {
434434
.map_err(::ttrpc::err_to_others!(e, "Encoding error "))?;
435435

436436
let inner = $self.client.new_stream(creq, false, true).await?;
437-
let stream = ::ttrpc::r#async::ClientStreamReceiver::new(inner);
437+
let stream = ::ttrpc::r#async::ClientStreamReceiver::new(inner, $self.client.clone());
438438

439439
return Ok(stream);
440440
};

0 commit comments

Comments
 (0)