Updated tests

This commit is contained in:
mdecimus 2023-12-23 08:58:30 +01:00
parent 8ff0d3ff9c
commit 93d8504950
3 changed files with 17 additions and 24 deletions

View file

@ -533,7 +533,7 @@ impl Store {
}
}
eprintln!(
println!(
concat!(
", account {}, collection {},",
" family {}, field {}, key {:?}: {:?}"
@ -559,7 +559,7 @@ impl Store {
return Ok(true);
}
SUBSPACE_INDEXES => {
eprintln!(
println!(
concat!(
"Found index key, account {}, collection {}, ",
"document {}, property {}, value {:?}: {:?}"
@ -573,7 +573,7 @@ impl Store {
);
}
_ => {
eprintln!(
println!(
"Found key in {:?}: {:?} {:?}",
char::from(subspace),
key,

View file

@ -24,7 +24,7 @@
use std::time::Duration;
use directory::backend::internal::manage::ManageDirectory;
use jmap::mailbox::{INBOX_ID, TRASH_ID};
use jmap::mailbox::{INBOX_ID, JUNK_ID};
use jmap_proto::types::{collection::Collection, id::Id, property::Property};
use tokio::{
@ -137,7 +137,7 @@ pub async fn test(params: &mut JMAPTest) {
);
assert_eq!(
server
.get_tag(john_id, Collection::Email, Property::MailboxIds, TRASH_ID)
.get_tag(john_id, Collection::Email, Property::MailboxIds, JUNK_ID)
.await
.unwrap()
.map_or(0, |bm| bm.len()),
@ -181,7 +181,7 @@ pub async fn test(params: &mut JMAPTest) {
);
assert_eq!(
server
.get_tag(john_id, Collection::Email, Property::MailboxIds, TRASH_ID)
.get_tag(john_id, Collection::Email, Property::MailboxIds, JUNK_ID)
.await
.unwrap()
.unwrap()

View file

@ -27,7 +27,7 @@ use crate::{
jmap::{assert_is_empty, mailbox::destroy_all_mailboxes},
store::deflate_test_resource,
};
use jmap::{email::ingest::IngestEmail, IngestError};
use jmap::{email::ingest::IngestEmail, mailbox::INBOX_ID, IngestError};
use jmap_client::{email, mailbox::Role};
use jmap_proto::types::{collection::Collection, id::Id};
use mail_parser::{mailbox::mbox::MessageIterator, MessageParser};
@ -229,22 +229,15 @@ async fn test_multi_thread(params: &mut JMAPTest) {
println!("Running Email Merge Threads tests (multi-threaded)...");
//let semaphore = sync::Arc::Arc::new(tokio::sync::Semaphore::new(100));
let mut handles = vec![];
let mailbox_id_str = params
.client
.set_default_account_id(Id::new(0u64).to_string())
.mailbox_create("Multi-thread nightmare", None::<String>, Role::None)
.await
.unwrap()
.take_id();
params
.client
.set_default_account_id(Id::new(0u64).to_string())
.mailbox_create("Other mailbox", None::<String>, Role::None)
.await
.unwrap();
let mailbox_id = Id::from_bytes(mailbox_id_str.as_bytes())
.unwrap()
.document_id();
for num in 0..3 {
params
.client
.set_default_account_id(Id::new(0u64).to_string())
.mailbox_create(format!("Mailbox {num}"), None::<String>, Role::None)
.await
.unwrap();
}
for message in MessageIterator::new(Cursor::new(deflate_test_resource("mailbox.gz")))
.collect::<Vec<_>>()
.into_iter()
@ -262,7 +255,7 @@ async fn test_multi_thread(params: &mut JMAPTest) {
message: MessageParser::new().parse(message.contents()),
account_id: 0,
account_quota: 0,
mailbox_ids: vec![mailbox_id],
mailbox_ids: vec![INBOX_ID],
keywords: vec![],
received_at: None,
skip_duplicates: true,