Skip to content

Commit d09c30d

Browse files
committed
Migrate to test-log
1 parent b33700b commit d09c30d

File tree

5 files changed

+50
-50
lines changed

5 files changed

+50
-50
lines changed

base-library/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ tower = { version = "0.4", features = [ "util" ] }
2929
[dev-dependencies]
3030
env_logger = "^0.8"
3131
tokio = { version = "^1.4", features = [ "macros", "rt" ] }
32-
test-env-log = "0.2"
32+
test-log = "0.2"

base-library/src/aws4.rs

+31-31
Original file line numberDiff line numberDiff line change
@@ -21,185 +21,185 @@ const TEST_REGION: &str = "us-east-1";
2121
const TEST_SERVICE: &str = "service";
2222

2323
#[tokio::test]
24-
#[test_env_log::test]
24+
#[test_log::test]
2525
async fn get_header_key_duplicate_get_header_key_duplicate() {
2626
run("get-header-key-duplicate/get-header-key-duplicate").await;
2727
}
2828

2929
// Canonical request is contrary to RFC 2616
3030
// #[tokio::test]
31-
// #[test_env_log::test]
31+
// #[test_log::test]
3232
// async fn get_header_value_multiline_get_header_value_multiline() {
3333
// run("get-header-value-multiline/get-header-value-multiline").await;
3434
// }
3535

3636
#[tokio::test]
37-
#[test_env_log::test]
37+
#[test_log::test]
3838
async fn get_header_value_order_get_header_value_order() {
3939
run("get-header-value-order/get-header-value-order").await;
4040
}
4141

4242
#[tokio::test]
43-
#[test_env_log::test]
43+
#[test_log::test]
4444
async fn get_header_value_trim_get_header_value_trim() {
4545
run("get-header-value-trim/get-header-value-trim").await;
4646
}
4747

4848
#[tokio::test]
49-
#[test_env_log::test]
49+
#[test_log::test]
5050
async fn get_unreserved_get_unreserved() {
5151
run("get-unreserved/get-unreserved").await;
5252
}
5353

5454
// This encoding issue is taken care of by the frontend.
5555
// #[tokio::test]
56-
// #[test_env_log::test]
56+
// #[test_log::test]
5757
// async fn get_utf8_get_utf8() {
5858
// run("get-utf8/get-utf8").await;
5959
// }
6060

6161
#[tokio::test]
62-
#[test_env_log::test]
62+
#[test_log::test]
6363
async fn get_vanilla_empty_query_key_get_vanilla_empty_query_key() {
6464
run("get-vanilla-empty-query-key/get-vanilla-empty-query-key").await;
6565
}
6666

6767
#[tokio::test]
68-
#[test_env_log::test]
68+
#[test_log::test]
6969
async fn get_vanilla_query_order_key_case_get_vanilla_query_order_key_case() {
7070
run("get-vanilla-query-order-key-case/get-vanilla-query-order-key-case").await;
7171
}
7272

7373
#[tokio::test]
74-
#[test_env_log::test]
74+
#[test_log::test]
7575
async fn get_vanilla_query_order_key_get_vanilla_query_order_key() {
7676
run("get-vanilla-query-order-key/get-vanilla-query-order-key").await;
7777
}
7878

7979
#[tokio::test]
80-
#[test_env_log::test]
80+
#[test_log::test]
8181
async fn get_vanilla_query_order_value_get_vanilla_query_order_value() {
8282
run("get-vanilla-query-order-value/get-vanilla-query-order-value").await;
8383
}
8484

8585
#[tokio::test]
86-
#[test_env_log::test]
86+
#[test_log::test]
8787
async fn get_vanilla_query_unreserved_get_vanilla_query_unreserved() {
8888
run("get-vanilla-query-unreserved/get-vanilla-query-unreserved").await;
8989
}
9090

9191
#[tokio::test]
92-
#[test_env_log::test]
92+
#[test_log::test]
9393
async fn get_vanilla_query_get_vanilla_query() {
9494
run("get-vanilla-query/get-vanilla-query").await;
9595
}
9696

