Skip to content

test: Improve TestHasConfigNameOverride so it doesn't leave projects after completion, fixes #7797 - #7798

Merged
rfay merged 3 commits into
mainfrom
20251106_rfay_test_name_config
Nov 10, 2025
Merged

rfay merged 3 commits into
mainfrom
20251106_rfay_test_name_config

Conversation

@rfay

@rfay rfay commented Nov 6, 2025 •

Copy link
Copy Markdown
Member

The Issue

  • TestHasConfigNameOverride was leaving orphaned project at exit, breaking TestCmdList later
  • TestCmdList was fragile, could be impacted by sites from other tests

How This PR Solves The Issue

  • TestHasConfigNameOverride cleans up the correct test name
  • TestCmdList now uses the XDG_CONFIG_HOME pattern, having a clean project list to start with

Manual Testing Instructions

Review test output, mostly on Windows

Notes

  • I don't actually understand why this only affected traditional Windows. Probably it's because the cleanup on Windows doesn't succeed in removing the project directory, which it would on linux and macOS.
  • I didn't deal with the fact that ddev delete <name> can't work here.
  • Assisted by Claude Code

rfay and others added 3 commits November 6, 2025 09:25
TestCmdList was fragile because it manually modified and restored
global_config.yaml. This changes it to use the XDG_CONFIG_HOME pattern
as demonstrated in TestCmdStartShowsSponsorshipData.

Changes:
- Use testcommon.CopyGlobalDdevDir() for isolated config directory
- Clear project_list.yaml before ddev start -a to prevent stale Test*
  projects from interfering
- Convert assert to require throughout for better test failure handling
- Fix ineffectual assignment to err caught by golangci-lint

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@rfay
rfay requested a review from a team as a code owner November 6, 2025 09:19
@rfay
rfay requested a review from stasadev November 6, 2025 09:19
@github-actions

github-actions Bot commented Nov 6, 2025

Copy link
Copy Markdown

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@rfay
rfay merged commit bc33c69 into main Nov 10, 2025
@rfay
rfay deleted the 20251106_rfay_test_name_config branch November 10, 2025 10:44
rfay added a commit that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants