From 929f1d02b50be9ed420b12123e162fe2177c1116 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 20 Dec 2020 22:27:27 -0500 Subject: [PATCH] Fixing integration tests. --- api_tests/prepare-drone-federation-test.sh | 10 +++++----- src/code_migrations.rs | 16 ---------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/api_tests/prepare-drone-federation-test.sh b/api_tests/prepare-drone-federation-test.sh index a1ca4b8d..de9b7b84 100755 --- a/api_tests/prepare-drone-federation-test.sh +++ b/api_tests/prepare-drone-federation-test.sh @@ -83,8 +83,8 @@ LEMMY_HOSTNAME=lemmy-epsilon:8581 \ target/lemmy_server >/dev/null 2>&1 & echo "wait for all instances to start" -while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8541/api/v1/site')" != "200" ]]; do sleep 1; done -while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8551/api/v1/site')" != "200" ]]; do sleep 1; done -while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8561/api/v1/site')" != "200" ]]; do sleep 1; done -while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8571/api/v1/site')" != "200" ]]; do sleep 1; done -while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8581/api/v1/site')" != "200" ]]; do sleep 1; done +while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8541/api/v2/site')" != "200" ]]; do sleep 1; done +while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8551/api/v2/site')" != "200" ]]; do sleep 1; done +while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8561/api/v2/site')" != "200" ]]; do sleep 1; done +while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8571/api/v2/site')" != "200" ]]; do sleep 1; done +while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8581/api/v2/site')" != "200" ]]; do sleep 1; done diff --git a/src/code_migrations.rs b/src/code_migrations.rs index 7a749e9b..af01982f 100644 --- a/src/code_migrations.rs +++ b/src/code_migrations.rs @@ -43,8 +43,6 @@ fn user_updates_2020_04_02(conn: &PgConnection) -> Result<(), LemmyError> { .filter(local.eq(true)) .load::(conn)?; - sql_query("alter table user_ disable trigger refresh_user").execute(conn)?; - for cuser in &incorrect_users { let keypair = generate_actor_keypair()?; @@ -78,8 +76,6 @@ fn user_updates_2020_04_02(conn: &PgConnection) -> Result<(), LemmyError> { User_::update(&conn, cuser.id, &form)?; } - sql_query("alter table user_ enable trigger refresh_user").execute(conn)?; - info!("{} user rows updated.", incorrect_users.len()); Ok(()) @@ -96,8 +92,6 @@ fn community_updates_2020_04_02(conn: &PgConnection) -> Result<(), LemmyError> { .filter(local.eq(true)) .load::(conn)?; - sql_query("alter table community disable trigger refresh_community").execute(conn)?; - for ccommunity in &incorrect_communities { let keypair = generate_actor_keypair()?; @@ -124,8 +118,6 @@ fn community_updates_2020_04_02(conn: &PgConnection) -> Result<(), LemmyError> { Community::update(&conn, ccommunity.id, &form)?; } - sql_query("alter table community enable trigger refresh_community").execute(conn)?; - info!("{} community rows updated.", incorrect_communities.len()); Ok(()) @@ -142,8 +134,6 @@ fn post_updates_2020_04_03(conn: &PgConnection) -> Result<(), LemmyError> { .filter(local.eq(true)) .load::(conn)?; - sql_query("alter table post disable trigger refresh_post").execute(conn)?; - for cpost in &incorrect_posts { let apub_id = make_apub_endpoint(EndpointType::Post, &cpost.id.to_string()).to_string(); Post::update_ap_id(&conn, cpost.id, apub_id)?; @@ -151,8 +141,6 @@ fn post_updates_2020_04_03(conn: &PgConnection) -> Result<(), LemmyError> { info!("{} post rows updated.", incorrect_posts.len()); - sql_query("alter table post enable trigger refresh_post").execute(conn)?; - Ok(()) } @@ -167,15 +155,11 @@ fn comment_updates_2020_04_03(conn: &PgConnection) -> Result<(), LemmyError> { .filter(local.eq(true)) .load::(conn)?; - sql_query("alter table comment disable trigger refresh_comment").execute(conn)?; - for ccomment in &incorrect_comments { let apub_id = make_apub_endpoint(EndpointType::Comment, &ccomment.id.to_string()).to_string(); Comment::update_ap_id(&conn, ccomment.id, apub_id)?; } - sql_query("alter table comment enable trigger refresh_comment").execute(conn)?; - info!("{} comment rows updated.", incorrect_comments.len()); Ok(()) -- 2.44.1