9797
// This encoding issue is taken care of/rejected by the frontend.
9898
// #[tokio::test]
99-
// #[test_env_log::test]
99+
// #[test_log::test]
100100
// async fn get_vanilla_utf8_query_get_vanilla_utf8_query() {
101101
// run("get-vanilla-utf8-query/get-vanilla-utf8-query").await;
102102
// }
103103

104104
#[tokio::test]
105-
#[test_env_log::test]
105+
#[test_log::test]
106106
async fn get_vanilla_get_vanilla() {
107107
run("get-vanilla/get-vanilla").await;
108108
}
109109

110110
#[tokio::test]
111-
#[test_env_log::test]
111+
#[test_log::test]
112112
async fn normalize_path_get_relative_relative_get_relative_relative() {
113113
run("normalize-path/get-relative-relative/get-relative-relative").await;
114114
}
115115

116116
#[tokio::test]
117-
#[test_env_log::test]
117+
#[test_log::test]
118118
async fn normalize_path_get_relative_get_relative() {
119119
run("normalize-path/get-relative/get-relative").await;
120120
}
121121

122122
#[tokio::test]
123-
#[test_env_log::test]
123+
#[test_log::test]
124124
async fn normalize_path_get_slash_dot_slash_get_slash_dot_slash() {
125125
run("normalize-path/get-slash-dot-slash/get-slash-dot-slash").await;
126126
}
127127

128128
#[tokio::test]
129-
#[test_env_log::test]
129+
#[test_log::test]
130130
async fn normalize_path_get_slash_pointless_dot_get_slash_pointless_dot() {
131131
run("normalize-path/get-slash-pointless-dot/get-slash-pointless-dot").await;
132132
}
133133

134134
#[tokio::test]
135-
#[test_env_log::test]
135+
#[test_log::test]
136136
async fn normalize_path_get_slash_get_slash() {
137137
run("normalize-path/get-slash/get-slash").await;
138138
}
139139

140140
#[tokio::test]
141-
#[test_env_log::test]
141+
#[test_log::test]
142142
async fn normalize_path_get_slashes_get_slashes() {
143143
run("normalize-path/get-slashes/get-slashes").await;
144144
}
145145

146146
// This encoding issue is taken care of by the HTTP frontend.
147147
// #[tokio::test]
148-
// #[test_env_log::test]
148+
// #[test_log::test]
149149
// async fn normalize_path_get_space_get_space() {
150150
// run("normalize-path/get-space/get-space").await;
151151
// }
152152

153153
#[tokio::test]
154-
#[test_env_log::test]
154+
#[test_log::test]
155155
async fn post_header_key_case_post_header_key_case() {
156156
run("post-header-key-case/post-header-key-case").await;
157157
}
158158

159159
#[tokio::test]
160-
#[test_env_log::test]
160+
#[test_log::test]
161161
async fn post_header_key_sort_post_header_key_sort() {
162162
run("post-header-key-sort/post-header-key-sort").await;
163163
}
164164

165165
#[tokio::test]
166-
#[test_env_log::test]
166+
#[test_log::test]
167167
async fn post_header_value_case_post_header_value_case() {
168168
run("post-header-value-case/post-header-value-case").await;
169169
}
170170

171171
#[tokio::test]
172-
#[test_env_log::test]
172+
#[test_log::test]
173173
async fn post_sts_token_post_sts_header_after_post_sts_header_after() {
174174
run("post-sts-token/post-sts-header-after/post-sts-header-after").await;
175175
}
176176

177177
#[tokio::test]
178-
#[test_env_log::test]
178+
#[test_log::test]
179179
async fn post_sts_token_post_sts_header_before_post_sts_header_before() {
180180
run("post-sts-token/post-sts-header-before/post-sts-header-before").await;
181181
}
182182

183183
#[tokio::test]
184-
#[test_env_log::test]
184+
#[test_log::test]
185185
async fn post_vanilla_empty_query_value_post_vanilla_empty_query_value() {
186186
run("post-vanilla-empty-query-value/post-vanilla-empty-query-value").await;
187187
}
188188

