pimutils / pimutils/vdirsyncer

Refactor test suite, make code more testable

Open
#540 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: refactor cat: testing in progress
Dominant language
Python
Stars
1.9k
Forks
185
Avg merge
11h 49m
Merged PRs (30d)
1

Description

I've reorganized the testsuite and put an explanation of the new structure into the docs as well. But I'm not done yet.

At some point I'd like to get decent coverage on the unittest suite (it's currently around 25%), but also the system + storage tests (currently around 70%) may need a bit of improvement.

This is not just a matter of writing tests. A few things in the testsuite are unfit for unittesting as their APIs are less "pure" than they could be.

One particular example that stuck out is vdirsyncer.repair, which wildly mixes UI with actual logic. Half of the code in there belongs into vdirsyncer.cli.

See this talk and this blogpost for inspiration.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the reorganized test-suite structure and its documentation, then inspect vdirsyncer.repair and the related vdirsyncer.cli responsibilities. Review unittest, system, and storage test coverage to identify gaps and APIs that hinder unit testing. Done would require improved coverage and clearer separation of UI from logic, but the issue does not define a bounded target.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, testing
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.