This week I continued work on the GSoC project involving Vorta's test suite. This project has 3 main goals:
- Clean up the Vorta test suite
- Reduce amount of duplicated code through use of parametrization
- Increase code coverage from ~70% to ~80%
I submitted three draft PRs this week to begin working on this:
- PR: utils unit tests: parametrize and increase test coverage #1768
- Description: It is possible to reduce code duplication in the utils unit tests by using parametrization. Additionally, there are a some utils functions that still needed testing. In this PR, I aim to solve both of these issues.
- PR: archive unit tests: reduce code duplication and increase test coverage #1769
- Description: I can reduce code duplication in the archive unit tests by using a fixture to handle the repeated setup. Additionally, there are a some `archive_tab` methods that still needed testing. In this PR, I aim to solve both of these issues.
- PR: diff unit tests: increase test coverage #1770
- Description: There are some areas of opportunity in the `diff_result` module for increased test coverage of some class methods and functions. The `test_diff` module is already well parametrized and does not have a notable amount of code duplication, so here I would like to focus mainly on increasing code coverage.
The biggest hurdle I faced this week was my lessening my knowledge gap when it comes to working with PyQt. As I began writing unit tests for functions and methods, I found myself reading a lot of the documentation in order to understand how to properly test the different Qt elements. For example, when I was testing how to double-click on an archive name in the archive tab, I had to find out how to get the QPoint (a set of x-y coordinates) that I wanted to double click. To do this, I had to retrieve the item from the table, get the coordinates of the four sides of the rectangle that made up the item, and then double click the "center" of those points. I am still getting used to tables and and models, so the more experience I can get testing these UI elements for proper functionality the better.
The week ahead:
In the next week I have a GSoC meeting Tuesday with the coordinators of the program. During this meeting they will outline the final weeks of the program and how to begin getting a portfolio of all of our contributions together for display on the GSoC website after the program is over. I will continue to work my way through the rest of the test files and reduce code duplication, clean up tests where possible, and add additional functionality. I plan on continuing to do one PR for each test module as this keeps things very clean and will hopefully result in quicker approvals and merging.