Make E2E tests more comprehensive and less flaky - #58
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the E2E test suite by making test prerequisites explicit per test (reducing hidden inter-test dependencies) and by asserting real filesystem/config side effects instead of relying only on CLI output.
Changes:
- Refactored E2E fixtures to use function-scoped setup/download/verify fixtures for clearer, isolated test setup.
- Strengthened E2E assertions to validate generated config/progress files and their contents.
- Updated check/setup/download/verify/progress tests to rely on the new fixtures and more specific output/side-effect expectations.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/conftest.py | Replaces the session-scoped exercises fixture with explicit function-scoped setup/download/verify fixtures. |
| tests/e2e/commands/test_setup.py | Adds assertions for default config flags and empty progress.json. |
| tests/e2e/commands/test_download.py | Validates .gitmastery-exercise.json includes the expected exercise_name. |
| tests/e2e/commands/test_verify.py | Verifies verify writes a progress entry with expected fields. |
| tests/e2e/commands/test_progress.py | Asserts progress_remote toggling and that reset removes the exercise entry. |
| tests/e2e/commands/test_check.py | Tightens output assertions to the final “installed and configured” messages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jovnc
force-pushed
the
test/improve-e2e-test
branch
from
March 7, 2026 17:04
77814c1 to
2f67a71
Compare
SAN-MUYUN
reviewed
Mar 9, 2026
SAN-MUYUN
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Just need to take note of the test_progress_reset in terms of how we want to test reset of answer.txt.
jiaxinnns
approved these changes
Mar 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactored conftest.py to make each test's prerequisites explicit and eliminating hidden ordering dependencies
Strengthened assertions in existing tests to validate actual file and state side effects, not just CLI output:
Verification
pyinstaller --onefile main.py --name gitmasterypython -m pytest tests/e2e/ -v