git-bundle-server icon indicating copy to clipboard operation
git-bundle-server copied to clipboard

Write unit tests for untested parts of `git-bundle-server`

Open vdye opened this issue 2 years ago • 3 comments

This is likely to be a long-running issue where we incrementally add unit tests for everything unit test-able in the repository (which will be almost everything). This should include:

  • All git-bundle-server subcommands (mock the contents of the dependency container)
  • All interfaced types that do not directly interact with the system (e.g., we can test RepoProvider because all filesystem accesses are done in mocked types, but can't test CommandExecutor).
  • Helper functions (less important)

Progress

  • [x] github/git-bundle-server#11

vdye avatar Jan 24 '23 20:01 vdye

@vdye I wonder if this should be made an expectation of new work in git-bundle-server: create unit tests whenever appropriate, especially before changing behavior that could be covered by unit tests.

This would allow us to remove this as an item and instead make it a practice to improve unit testing as we adjust things based on customer needs. What do you think?

derrickstolee avatar Jun 06 '23 17:06 derrickstolee

I think there's value in backfilling tests for some of the types/functions we have already (for example, we don't have any unit tests of the subcommands, even though they should generally be testable). Without even a basic framework for these types, filling in the tests alongside functionality changes could create an heavy burden on someone making an otherwise small change.

Feel free to unassign yourself if you'd like, but I do plan to knock this out at some point in the near(-ish, within the next couple months) future.

vdye avatar Jun 06 '23 23:06 vdye

... I do plan to knock this out at some point in the near(-ish, within the next couple months) future.

That's enough reason to keep it around. I will remove myself as I don't anticipate having time to help in this direction in the short term.

derrickstolee avatar Jun 07 '23 14:06 derrickstolee