mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Add experimental feature test
This commit is contained in:
parent
b274106ad3
commit
be9f4f96df
1 changed files with 38 additions and 2 deletions
|
@ -105,14 +105,50 @@ pub async fn init_fragments_index() -> (Server<Owned>, String, crate::common::Va
|
|||
(server, uid, settings)
|
||||
}
|
||||
|
||||
// TODO: Test cannot pass both fragments and document
|
||||
|
||||
// TODO: edit fragment
|
||||
|
||||
// TODO: document fragment replaced
|
||||
|
||||
// TODO: swapping fragments
|
||||
|
||||
// TODO: consistency
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn experimental_feature_not_enabled() {
|
||||
let server = Server::new().await;
|
||||
let index = server.unique_index();
|
||||
|
||||
let settings = json!({
|
||||
"embedders": {
|
||||
"rest": {
|
||||
"source": "rest",
|
||||
"url": "http://localhost:1337",
|
||||
"dimensions": 3,
|
||||
"request": "{{fragment}}",
|
||||
"response": {
|
||||
"data": "{{embedding}}"
|
||||
},
|
||||
"indexingFragments": {
|
||||
"basic": {"value": "{{ doc.name }} is a dog"},
|
||||
},
|
||||
"searchFragments": {
|
||||
"query": {"value": "Some pre-prompt for query {{ q }}"},
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
let (response, code) = index.update_settings(settings.clone()).await;
|
||||
snapshot!(code, @"400 Bad Request");
|
||||
snapshot!(response, @r#"
|
||||
{
|
||||
"message": "setting `indexingFragments` requires enabling the `multimodal` experimental feature. See https://github.com/orgs/meilisearch/discussions/846",
|
||||
"code": "feature_not_enabled",
|
||||
"type": "invalid_request",
|
||||
"link": "https://docs.meilisearch.com/errors#feature_not_enabled"
|
||||
}
|
||||
"#);
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn indexing_fragments() {
|
||||
let index = shared_index_for_fragments().await;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue