Skip to content

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

Open
helloeve wants to merge 2 commits intomainfrom
fix-temp-file
Open

fix: prevent test.db from being created during unit tests#3042
helloeve wants to merge 2 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
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