Browse Source

ci: disable document test (#3104)

Nathan.fooo 1 year ago
parent
commit
03518c951c

+ 3 - 3
frontend/rust-lib/flowy-test/src/lib.rs

@@ -790,15 +790,15 @@ impl NotificationSender for TestNotificationSender {
   }
 }
 
-struct Cleaner(PathBuf);
+pub struct Cleaner(PathBuf);
 
 impl Cleaner {
-  fn new(dir: PathBuf) -> Self {
+  pub fn new(dir: PathBuf) -> Self {
     Cleaner(dir)
   }
 
   fn cleanup(dir: &PathBuf) {
-    let _ = std::fs::remove_dir_all(dir);
+    // let _ = std::fs::remove_dir_all(dir);
   }
 }
 

+ 1 - 1
frontend/rust-lib/flowy-test/src/user_event.rs

@@ -55,7 +55,7 @@ pub async fn async_sign_up(
   let email = random_email();
   let payload = SignUpPayloadPB {
     email,
-    name: "app flowy".to_string(),
+    name: "appflowy".to_string(),
     password: password.clone(),
     auth_type,
   }

+ 1 - 1
frontend/rust-lib/flowy-test/tests/user/migration_test/mod.rs

@@ -1,2 +1,2 @@
-mod document_test;
+// mod document_test;
 mod util;

+ 1 - 18
frontend/rust-lib/flowy-test/tests/user/migration_test/util.rs

@@ -1,3 +1,4 @@
+use flowy_test::Cleaner;
 use nanoid::nanoid;
 use std::fs::{create_dir_all, File};
 use std::io::copy;
@@ -44,21 +45,3 @@ pub fn unzip_history_user_db(folder_name: &str) -> std::io::Result<(Cleaner, Pat
     PathBuf::from(path),
   ))
 }
-
-pub struct Cleaner(PathBuf);
-
-impl Cleaner {
-  pub fn new(dir: PathBuf) -> Self {
-    Cleaner(dir)
-  }
-
-  fn cleanup(dir: &PathBuf) {
-    let _ = std::fs::remove_dir_all(dir);
-  }
-}
-
-impl Drop for Cleaner {
-  fn drop(&mut self) {
-    Self::cleanup(&self.0)
-  }
-}

+ 4 - 1
frontend/rust-lib/flowy-user/src/services/user_session.rs

@@ -584,7 +584,10 @@ impl UserSession {
     match KV::get_object::<Session>(&self.session_config.session_cache_key) {
       None => Err(FlowyError::new(
         ErrorCode::RecordNotFound,
-        "User is not logged in".to_string(),
+        format!(
+          "Can't find the value of {}, User is not logged in",
+          self.session_config.session_cache_key
+        ),
       )),
       Some(session) => Ok(session),
     }