meilisearch/MeiliSearch

Split the unit-tests from the source code

Open

#5.116 geöffnet am 3. Dez. 2024

Auf GitHub ansehen
 (2 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)Rust (733 Forks)batch import
good first issuemaintenance

Repository-Metriken

Stars
 (20.887 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 4T 3h) (37 gemergte PRs in 30 T)

Beschreibung

Currently, there is a lot of files containing a lot of codes, and then literally thousands of lines of tests at the end of the tests. That's becoming an issue because it slows down rust analyzer and makes development harder.

We should look at the biggest files in the repository. If they contain many tests at the end, create a new file with the same name postfixed by _tests and import it in the lib.rs/mod.rs. So for example if we have this structure:

src
├── index.rs
└── lib.rs

And the index.rs contains a lot of tests, then you should update the structure like that and move the tests to index_tests.rs:

src
├── index.rs
├── index_tests.rs
└── lib.rs

[!IMPORTANT] Please open PR per files to ease the reviewer work

Contributor Guide