thamara / time-to-leave

Log work hours and get notified when it's time to leave the office and start to live.
http://timetoleave.app
GNU General Public License v3.0
450 stars 265 forks source link

Fixing missing IPC handlers in tests (and other issues) #1047

Closed araujoarthur0 closed 5 months ago

araujoarthur0 commented 6 months ago

Related issue

Closes #1036

Context / Background

There are a few issues that show up only on the CI for the PR Checks, indicating missing ipc handlers in our tests. On Ubuntu specifically there were a lot of warnings caused by a misconfigured Chrome Driver.

What change is being introduced by this PR?

Some IPC handlers were missing for a few tests. Most of them were "invoke" calls made by handlers registered in ipcMain. In order to avoid registering those in the tests, I've instead mocked the places where the invoke calls are made and called directly what they were invoking.

For Ubuntu, there was an issue with "failed to connect to the bus" related to a dbus used by the chrome driver. To fix that I've followed a suggestion from another repo to properly set the DBUS_SESSION_BUS_ADDRESS env variable and the warning went away. Also took the chance to update the version of ChromeDriver we use.

How will this be tested?

Checked the PR checks for further warnings. There are no more warnings that we can take care of. The Ubuntu one still has a few unavoidable chrome warnings, but much less than before.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (93b7fed) 79.40% compared to head (262f038) 79.89%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1047 +/- ## ========================================== + Coverage 79.40% 79.89% +0.48% ========================================== Files 21 21 Lines 1277 1278 +1 Branches 189 190 +1 ========================================== + Hits 1014 1021 +7 + Misses 263 257 -6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

araujoarthur0 commented 5 months ago

\changelog-update Message: Fix [#1047]: Fixing test issues in CI User: araujoarthur0