[GH-ISSUE #99] Refine test suite #58

Open
opened 2026-03-02 16:47:54 +03:00 by kerem · 2 comments
Owner

Originally created by @ehmatthes on GitHub (Jul 17, 2023).
Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/99

The initial test suite has been developed, and is starting to become useful in ongoing development work. There are a few smaller tasks that would help improve the test suite, so it doesn't take any more maintenance attention than it needs.

Keep in mind that principles like DRY don't apply the same to testing as they do to general software development. When a test fails, you really want that test to be as easy to understand as possible.

Let's aim to make some refinements, and then close this so that most of the focus is on ongoing development.

  • List any refinements that we'd like to make.
  • Implement these refinements.
  • Make sure tests pass on all major OSes: Windows, macOS, and Linux.
Originally created by @ehmatthes on GitHub (Jul 17, 2023). Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/99 The initial test suite has been developed, and is starting to become useful in ongoing development work. There are a few smaller tasks that would help improve the test suite, so it doesn't take any more maintenance attention than it needs. Keep in mind that principles like DRY don't apply the same to testing as they do to general software development. When a test fails, you really want that test to be as easy to understand as possible. Let's aim to make some refinements, and then close this so that most of the focus is on ongoing development. - [ ] List any refinements that we'd like to make. - [ ] Implement these refinements. - [ ] Make sure tests pass on all major OSes: Windows, macOS, and Linux.
Author
Owner

@ehmatthes commented on GitHub (Jul 17, 2023):

Initial refinements

  • Consider using opencv in compare_images()? It's already a dependency of the project; it may provide a better measure of the correctness of generated images.
  • Consider writing a helper function that reduces the repetition in test_core_commands.py. It's probably better to have many test functions than a few with parametrization, but a helper function that takes in raw_cmd might be worth looking at. See #100.
  • Add a test for a named font, because most tests will use a path to a font.
  • Update docs to reflect current state of testing.
    • Update cross-platform discussion.
  • Update Contributing docs, or project structure so that a new contributor can follow instructions on any OS and have a passing test suite. See notes about Windows here.
  • Add a pytest flag or plugin that rewrites all reference files. See here for current semi-automated approach.
  • Add a pytest flag or plugin that opens a terminal at the sample repo, and shows the command to run a git-sim command in that repo.
  • Consider capturing some of the unfinished tasks from #55 in a non-issue doc, ie continuous integration, testing CLI output.
  • Write any additional tests that are obviously helpful, such as light mode, one test for jpg.
  • Add a --test-current-release flag that will install git-sim from PyPI instead of using the local editable install. This can be nice to run immediately after making a release, and you can test different package managers as well.
<!-- gh-comment-id:1638457066 --> @ehmatthes commented on GitHub (Jul 17, 2023): Initial refinements --- - [ ] Consider using opencv in `compare_images()`? It's already a dependency of the project; it may provide a better measure of the correctness of generated images. - [x] Consider writing a helper function that reduces the repetition in test_core_commands.py. It's probably better to have many test functions than a few with parametrization, but a helper function that takes in `raw_cmd` might be worth looking at. See #100. - [ ] Add a test for a named font, because most tests will use a path to a font. - [ ] Update docs to reflect current state of testing. - [ ] Update cross-platform discussion. - [ ] Update Contributing docs, or project structure so that a new contributor can follow instructions on any OS and have a passing test suite. See notes about Windows [here](https://github.com/ehmatthes/git-sim/issues/3#issuecomment-1636930007). - [ ] Add a pytest flag or plugin that rewrites all reference files. See [here](https://github.com/ehmatthes/git-sim/issues/5#issuecomment-1638500258) for current semi-automated approach. - [ ] Add a pytest flag or plugin that opens a terminal at the sample repo, and shows the command to run a git-sim command in that repo. - [ ] Consider capturing some of the unfinished tasks from #55 in a non-issue doc, ie continuous integration, testing CLI output. - [ ] Write any additional tests that are obviously helpful, such as light mode, one test for jpg. - [ ] Add a `--test-current-release` flag that will install git-sim from PyPI instead of using the local editable install. This can be nice to run immediately after making a release, and you can test different package managers as well.
Author
Owner

@micwoj92 commented on GitHub (Feb 19, 2025):

Could you consider running tests without using venv for this refinement?

<!-- gh-comment-id:2669935250 --> @micwoj92 commented on GitHub (Feb 19, 2025): Could you consider running tests without using venv for this refinement?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-sim#58
No description provided.