189189
#[tokio::test]
190-
#[test_env_log::test]
190+
#[test_log::test]
191191
async fn post_vanilla_query_post_vanilla_query() {
192192
run("post-vanilla-query/post-vanilla-query").await;
193193
}
194194

195195
#[tokio::test]
196-
#[test_env_log::test]
196+
#[test_log::test]
197197
async fn post_vanilla_post_vanilla() {
198198
run("post-vanilla/post-vanilla").await;
199199
}
200200

201201
#[tokio::test]
202-
#[test_env_log::test]
202+
#[test_log::test]
203203
async fn post_x_www_form_urlencoded_parameters_post_x_www_form_urlencoded_parameters() {
204204
run("post-x-www-form-urlencoded-parameters/post-x-www-form-urlencoded-parameters").await;
205205
}
@@ -209,7 +209,7 @@ This test is disabled for now -- it does not seem to encode the signed request
209209
properly.
210210
211211
#[tokio::test]
212-
#[test_env_log::test]
212+
#[test_log::test]
213213
async fn post_x_www_form_urlencoded_post_x_www_form_urlencoded() {
214214
run("post-x-www-form-urlencoded/post-x-www-form-urlencoded").await;
215215
}

base-library/src/unittest.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use http::{
1111
uri::{PathAndQuery, Uri},
1212
};
1313
use scratchstack_aws_principal::PrincipalActor;
14-
use test_env_log::{self, test};
14+
use test_log::{self, test};
1515
use tokio;
1616

1717
const TEST_REGION: &str = "us-east-1";
@@ -265,7 +265,7 @@ async fn run_auth_test_get_err(auth_str: &str) -> SignatureError {
265265
}
266266

267267
#[tokio::test]
268-
#[test_env_log::test]
268+
#[test_log::test]
269269
async fn test_missing_auth_parameters() {
270270
assert_eq!(
271271
run_auth_test!("AWS4-HMAC-SHA256 "),
@@ -274,7 +274,7 @@ async fn test_missing_auth_parameters() {
274274
}
275275

276276
#[tokio::test]
277-
#[test_env_log::test]
277+
#[test_log::test]
278278
async fn test_missing_auth_signed_headers() {
279279
assert_eq!(
280280
run_auth_test!(
@@ -288,7 +288,7 @@ Signature=c9d5ea9f3f72853aea855b47ea873832890dbdd183b4468f858259531a5138ea"
288288
}
289289

290290
#[tokio::test]
291-
#[test_env_log::test]
291+
#[test_log::test]
292292
async fn test_missing_auth_credential() {
293293
assert_eq!(
294294
run_auth_test!(
@@ -302,7 +302,7 @@ Signature=c9d5ea9f3f72853aea855b47ea873832890dbdd183b4468f858259531a5138ea"
302302
}
303303

304304
#[tokio::test]
305-
#[test_env_log::test]
305+
#[test_log::test]
306306
async fn test_duplicate_auth_credential() {
307307
assert_eq!(
308308
run_auth_test!(
@@ -318,7 +318,7 @@ Signature=c9d5ea9f3f72853aea855b47ea873832890dbdd183b4468f858259531a5138ea"
318318
}
319319

320320
#[tokio::test]
321-
#[test_env_log::test]
321+
#[test_log::test]
322322
async fn test_missing_auth_signature() {
323323
assert_eq!(
324324
run_auth_test!(
@@ -332,7 +332,7 @@ SignedHeaders=host;x-amz-date"
332332
}
333333

334334
#[tokio::test]
335-
#[test_env_log::test]
335+
#[test_log::test]
336336
async fn test_missing_auth_eq() {
337337
assert_eq!(
338338
run_auth_test!(
@@ -347,7 +347,7 @@ Signature=c9d5ea9f3f72853aea855b47ea873832890dbdd183b4468f858259531a5138ea"
347347
}
348348

349349
#[tokio::test]
350-
#[test_env_log::test]
350+
#[test_log::test]
351351
async fn test_noncanonical_signed_headers() {
352352
assert_eq!(
353353
run_auth_test!(
@@ -361,13 +361,13 @@ Signature=c9d5ea9f3f72853aea855b47ea873832890dbdd183b4468f858259531a5138ea"
361361
}
362362

363363
#[tokio::test]
364-
#[test_env_log::test]
364+
#[test_log::test]
365365
async fn test_wrong_auth_algorithm() {
366366
assert_eq!(run_auth_test_expect_kind!("AWS3-ZZZ Credential=12345", MissingHeader), "Missing header: authorization");
367367
}
368368

369369
#[tokio::test]
370-
#[test_env_log::test]
370+
#[test_log::test]
371371
async fn test_multiple_algorithms() {
372372
let mut headers = HeaderMap::<HeaderValue>::with_capacity(2);
373373
headers.append("authorization", HeaderValue::from_static("Basic foobar"));
@@ -391,7 +391,7 @@ async fn test_multiple_algorithms() {
391391
}
392392

393393
#[tokio::test]
394-
#[test_env_log::test]
394+
#[test_log::test]
395395
async fn duplicate_query_parameter() {
396396
let headers = HeaderMap::new();
397397

@@ -410,7 +410,7 @@ async fn duplicate_query_parameter() {
410410
}
411411

412412
#[test]
413-
#[test_env_log::test]
413+
#[test_log::test]
414414
fn missing_header() {
415415
let mut headers = HeaderMap::<HeaderValue>::with_capacity(1);
416416
headers.insert("authorization", HeaderValue::from_static(""));
@@ -426,7 +426,7 @@ fn missing_header() {
426426
}
427427

428428
#[test]
429-
#[test_env_log::test]
429+
#[test_log::test]
430430
fn missing_date() {
431431
let mut headers = HeaderMap::<HeaderValue>::with_capacity(2);
432432
headers.insert("authorization", HeaderValue::from_static(_AUTH_HEADER1));
@@ -444,7 +444,7 @@ fn missing_date() {
444444
}
445445

446446
#[test]
447-
#[test_env_log::test]
447+
#[test_log::test]
448448
fn invalid_date() {
449449
let mut headers = HeaderMap::<HeaderValue>::with_capacity(2);
450450
headers.insert("authorization", HeaderValue::from_static(_AUTH_HEADER1));

hyper-integration/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ hyper = { version = "^0.14", features = [ "client", "server", "stream", "tcp", "
3030
rusoto_core = "^0.46"
3131
rusoto_credential = "^0.46"
3232
rusoto_signature = "^0.46"
33-
test-env-log = "^0.2"
33+
test-log = "^0.2"

hyper-integration/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mod tests {
3333
use tokio;
3434
use tower::{BoxError, Service};
3535

36-
#[test_env_log::test(tokio::test)]
36+
#[test_log::test(tokio::test)]
3737
async fn test_fn_wrapper() {
3838
let sigfn = get_signing_key_fn(get_creds_fn);
3939
let wrapped = service_fn(hello_response);
@@ -90,7 +90,7 @@ mod tests {
9090
}
9191
}
9292

93-
#[test_env_log::test(tokio::test)]
93+
#[test_log::test(tokio::test)]
9494
async fn test_svc_wrapper() {
9595
let make_svc = SpawnDummyHelloService {};
9696
let server = Server::bind(&SocketAddr::V6(SocketAddrV6::new(Ipv6Addr::LOCALHOST, 5938, 0, 0))).serve(make_svc);
@@ -145,7 +145,7 @@ mod tests {
145145
assert_eq!(status, StatusCode::OK);
146146
}
147147

148-
#[test_env_log::test(tokio::test)]
148+
#[test_log::test(tokio::test)]
149149
async fn test_svc_wrapper_bad_creds() {
150150
let make_svc = SpawnDummyHelloService {};
151151
let server = Server::bind(&SocketAddr::V6(SocketAddrV6::new(Ipv6Addr::LOCALHOST, 5939, 0, 0))).serve(make_svc);

0 commit comments

Comments
 (0)