Add unit tests for backend modules in logs - GSoC 2017
Submitted by Pranav Ganorkar
Link to original bug (#787244)
Description
Created attachment 359067 Add unit test for checking similarity
This is a patch for verifying the gl_row_entry_check_message_similarity() used for compressing the rows in the journal model.
As I was quite new to field of testing, much of my time during official GSoC timeline was spent on researching and exploring the code bases of testing modules in other GNOME Applications (especially GNOME Files). Actual plan was to implement at least these test scenarios:
- Whether setting the “sort-order” key gives the journal entries in correct order.
- Whether substring search works correctly for each of the individual journal fields.
- Whether the compressed entries are being counted properly.
- Whether the compressed header is being inserted at the correct position.
- Whether search string tokenization works correctly.
For testing 1,2,3 and 4 (which I think are some of the crucial test scenarios for searching and compression functionality), I tried letting the model read journal entries from a dummy database (text file) and then verifying the entries in the model, after they were processed. However, I faced many implementation issues in doing so and hence was unable to implement them successfully.
I think the above test cases are very crucial for ensuring the robustness of Logs and need be considered for implementation in future.
Patch 359067, "Add unit test for checking similarity":
0001-Add-unit-test-for-checking-message-similarity.patch
Version: git master