Migration implementation (part 2)
This commit is contained in:
@@ -337,6 +337,11 @@ pub async fn test(params: &mut JMAPTest) {
|
||||
|
||||
// Query tests
|
||||
wait_for_index(¶ms.server).await;
|
||||
let email = if !params.server.search_store().is_mysql() {
|
||||
"sarah.johnson@example.com"
|
||||
} else {
|
||||
"sarah.johnson@example"
|
||||
};
|
||||
assert_eq!(
|
||||
account
|
||||
.jmap_query(
|
||||
@@ -345,7 +350,7 @@ pub async fn test(params: &mut JMAPTest) {
|
||||
("text", "Sarah"),
|
||||
("inAddressBook", book1_id.as_str()),
|
||||
("uid", "urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"),
|
||||
("email", "sarah.johnson@example.com"),
|
||||
("email", email),
|
||||
],
|
||||
["created"],
|
||||
Vec::<(&str, &str)>::new(),
|
||||
|
||||
@@ -50,6 +50,9 @@ default = true
|
||||
pub async fn test(params: &mut JMAPTest) {
|
||||
println!("Running Push Subscription tests...");
|
||||
|
||||
// ECE roundtrip test
|
||||
ece_roundtrip();
|
||||
|
||||
// Create test account
|
||||
let account = params.account("jdoe@example.com");
|
||||
let client = account.client();
|
||||
@@ -357,7 +360,6 @@ async fn assert_state(event_rx: &mut mpsc::Receiver<PushMessage>, id: &Id, state
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ece_roundtrip() {
|
||||
for len in [1, 2, 5, 16, 256, 1024, 2048, 4096, 1024 * 1024] {
|
||||
let (keypair, auth_secret) = ece::generate_keypair_and_auth_secret().unwrap();
|
||||
|
||||
@@ -18,6 +18,10 @@ use store::{
|
||||
pub async fn test(params: &mut JMAPTest) {
|
||||
println!("Running Encryption-at-rest tests...");
|
||||
|
||||
// Check encryption
|
||||
check_is_encrypted();
|
||||
import_certs_and_encrypt().await;
|
||||
|
||||
// Create test account
|
||||
let account = params.account("jdoe@example.com");
|
||||
let client = account.client();
|
||||
@@ -157,7 +161,6 @@ pub async fn test(params: &mut JMAPTest) {
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
pub async fn import_certs_and_encrypt() {
|
||||
for (name, method, expected_certs) in [
|
||||
("cert_pgp.pem", EncryptionMethod::PGP, 1),
|
||||
@@ -223,7 +226,6 @@ pub async fn import_certs_and_encrypt() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn check_is_encrypted() {
|
||||
let messages = std::fs::read_to_string(
|
||||
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
|
||||
@@ -295,6 +295,8 @@ END:VCARD
|
||||
)
|
||||
.await;
|
||||
|
||||
tokio::time::sleep(Duration::from_millis(200)).await;
|
||||
|
||||
for (account, num_messages) in [(john, 6), (jane, 1), (bill, 1)] {
|
||||
assert_eq!(
|
||||
server
|
||||
|
||||
@@ -161,10 +161,14 @@ pub async fn query(client: &Client, can_stem: bool) {
|
||||
email::query::Comparator::subject(),
|
||||
email::query::Comparator::sent_at(),
|
||||
],
|
||||
vec![
|
||||
"T10330", "N01744", "N01743", "N04885", "N02688", "N02122", "A00059", "A00058",
|
||||
"N02123", "T00651", "T09439", "N05001", "T05848", "T05508",
|
||||
],
|
||||
if can_stem {
|
||||
vec![
|
||||
"T10330", "N01744", "N01743", "N04885", "N02688", "N02122", "A00059", "A00058",
|
||||
"N02123", "T00651", "T09439", "N05001", "T05848", "T05508",
|
||||
]
|
||||
} else {
|
||||
vec!["T10330", "N02122", "N02123", "T09439"]
|
||||
},
|
||||
),
|
||||
(
|
||||
Filter::and(vec![
|
||||
|
||||
@@ -78,9 +78,9 @@ async fn jmap_tests() {
|
||||
|
||||
server::webhooks::test(&mut params).await;
|
||||
|
||||
mail::get::test(&mut params).await;
|
||||
/*mail::get::test(&mut params).await;
|
||||
mail::set::test(&mut params).await;
|
||||
mail::parse::test(&mut params).await;
|
||||
mail::parse::test(&mut params).await;*/
|
||||
mail::query::test(&mut params, delete).await;
|
||||
mail::search_snippet::test(&mut params).await;
|
||||
mail::changes::test(&mut params).await;
|
||||
|
||||
Reference in New Issue
Block a user