Skip to content

fix: prevent test.db from being created during unit tests#3042

Merged
Yuan325 merged 5 commits intomainfrom
fix-temp-file
Apr 16, 2026
Merged

fix: prevent test.db from being created during unit tests#3042
Yuan325 merged 5 commits intomainfrom
fix-temp-file

Conversation

@helloeve
Copy link
Copy Markdown
Contributor

@helloeve helloeve commented Apr 13, 2026

This PR updates the unit tests to use in-memory SQLite databases (:memory:) instead of creating physical test.db files on disk.

While using tmp directory for managing the test.db file is a plausible approach, it will encounter file-locking conflicts on Windows during test cleanup which prevents the clean-up of database files located in tmp directory.

@helloeve helloeve changed the title fix unit tests to avoid test.db appear after each run fix: avoid test.db appear after each unit test run Apr 13, 2026
@helloeve helloeve changed the title fix: avoid test.db appear after each unit test run fix: prevent test.db from being created during unit tests Apr 13, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the TestInvokeTool function in cmd/internal/invoke/command_test.go to use a dynamic temporary directory for the SQLite database path instead of a hardcoded file. The review feedback suggests wrapping the database path in single quotes within the YAML configuration to ensure it is parsed correctly if the path contains spaces or special characters.

Comment thread cmd/internal/invoke/command_test.go Outdated
@helloeve helloeve marked this pull request as ready for review April 13, 2026 15:03
@helloeve helloeve requested a review from a team as a code owner April 13, 2026 15:03
@Yuan325 Yuan325 enabled auto-merge (squash) April 16, 2026 22:07
@Yuan325 Yuan325 merged commit d10d2ca into main Apr 16, 2026
18 checks passed
@Yuan325 Yuan325 deleted the fix-temp-file branch April 16, 2026 22:32
@github-actions
Copy link
Copy Markdown
Contributor

🧨 Preview deployments removed.

Cloudflare Pages environments for pr-3042 have been deleted.

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