ibind icon indicating copy to clipboard operation
ibind copied to clipboard

Increase test coverage

Open weklund opened this issue 5 months ago • 8 comments

This is a working PR to incrementally improve the test coverage to a percentage that we want. I imagine once we reach this predefined goal, then adding that as a minimum level should fail future CI actions.

weklund avatar Jul 24 '25 02:07 weklund

As of last commit we are at 75%

weklund avatar Jul 24 '25 02:07 weklund

Now at 78%

I believe I've capture a lot of the easy wins for unit testing. I want to tackle logs.py errors.py and the mixins next.

Happy to receive feedback so far!

weklund avatar Jul 24 '25 03:07 weklund

Hey @weklund great initiative 👏

  1. Did you write these tests by hand or are they AI-generated? If you used AI, did you review it one by one?
  2. I thought we want to move away from unittest and towards pytest. We've established that both can live safely, so moving towards pytest for any new tests would make sense, right? Happy to discuss this if I'm misunderstanding something here
  3. I'm trying to adopt the Arrange, Act, Assert sections you've suggested. Possibly we could start using them with these new test here?

Voyz avatar Jul 25 '25 11:07 Voyz

  1. Some of these are AI generated, and should be reviewed more :)
  2. No you're right... I already forgot ha. Let me fix that.
  3. No you're right!

Let's try this again :)

weklund avatar Jul 31 '25 01:07 weklund

Updated subscription controller, will update the oauth tests next

weklund avatar Jul 31 '25 02:07 weklund

@Voyz I did another pass here, and a slightly different approach. Used AI a bit, but instead of writing, I used it to refactor, reduce, and simplify what the tests were asserting. Curious on your thoughts here. Unfortunate the diff is pretty large, but I have reached 84% coverage now.

Looks like the next biggest gains would be from ws testing, but wanted to follow up on client work in a different PR.

Screenshot 2025-08-11 at 11 06 06

In addition I wanted to wait on adding through coverage to mixins.

Would love your thoughts here! :D

weklund avatar Aug 11 '25 16:08 weklund

Some actions to take for this PR:

  • Review tests and ensure we mock as little as possible
  • See more test candidates for parameterize
  • Add no coverage where it makes sense

weklund avatar Aug 22 '25 00:08 weklund

@Voyz Would love your thoughts :)

weklund avatar Aug 31 '25 18:08 weklund