[PR #92] [MERGED] Implement end-to-end testing. #93

Closed
opened 2026-03-02 16:48:09 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/initialcommit-com/git-sim/pull/92
Author: @ehmatthes
Created: 6/14/2023
Status: Merged
Merged: 6/16/2023
Merged by: @initialcommit-io

Base: devHead: start_e2e_testing


📝 Commits (3)

  • cc662b7 Implements end-to-end test suite using pytest.
  • 0a95bf7 Added brief documentation for testing.
  • baf6e03 Use git-dummy to generate sample repo.

📊 Changes

11 files changed (+267 additions, -0 deletions)

View changed files

📝 .gitignore (+2 -0)
tests/README.md (+73 -0)
tests/e2e_tests/conftest.py (+31 -0)
tests/e2e_tests/reference_files/git-sim-log.png (+0 -0)
tests/e2e_tests/reference_files/git-sim-log_windows.png (+0 -0)
tests/e2e_tests/reference_files/git-sim-merge.png (+0 -0)
tests/e2e_tests/reference_files/git-sim-merge_windows.png (+0 -0)
tests/e2e_tests/reference_files/git-sim-status.png (+0 -0)
tests/e2e_tests/reference_files/git-sim-status_windows.png (+0 -0)
tests/e2e_tests/test_core_commands.py (+54 -0)
tests/e2e_tests/utils.py (+107 -0)

📄 Description

As discussed in #55, implements a small set of end-to-end tests.

  • To run tests, you'll need to run pip install pytest if you don't already have it available.
  • I've run the tests on macOS and Windows. I believe they should run on most Linux systems, but have not checked that yet.
  • The image files that are generated on Windows are significantly different (pixel-wise) than what's generated on macOS. This looks like a font-rendering difference. To address this, there are Windows-specific reference files in the test resources.
  • I don't know if this is a Windows-specific issue, or something particular to my Windows setup. We may end up needing to have a small variety of reference images, and only fail a test if none of the reference images match.
  • Includes brief documentation about running tests, and adding new tests.
  • You can make tests fail by adding a call to run_git_reset(tmp_repo) in any of the test functions. This is helpful for seeing what test failures look like, and to make sure the image comparison function can actually fail appropriately.
  • The test functions are written so that every test function contains the raw command that we would expect users to run, such as git-sim log. A helper function then inserts the global options needed to make the tests work.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/initialcommit-com/git-sim/pull/92 **Author:** [@ehmatthes](https://github.com/ehmatthes) **Created:** 6/14/2023 **Status:** ✅ Merged **Merged:** 6/16/2023 **Merged by:** [@initialcommit-io](https://github.com/initialcommit-io) **Base:** `dev` ← **Head:** `start_e2e_testing` --- ### 📝 Commits (3) - [`cc662b7`](https://github.com/initialcommit-com/git-sim/commit/cc662b7de28b9ef1f1e792ed33f925d2e9a86ff8) Implements end-to-end test suite using pytest. - [`0a95bf7`](https://github.com/initialcommit-com/git-sim/commit/0a95bf7ea21790a673a69ac7908ca98ce0ba0e38) Added brief documentation for testing. - [`baf6e03`](https://github.com/initialcommit-com/git-sim/commit/baf6e037dccf6aa181ecc28cf0bf7d71674bf04f) Use git-dummy to generate sample repo. ### 📊 Changes **11 files changed** (+267 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -0) ➕ `tests/README.md` (+73 -0) ➕ `tests/e2e_tests/conftest.py` (+31 -0) ➕ `tests/e2e_tests/reference_files/git-sim-log.png` (+0 -0) ➕ `tests/e2e_tests/reference_files/git-sim-log_windows.png` (+0 -0) ➕ `tests/e2e_tests/reference_files/git-sim-merge.png` (+0 -0) ➕ `tests/e2e_tests/reference_files/git-sim-merge_windows.png` (+0 -0) ➕ `tests/e2e_tests/reference_files/git-sim-status.png` (+0 -0) ➕ `tests/e2e_tests/reference_files/git-sim-status_windows.png` (+0 -0) ➕ `tests/e2e_tests/test_core_commands.py` (+54 -0) ➕ `tests/e2e_tests/utils.py` (+107 -0) </details> ### 📄 Description As discussed in #55, implements a small set of end-to-end tests. - To run tests, you'll need to run `pip install pytest` if you don't already have it available. - I've run the tests on macOS and Windows. I believe they should run on most Linux systems, but have not checked that yet. - The image files that are generated [on Windows](https://github.com/ehmatthes/git-sim/blob/start_e2e_testing/tests/e2e_tests/reference_files/git-sim-log_windows.png) are significantly different (pixel-wise) than what's generated [on macOS](https://github.com/ehmatthes/git-sim/blob/start_e2e_testing/tests/e2e_tests/reference_files/git-sim-log.png). This looks like a font-rendering difference. To address this, there are Windows-specific reference files in the test resources. - I don't know if this is a Windows-specific issue, or something particular to my Windows setup. We may end up needing to have a small variety of reference images, and only fail a test if none of the reference images match. - Includes brief documentation about running tests, and adding new tests. - You can make tests fail by adding a call to `run_git_reset(tmp_repo)` in any of the test functions. This is helpful for seeing what test failures look like, and to make sure the image comparison function can actually fail appropriately. - The test functions are written so that every test function contains the raw command that we would expect users to run, such as `git-sim log`. A helper function then inserts the global options needed to make the tests work. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem closed this issue 2026-03-02 16:48:10 +03:00
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#93
No description provided.