]> Untitled Git - lemmy.git/commitdiff
Sort vecs before assert to avoid random test failures (#2569)
authorNutomic <me@nutomic.com>
Sat, 19 Nov 2022 01:30:59 +0000 (01:30 +0000)
committerGitHub <noreply@github.com>
Sat, 19 Nov 2022 01:30:59 +0000 (20:30 -0500)
* Sort language read queries to avoid random test failures

* change sort columns

crates/db_schema/src/impls/actor_language.rs
scripts/test.sh

index 4b8f3e379f4f35f09fafe1ac296be88428882a10..4f7b45ff81c4073c947414272410976fc262123e 100644 (file)
@@ -24,6 +24,7 @@ impl LocalUserLanguage {
         Box::pin(async move {
           let langs = local_user_language
             .filter(local_user_id.eq(for_local_user_id))
+            .order(language_id)
             .select(language_id)
             .get_results(conn)
             .await?;
@@ -77,6 +78,7 @@ impl SiteLanguage {
     site::table
       .inner_join(local_site::table)
       .inner_join(site_language::table)
+      .order(site_language::id)
       .select(site_language::language_id)
       .load(conn)
       .await
@@ -87,6 +89,7 @@ impl SiteLanguage {
 
     let langs = site_language::table
       .filter(site_language::site_id.eq(for_site_id))
+      .order(site_language::language_id)
       .select(site_language::language_id)
       .load(conn)
       .await?;
@@ -202,6 +205,7 @@ impl CommunityLanguage {
 
     let langs = community_language
       .filter(community_id.eq(for_community_id))
+      .order(language_id)
       .select(language_id)
       .get_results(conn)
       .await?;
index 513bc3c65b6eff6e06813d5b84191848eaa8daa0..5a6130a452ed9b7d12e6564bdb538255f4a27de8 100755 (executable)
@@ -9,5 +9,5 @@ export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy
 # so to load the config we need to traverse to the repo root
 export LEMMY_CONFIG_LOCATION=../../config/config.hjson
 RUST_BACKTRACE=1 \
-  cargo test --workspace --no-fail-fast
+  cargo test --workspace --all-features --no-fail-fast
 # Add this to do printlns: -- --nocapture