Skip to content

fix(testgen): stop before installing over leftover pip data, and let uninstall remove it - #104

Merged
aarthy-dk merged 2 commits into
mainfrom
fix/pip-install-leftover-data
Nov 20, 2026
Merged

aarthy-dk merged 2 commits into
mainfrom
fix/pip-install-leftover-data

Conversation

@aarthy-dk

Copy link
Copy Markdown
Contributor

Summary

A failed pip install could leave ~/.testgen/config.env behind. The next install ran testgen standalone-setup, which stopped at an overwrite prompt the installer has no terminal to answer, so the user saw only Aborted!. 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 released dk-installer.exe.

  • Install stops before it starts when TestGen's home already holds a config.env, and tells the user to uninstall first (new 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 (cp1252 could crash the error report on Windows).
  • Tests point TG_TESTGEN_HOME at 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 check and ruff format --check clean
  • On a clean Windows WorkSpace with this branch's dk-installer.py: install over a leftover config.env stops with the new message; delete with no marker removes the data; a clean reinstall succeeds
  • After merge, the republished dk-installer.exe shows the same behavior

Merging republishes the public dk-installer.exe.

🤖 Generated with Claude Code

…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>
@aarthy-dk
aarthy-dk requested a review from diogodk November 20, 2026 16:13
Comment thread dk-installer.py Resolved
@diogodk

diogodk commented Nov 20, 2026

Copy link
Copy Markdown
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>
@aarthy-dk

Copy link
Copy Markdown
Contributor Author

@diogodk Thanks — added the clause to the CLAUDE.md bullet in 3826f85: delete treats a TestGen home without a marker as pip mode and removes it, since a failed or interrupted pip install leaves data behind but writes no marker.

@aarthy-dk
aarthy-dk merged commit 27d6794 into main Nov 20, 2026
4 checks passed
@aarthy-dk
aarthy-dk deleted the fix/pip-install-leftover-data branch November 20, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants