@@ -3,7 +3,6 @@ use std::time::Duration;
33use serde:: Serialize ;
44use torrust_tracker:: core:: auth:: Key ;
55use torrust_tracker_test_helpers:: configuration;
6- use tracing:: level_filters:: LevelFilter ;
76
87use crate :: common:: logging:: { self } ;
98use crate :: servers:: api:: connection_info:: { connection_with_invalid_token, connection_with_no_token} ;
@@ -17,6 +16,8 @@ use crate::servers::api::{force_database_error, Started};
1716
1817#[ tokio:: test]
1918async fn should_allow_generating_a_new_random_auth_key ( ) {
19+ logging:: setup ( ) ;
20+
2021 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
2122
2223 let response = Client :: new ( env. get_connection_info ( ) )
@@ -39,6 +40,8 @@ async fn should_allow_generating_a_new_random_auth_key() {
3940
4041#[ tokio:: test]
4142async fn should_allow_uploading_a_preexisting_auth_key ( ) {
43+ logging:: setup ( ) ;
44+
4245 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
4346
4447 let response = Client :: new ( env. get_connection_info ( ) )
@@ -61,7 +64,7 @@ async fn should_allow_uploading_a_preexisting_auth_key() {
6164
6265#[ tokio:: test]
6366async fn should_not_allow_generating_a_new_auth_key_for_unauthenticated_users ( ) {
64- logging:: setup ( LevelFilter :: ERROR ) ;
67+ logging:: setup ( ) ;
6568
6669 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
6770
@@ -88,7 +91,7 @@ async fn should_not_allow_generating_a_new_auth_key_for_unauthenticated_users()
8891
8992#[ tokio:: test]
9093async fn should_fail_when_the_auth_key_cannot_be_generated ( ) {
91- logging:: setup ( LevelFilter :: ERROR ) ;
94+ logging:: setup ( ) ;
9295
9396 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
9497
@@ -108,6 +111,8 @@ async fn should_fail_when_the_auth_key_cannot_be_generated() {
108111
109112#[ tokio:: test]
110113async fn should_allow_deleting_an_auth_key ( ) {
114+ logging:: setup ( ) ;
115+
111116 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
112117
113118 let seconds_valid = 60 ;
@@ -135,6 +140,8 @@ async fn should_fail_generating_a_new_auth_key_when_the_provided_key_is_invalid(
135140 pub seconds_valid : u64 ,
136141 }
137142
143+ logging:: setup ( ) ;
144+
138145 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
139146
140147 let invalid_keys = [
@@ -172,6 +179,8 @@ async fn should_fail_generating_a_new_auth_key_when_the_key_duration_is_invalid(
172179 pub seconds_valid : String ,
173180 }
174181
182+ logging:: setup ( ) ;
183+
175184 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
176185
177186 let invalid_key_durations = [
@@ -199,6 +208,8 @@ async fn should_fail_generating_a_new_auth_key_when_the_key_duration_is_invalid(
199208
200209#[ tokio:: test]
201210async fn should_fail_deleting_an_auth_key_when_the_key_id_is_invalid ( ) {
211+ logging:: setup ( ) ;
212+
202213 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
203214
204215 let invalid_auth_keys = [
@@ -222,7 +233,7 @@ async fn should_fail_deleting_an_auth_key_when_the_key_id_is_invalid() {
222233
223234#[ tokio:: test]
224235async fn should_fail_when_the_auth_key_cannot_be_deleted ( ) {
225- logging:: setup ( LevelFilter :: ERROR ) ;
236+ logging:: setup ( ) ;
226237
227238 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
228239
@@ -246,7 +257,7 @@ async fn should_fail_when_the_auth_key_cannot_be_deleted() {
246257
247258#[ tokio:: test]
248259async fn should_not_allow_deleting_an_auth_key_for_unauthenticated_users ( ) {
249- logging:: setup ( LevelFilter :: ERROR ) ;
260+ logging:: setup ( ) ;
250261
251262 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
252263
@@ -283,6 +294,8 @@ async fn should_not_allow_deleting_an_auth_key_for_unauthenticated_users() {
283294
284295#[ tokio:: test]
285296async fn should_allow_reloading_keys ( ) {
297+ logging:: setup ( ) ;
298+
286299 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
287300
288301 let seconds_valid = 60 ;
@@ -300,7 +313,7 @@ async fn should_allow_reloading_keys() {
300313
301314#[ tokio:: test]
302315async fn should_fail_when_keys_cannot_be_reloaded ( ) {
303- logging:: setup ( LevelFilter :: ERROR ) ;
316+ logging:: setup ( ) ;
304317
305318 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
306319
@@ -321,7 +334,7 @@ async fn should_fail_when_keys_cannot_be_reloaded() {
321334
322335#[ tokio:: test]
323336async fn should_not_allow_reloading_keys_for_unauthenticated_users ( ) {
324- logging:: setup ( LevelFilter :: ERROR ) ;
337+ logging:: setup ( ) ;
325338
326339 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
327340
@@ -350,7 +363,6 @@ mod deprecated_generate_key_endpoint {
350363
351364 use torrust_tracker:: core:: auth:: Key ;
352365 use torrust_tracker_test_helpers:: configuration;
353- use tracing:: level_filters:: LevelFilter ;
354366
355367 use crate :: common:: logging:: { self } ;
356368 use crate :: servers:: api:: connection_info:: { connection_with_invalid_token, connection_with_no_token} ;
@@ -363,6 +375,8 @@ mod deprecated_generate_key_endpoint {
363375
364376 #[ tokio:: test]
365377 async fn should_allow_generating_a_new_auth_key ( ) {
378+ logging:: setup ( ) ;
379+
366380 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
367381
368382 let seconds_valid = 60 ;
@@ -382,7 +396,7 @@ mod deprecated_generate_key_endpoint {
382396
383397 #[ tokio:: test]
384398 async fn should_not_allow_generating_a_new_auth_key_for_unauthenticated_users ( ) {
385- logging:: setup ( LevelFilter :: ERROR ) ;
399+ logging:: setup ( ) ;
386400
387401 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
388402
@@ -405,6 +419,8 @@ mod deprecated_generate_key_endpoint {
405419
406420 #[ tokio:: test]
407421 async fn should_fail_generating_a_new_auth_key_when_the_key_duration_is_invalid ( ) {
422+ logging:: setup ( ) ;
423+
408424 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
409425
410426 let invalid_key_durations = [
@@ -426,7 +442,7 @@ mod deprecated_generate_key_endpoint {
426442
427443 #[ tokio:: test]
428444 async fn should_fail_when_the_auth_key_cannot_be_generated ( ) {
429- logging:: setup ( LevelFilter :: ERROR ) ;
445+ logging:: setup ( ) ;
430446
431447 let env = Started :: new ( & configuration:: ephemeral ( ) . into ( ) ) . await ;
432448
0 commit comments