mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
fix tests + fmt
This commit is contained in:
parent
c984d8d5a5
commit
179969a9e2
10 changed files with 57 additions and 128 deletions
|
@ -359,7 +359,7 @@ mod tests {
|
|||
|
||||
use crate::criterion::{self, CriteriaBuilder};
|
||||
use crate::update::{ProcessedUpdateResult, UpdateStatus};
|
||||
use crate::settings::{Settings, SettingsUpdate, UpdateState};
|
||||
use crate::settings::Settings;
|
||||
use crate::{Document, DocumentId};
|
||||
use serde::de::IgnoredAny;
|
||||
use std::sync::mpsc;
|
||||
|
@ -379,17 +379,11 @@ mod tests {
|
|||
|
||||
database.set_update_callback(Box::new(update_fn));
|
||||
|
||||
let settings_update = SettingsUpdate{
|
||||
primary_key: UpdateState::Update("id".to_string()),
|
||||
..SettingsUpdate::default()
|
||||
};
|
||||
|
||||
let mut writer = db.update_write_txn().unwrap();
|
||||
let update_id = index.settings_update(&mut writer, settings_update).unwrap();
|
||||
let mut writer = db.main_write_txn().unwrap();
|
||||
index.main.put_schema(&mut writer, &Schema::with_primary_key("id")).unwrap();
|
||||
writer.commit().unwrap();
|
||||
|
||||
// block until the transaction is processed
|
||||
let _ = receiver.iter().find(|id| *id == update_id);
|
||||
|
||||
let settings = {
|
||||
let data = r#"
|
||||
|
@ -450,18 +444,10 @@ mod tests {
|
|||
|
||||
database.set_update_callback(Box::new(update_fn));
|
||||
|
||||
let settings_update = SettingsUpdate{
|
||||
primary_key: UpdateState::Update("id".to_string()),
|
||||
..SettingsUpdate::default()
|
||||
};
|
||||
|
||||
let mut writer = db.update_write_txn().unwrap();
|
||||
let update_id = index.settings_update(&mut writer, settings_update).unwrap();
|
||||
let mut writer = db.main_write_txn().unwrap();
|
||||
index.main.put_schema(&mut writer, &Schema::with_primary_key("id")).unwrap();
|
||||
writer.commit().unwrap();
|
||||
|
||||
// block until the transaction is processed
|
||||
let _ = receiver.iter().find(|id| *id == update_id);
|
||||
|
||||
let settings = {
|
||||
let data = r#"
|
||||
{
|
||||
|
@ -520,18 +506,10 @@ mod tests {
|
|||
|
||||
database.set_update_callback(Box::new(update_fn));
|
||||
|
||||
let settings_update = SettingsUpdate{
|
||||
primary_key: UpdateState::Update("id".to_string()),
|
||||
..SettingsUpdate::default()
|
||||
};
|
||||
|
||||
let mut writer = db.update_write_txn().unwrap();
|
||||
let update_id = index.settings_update(&mut writer, settings_update).unwrap();
|
||||
let mut writer = db.main_write_txn().unwrap();
|
||||
index.main.put_schema(&mut writer, &Schema::with_primary_key("id")).unwrap();
|
||||
writer.commit().unwrap();
|
||||
|
||||
// block until the transaction is processed
|
||||
let _ = receiver.iter().find(|id| *id == update_id);
|
||||
|
||||
let settings = {
|
||||
let data = r#"
|
||||
{
|
||||
|
@ -583,18 +561,10 @@ mod tests {
|
|||
|
||||
database.set_update_callback(Box::new(update_fn));
|
||||
|
||||
let settings_update = SettingsUpdate{
|
||||
primary_key: UpdateState::Update("id".to_string()),
|
||||
..SettingsUpdate::default()
|
||||
};
|
||||
|
||||
let mut writer = db.update_write_txn().unwrap();
|
||||
let update_id = index.settings_update(&mut writer, settings_update).unwrap();
|
||||
let mut writer = db.main_write_txn().unwrap();
|
||||
index.main.put_schema(&mut writer, &Schema::with_primary_key("id")).unwrap();
|
||||
writer.commit().unwrap();
|
||||
|
||||
// block until the transaction is processed
|
||||
let _ = receiver.iter().find(|id| *id == update_id);
|
||||
|
||||
let settings = {
|
||||
let data = r#"
|
||||
{
|
||||
|
@ -735,18 +705,10 @@ mod tests {
|
|||
|
||||
database.set_update_callback(Box::new(update_fn));
|
||||
|
||||
let settings_update = SettingsUpdate{
|
||||
primary_key: UpdateState::Update("id".to_string()),
|
||||
..SettingsUpdate::default()
|
||||
};
|
||||
|
||||
let mut writer = db.update_write_txn().unwrap();
|
||||
let update_id = index.settings_update(&mut writer, settings_update).unwrap();
|
||||
let mut writer = db.main_write_txn().unwrap();
|
||||
index.main.put_schema(&mut writer, &Schema::with_primary_key("id")).unwrap();
|
||||
writer.commit().unwrap();
|
||||
|
||||
// block until the transaction is processed
|
||||
let _ = receiver.iter().find(|id| *id == update_id);
|
||||
|
||||
let settings = {
|
||||
let data = r#"
|
||||
{
|
||||
|
@ -823,18 +785,10 @@ mod tests {
|
|||
|
||||
database.set_update_callback(Box::new(update_fn));
|
||||
|
||||
let settings_update = SettingsUpdate{
|
||||
primary_key: UpdateState::Update("id".to_string()),
|
||||
..SettingsUpdate::default()
|
||||
};
|
||||
|
||||
let mut writer = db.update_write_txn().unwrap();
|
||||
let update_id = index.settings_update(&mut writer, settings_update).unwrap();
|
||||
let mut writer = db.main_write_txn().unwrap();
|
||||
index.main.put_schema(&mut writer, &Schema::with_primary_key("id")).unwrap();
|
||||
writer.commit().unwrap();
|
||||
|
||||
// block until the transaction is processed
|
||||
let _ = receiver.iter().find(|id| *id == update_id);
|
||||
|
||||
let settings = {
|
||||
let data = r#"
|
||||
{
|
||||
|
@ -970,18 +924,10 @@ mod tests {
|
|||
|
||||
database.set_update_callback(Box::new(update_fn));
|
||||
|
||||
let settings_update = SettingsUpdate{
|
||||
primary_key: UpdateState::Update("id".to_string()),
|
||||
..SettingsUpdate::default()
|
||||
};
|
||||
|
||||
let mut writer = db.update_write_txn().unwrap();
|
||||
let update_id = index.settings_update(&mut writer, settings_update).unwrap();
|
||||
let mut writer = db.main_write_txn().unwrap();
|
||||
index.main.put_schema(&mut writer, &Schema::with_primary_key("id")).unwrap();
|
||||
writer.commit().unwrap();
|
||||
|
||||
// block until the transaction is processed
|
||||
let _ = receiver.iter().find(|id| *id == update_id);
|
||||
|
||||
let settings = {
|
||||
let data = r#"
|
||||
{
|
||||
|
@ -1045,18 +991,10 @@ mod tests {
|
|||
|
||||
database.set_update_callback(Box::new(update_fn));
|
||||
|
||||
let settings_update = SettingsUpdate{
|
||||
primary_key: UpdateState::Update("id".to_string()),
|
||||
..SettingsUpdate::default()
|
||||
};
|
||||
|
||||
let mut writer = db.update_write_txn().unwrap();
|
||||
let update_id = index.settings_update(&mut writer, settings_update).unwrap();
|
||||
let mut writer = db.main_write_txn().unwrap();
|
||||
index.main.put_schema(&mut writer, &Schema::with_primary_key("id")).unwrap();
|
||||
writer.commit().unwrap();
|
||||
|
||||
// block until the transaction is processed
|
||||
let _ = receiver.iter().find(|id| *id == update_id);
|
||||
|
||||
let settings = {
|
||||
let data = r#"
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue