During past weeks, I have been into researching about unit testing as I am now currently working on my third task for GSoC , which is, writing a test suite for GNOME Logs. I would like to give you a brief background about the previous work already done on testing for Logs.
The previous work done is mostly based on testing the Logs frontend using dogtail and behave automated python testing frameworks. You can see more about it here. In my task, I will mostly be working on testing the existing backend functionality in Logs.
I will now try to explain you a little about the existing backend modules in Logs. The Logs backend consists of two modules currently:
- GlJournal: This is the low level module that is responsible for interfacing with the system journal using sd-journal API. It does the work of querying for journal entries and traversing the system journal in the correct order.
- GlJournalModel: This module is responsible for filtering and storing the journal entries according to some specified criteria. These stored journal entries are directly reflected in the frontend modules as well. Moreover, it also handles various attributes to be used in the frontend modules.
I have thought of some initial test scenarios for these modules. I would like to share them here:
- Whether setting the “sort-order” key gives the journal entries in correct order.
- Whether searching works correctly for each of the individual journal fields.
- Whether tokenized mode of search works properly.
- Whether the compressed entries are being counted properly.
- Whether the compressed header is being inserted at the correct position.
- Whether similar entries are being grouped correctly when using event compression.
- Whether the latest boot is returned properly or not.
- Whether the latest 5 boots are returned properly.
- If the data for journal entries is queried correctly.
- If invalid journal entries are filtered properly (skipping journal entries that are missing necessary journal fields).
- Whether setting matches on the journal works as intended.
- Whether the system journal is traversed in a proper order.
In the coming weeks, I will be implementing these test cases using Glib testing framework. Further, I am exploring the possibility of creating a dummy journal so that predefined journal entries can be added to it for testing purposes.
Apart from test suite, I am happy to tell you that the patch regarding improvements for event compression UI has been merged. Here are some screenshots:
As you can see above, the border colour has been changed so that there is a clear demarcation between the compressed header row and the compressed group. The selected entry is now highlighted with a blue background as shown below:
I would like to thank Jakub Steiner and Allan Day of GNOME Design Team for helping me in further improving the event compression UI and my mentors Jonathan Kang and David King for reviewing and merging the relevant patches.
Moreover, the patches regarding Logs shell search provider have received some further polish. You can follow the progress on it here.
That is all for now. See you in my next blog post 🙂