Repository navigation
fix(testgen): stop before installing over leftover pip data, and let uninstall remove it - #104
Merged
Merged
Conversation
…uninstall remove it A failed pip install could leave ~/.testgen/config.env behind. The next install then ran `testgen standalone-setup`, which stopped at an overwrite prompt the installer has no terminal to answer, and the user saw only "Aborted!". Uninstalling did not help: without an install marker, delete reported nothing to delete and left the data in place, so every retry failed. - Install stops before it starts when TestGen's home already holds a config.env, and says to uninstall first (abort reason leftover_data). - Delete treats a TestGen home without an install marker as a pip install, says it is removing leftover data, and removes it. - A failed command shows its stdout as well as its stderr, and command logs are read as UTF-8. - Tests point TG_TESTGEN_HOME at a temporary folder so they never read or delete the developer's own ~/.testgen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coverage Report •
|
diogodk
reviewed
Nov 20, 2026
Contributor
|
For Claude.md line 58 Nit: this says delete returns when no install exists, but with this PR tg delete also falls back to pip mode when TestGen's home exists without a marker, and removes it. Worth a clause here so the next reader of this section knows. |
…ment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
diogodk
approved these changes
Nov 20, 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
A failed pip install could leave
~/.testgen/config.envbehind. The next install rantestgen standalone-setup, which stopped at an overwrite prompt the installer has no terminal to answer, so the user saw onlyAborted!. Uninstalling did not help: with no install marker, delete reported "Nothing to delete" and left the data, so every retry failed the same way. This was reproduced on a clean Windows machine with the releaseddk-installer.exe.config.env, and tells the user to uninstall first (new abort reasonleftover_data).TG_TESTGEN_HOMEat a temporary folder so they never read or delete the developer's own~/.testgen.TestGen's side of the fix (a clear message instead of the prompt, a database reset on overwrite, readable embedded PostgreSQL errors) ships separately in TestGen.
Test plan
pytest: 331 passed;ruff checkandruff format --checkcleandk-installer.py: install over a leftoverconfig.envstops with the new message; delete with no marker removes the data; a clean reinstall succeedsdk-installer.exeshows the same behaviorMerging republishes the public
dk-installer.exe.🤖 Generated with Claude Code