From aece5e67b7c6c8432e7a05bd75d0238ee9795c72 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 21 Sep 2020 17:24:42 +0200 Subject: [PATCH] Address review comments --- docker/travis/{run-tests.sh => run-tests.bash} | 0 test.sh | 2 +- tests/integration_test.rs | 15 +++++++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) rename docker/travis/{run-tests.sh => run-tests.bash} (100%) diff --git a/docker/travis/run-tests.sh b/docker/travis/run-tests.bash similarity index 100% rename from docker/travis/run-tests.sh rename to docker/travis/run-tests.bash diff --git a/test.sh b/test.sh index 801e95a41..beb499bdf 100755 --- a/test.sh +++ b/test.sh @@ -2,4 +2,4 @@ export DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy diesel migration run export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy -RUST_TEST_THREADS=1 RUST_BACKTRACE=1 cargo test -j8 --no-fail-fast -- --nocapture +RUST_TEST_THREADS=1 cargo test --workspace --no-fail-fast diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 382bd65da..4f280f629 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -157,7 +157,8 @@ fn create_http_request() -> HttpRequest { async fn test_shared_inbox_expired_signature() { let request = create_http_request(); let context = create_context(); - let user = create_user(&context.pool().get().unwrap(), "shared_inbox_rvgfd"); + let connection = &context.pool().get().unwrap(); + let user = create_user(connection, "shared_inbox_rvgfd"); let activity = create_activity::>(user.actor_id); let response = shared_inbox(request, activity, web::Data::new(context)).await; @@ -165,13 +166,15 @@ async fn test_shared_inbox_expired_signature() { format!("{}", response.err().unwrap()), format!("{}", PrepareVerifyError::Expired) ); + User_::delete(connection, user.id).unwrap(); } #[actix_rt::test] async fn test_user_inbox_expired_signature() { let request = create_http_request(); let context = create_context(); - let user = create_user(&context.pool().get().unwrap(), "user_inbox_cgsax"); + let connection = &context.pool().get().unwrap(); + let user = create_user(connection, "user_inbox_cgsax"); let activity = create_activity::>(user.actor_id); let path = Path:: { @@ -182,13 +185,15 @@ async fn test_user_inbox_expired_signature() { format!("{}", response.err().unwrap()), format!("{}", PrepareVerifyError::Expired) ); + User_::delete(connection, user.id).unwrap(); } #[actix_rt::test] async fn test_community_inbox_expired_signature() { let context = create_context(); - let user = create_user(&context.pool().get().unwrap(), "community_inbox_hrxa"); - let community = create_community(&context.pool().get().unwrap(), user.id); + let connection = &context.pool().get().unwrap(); + let user = create_user(connection, "community_inbox_hrxa"); + let community = create_community(connection, user.id); let request = create_http_request(); let activity = create_activity::>(user.actor_id); @@ -198,4 +203,6 @@ async fn test_community_inbox_expired_signature() { format!("{}", response.err().unwrap()), format!("{}", PrepareVerifyError::Expired) ); + User_::delete(connection, user.id).unwrap(); + Community::delete(connection, community.id).unwrap(); }