From 312fd31a5827bd998771d212aa08753e77d628e2 Mon Sep 17 00:00:00 2001 From: Benno Bielmeier Date: Wed, 24 Aug 2022 20:50:06 +0200 Subject: [PATCH] nixos/meilisearch: Update tests to reflect API changes in [v0.25.0][1]: Breaking changes of Task API (relevant summarized) - `update` -> `task` - `GET - /indexes/:indexUid/updates/:updateId` -> `/indexes/:indexUid/tasks` - `updateId` -> `uid` of `task` - also: new `GET - /tasks/:taskUid` introduced - `status` values changed in [v0.28.0][2]: Breaking changes in `/indexes` endpoints - `total` now appear in the response body [1]: https://github.com/meilisearch/meilisearch/releases/tag/v0.25.0 [2]: https://github.com/meilisearch/meilisearch/releases/tag/v0.28.0 --- nixos/tests/meilisearch.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nixos/tests/meilisearch.nix b/nixos/tests/meilisearch.nix index 6d7514a1cc0a..c31dcb0559db 100644 --- a/nixos/tests/meilisearch.nix +++ b/nixos/tests/meilisearch.nix @@ -35,20 +35,20 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: with subtest("create index"): machine.succeed( - "curl -XPOST --header 'Content-Type: application/json' ${apiUrl}/indexes --data @${indexJSON}" + "curl -X POST -H 'Content-Type: application/json' ${apiUrl}/indexes --data @${indexJSON}" ) indexes = json.loads(machine.succeed("curl ${apiUrl}/indexes")) - assert len(indexes) == 1, "index wasn't created" + assert indexes["total"] == 1, "index wasn't created" with subtest("add documents"): response = json.loads( machine.succeed( - "curl -XPOST --header 'Content-Type: application/json' ${apiUrl}/indexes/${uid}/documents --data @${moviesJSON}" + "curl -X POST -H 'Content-Type: application/json' ${apiUrl}/indexes/${uid}/documents --data-binary @${moviesJSON}" ) ) - update_id = response["updateId"] + task_uid = response["taskUid"] machine.wait_until_succeeds( - f"curl ${apiUrl}/indexes/${uid}/updates/{update_id} | jq -e '.status == \"processed\"'" + f"curl ${apiUrl}/tasks/{task_uid} | jq -e '.status == \"succeeded\"'" ) with subtest("search"):