Fixing integration tests.
This commit is contained in:
parent
d767dd998e
commit
929f1d02b5
2 changed files with 5 additions and 21 deletions
|
@ -83,8 +83,8 @@ LEMMY_HOSTNAME=lemmy-epsilon:8581 \
|
||||||
target/lemmy_server >/dev/null 2>&1 &
|
target/lemmy_server >/dev/null 2>&1 &
|
||||||
|
|
||||||
echo "wait for all instances to start"
|
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:8541/api/v2/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:8551/api/v2/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:8561/api/v2/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:8571/api/v2/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:8581/api/v2/site')" != "200" ]]; do sleep 1; done
|
||||||
|
|
|
@ -43,8 +43,6 @@ fn user_updates_2020_04_02(conn: &PgConnection) -> Result<(), LemmyError> {
|
||||||
.filter(local.eq(true))
|
.filter(local.eq(true))
|
||||||
.load::<User_>(conn)?;
|
.load::<User_>(conn)?;
|
||||||
|
|
||||||
sql_query("alter table user_ disable trigger refresh_user").execute(conn)?;
|
|
||||||
|
|
||||||
for cuser in &incorrect_users {
|
for cuser in &incorrect_users {
|
||||||
let keypair = generate_actor_keypair()?;
|
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)?;
|
User_::update(&conn, cuser.id, &form)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
sql_query("alter table user_ enable trigger refresh_user").execute(conn)?;
|
|
||||||
|
|
||||||
info!("{} user rows updated.", incorrect_users.len());
|
info!("{} user rows updated.", incorrect_users.len());
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -96,8 +92,6 @@ fn community_updates_2020_04_02(conn: &PgConnection) -> Result<(), LemmyError> {
|
||||||
.filter(local.eq(true))
|
.filter(local.eq(true))
|
||||||
.load::<Community>(conn)?;
|
.load::<Community>(conn)?;
|
||||||
|
|
||||||
sql_query("alter table community disable trigger refresh_community").execute(conn)?;
|
|
||||||
|
|
||||||
for ccommunity in &incorrect_communities {
|
for ccommunity in &incorrect_communities {
|
||||||
let keypair = generate_actor_keypair()?;
|
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)?;
|
Community::update(&conn, ccommunity.id, &form)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
sql_query("alter table community enable trigger refresh_community").execute(conn)?;
|
|
||||||
|
|
||||||
info!("{} community rows updated.", incorrect_communities.len());
|
info!("{} community rows updated.", incorrect_communities.len());
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -142,8 +134,6 @@ fn post_updates_2020_04_03(conn: &PgConnection) -> Result<(), LemmyError> {
|
||||||
.filter(local.eq(true))
|
.filter(local.eq(true))
|
||||||
.load::<Post>(conn)?;
|
.load::<Post>(conn)?;
|
||||||
|
|
||||||
sql_query("alter table post disable trigger refresh_post").execute(conn)?;
|
|
||||||
|
|
||||||
for cpost in &incorrect_posts {
|
for cpost in &incorrect_posts {
|
||||||
let apub_id = make_apub_endpoint(EndpointType::Post, &cpost.id.to_string()).to_string();
|
let apub_id = make_apub_endpoint(EndpointType::Post, &cpost.id.to_string()).to_string();
|
||||||
Post::update_ap_id(&conn, cpost.id, apub_id)?;
|
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());
|
info!("{} post rows updated.", incorrect_posts.len());
|
||||||
|
|
||||||
sql_query("alter table post enable trigger refresh_post").execute(conn)?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,15 +155,11 @@ fn comment_updates_2020_04_03(conn: &PgConnection) -> Result<(), LemmyError> {
|
||||||
.filter(local.eq(true))
|
.filter(local.eq(true))
|
||||||
.load::<Comment>(conn)?;
|
.load::<Comment>(conn)?;
|
||||||
|
|
||||||
sql_query("alter table comment disable trigger refresh_comment").execute(conn)?;
|
|
||||||
|
|
||||||
for ccomment in &incorrect_comments {
|
for ccomment in &incorrect_comments {
|
||||||
let apub_id = make_apub_endpoint(EndpointType::Comment, &ccomment.id.to_string()).to_string();
|
let apub_id = make_apub_endpoint(EndpointType::Comment, &ccomment.id.to_string()).to_string();
|
||||||
Comment::update_ap_id(&conn, ccomment.id, apub_id)?;
|
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());
|
info!("{} comment rows updated.", incorrect_comments.len());
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in a new issue