From: Felix Ableitner Date: Mon, 21 Sep 2020 15:24:42 +0000 (+0200) Subject: Address review comments X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%7BpictshareAvatarThumbnail%28admin.avatar%29%7D?a=commitdiff_plain;h=aece5e67b7c6c8432e7a05bd75d0238ee9795c72;p=lemmy.git Address review comments --- 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 801e95a4..beb499bd 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 382bd65d..4f280f62 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(); }