meilisearch / meilisearch/meilisearch-php

Remove all keys before running tests

Open
#368 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue maint
Dominant language
PHP
Stars
757
Forks
125
Avg merge
6d 8h
Merged PRs (30d)
2

Description

Currently, in the tests (especially KeysAndPermissionsTest.php) we manually remove the created keys using $this->client->deleteKey. This is good, but we can do better.

The idea of this issue is to create a way of doing that for every test. We can use setUp() hook for that.

This will probably break some tests where we rely on the default keys created by Meilisearch automatically, those tests now should set up their own keys before asserting on them.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with KeysAndPermissionsTest.php and its existing $this->client->deleteKey cleanup, then inspect the shared test setup and setUp() hooks. Run the full test suite; done means tests consistently remove created keys through the shared setup while tests depending on Meilisearch's default keys create their own keys before assertions.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.