Skip to content

Commit 99b663e

Browse files
authored
chore(test): Move integration test for tonic-web to tests directory (#1927)
1 parent ffd7794 commit 99b663e

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ members = [
2222
"tests/stream_conflict",
2323
"tests/root-crate-path",
2424
"tests/compression",
25-
"tonic-web/tests/integration",
25+
"tests/web",
2626
"tests/service_named_result",
2727
"tests/use_arc_self",
2828
"tests/default_stubs",

tonic-web/tests/integration/Cargo.toml renamed to tests/web/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["Juan Alvarez <j@yabit.io>"]
33
edition = "2021"
4-
name = "integration"
4+
name = "test_web"
55
publish = false
66
version = "0.1.0"
77
license = "MIT"
@@ -16,10 +16,10 @@ hyper-util = "0.1"
1616
prost = "0.13"
1717
tokio = { version = "1", features = ["macros", "rt", "net"] }
1818
tokio-stream = { version = "0.1", features = ["net"] }
19-
tonic = { path = "../../../tonic" }
19+
tonic = { path = "../../tonic" }
2020

2121
[dev-dependencies]
22-
tonic-web = { path = "../../../tonic-web" }
22+
tonic-web = { path = "../../tonic-web" }
2323

2424
[build-dependencies]
25-
tonic-build = { path = "../../../tonic-build" }
25+
tonic-build = { path = "../../tonic-build" }
File renamed without changes.
File renamed without changes.
File renamed without changes.

tonic-web/tests/integration/tests/grpc.rs renamed to tests/web/tests/grpc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use tokio_stream::{self as stream, StreamExt};
99
use tonic::transport::{Channel, Error, Server};
1010
use tonic::{Response, Streaming};
1111

12-
use integration::pb::{test_client::TestClient, test_server::TestServer, Input};
13-
use integration::Svc;
12+
use test_web::pb::{test_client::TestClient, test_server::TestServer, Input};
13+
use test_web::Svc;
1414
use tonic_web::GrpcWebLayer;
1515

1616
#[tokio::test]

tonic-web/tests/integration/tests/grpc_web.rs renamed to tests/web/tests/grpc_web.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use tokio_stream::wrappers::TcpListenerStream;
1414
use tonic::body::BoxBody;
1515
use tonic::transport::Server;
1616

17-
use integration::pb::{test_server::TestServer, Input, Output};
18-
use integration::Svc;
17+
use test_web::pb::{test_server::TestServer, Input, Output};
18+
use test_web::Svc;
1919
use tonic::Status;
2020
use tonic_web::GrpcWebLayer;
2121

@@ -117,7 +117,7 @@ fn build_request(base_uri: String, content_type: &str, accept: &str) -> Request<
117117

118118
let bytes = match content_type {
119119
"grpc-web" => encode_body(),
120-
"grpc-web-text" => integration::util::base64::STANDARD
120+
"grpc-web-text" => test_web::util::base64::STANDARD
121121
.encode(encode_body())
122122
.into(),
123123
_ => panic!("invalid content type {}", content_type),
@@ -139,7 +139,7 @@ async fn decode_body(body: Incoming, content_type: &str) -> (Output, Bytes) {
139139
let mut body = body.collect().await.unwrap().to_bytes();
140140

141141
if content_type == "application/grpc-web-text+proto" {
142-
body = integration::util::base64::STANDARD
142+
body = test_web::util::base64::STANDARD
143143
.decode(body)
144144
.unwrap()
145145
.into()

0 commit comments

Comments
 (0)