Skip to content

[Bug]: Ensure Test Cases Use Mock Database instead of Main DBΒ #810

@kevalmahajan

Description

@kevalmahajan

🐞 Bug Summary

During test case execution, the tools created for testing are being added to the main database instead of a mock or in-memory database

🧩 Affected Component

Select the area of the project impacted:

  • mcpgateway - API
  • mcpgateway - UI (admin panel)
  • mcpgateway.wrapper - stdio wrapper
  • Federation or Transports
  • CLI, Makefiles, or shell scripts
  • Container setup (Docker/Podman/Compose)
  • Other (explain below)

πŸ” Steps to Reproduce

  1. Run make test.
  2. Verify the database configured as your main/production DB in the .env file.
  3. You’ll notice that tools created during the tests are being inserted into this main database and are visible in the UI.

πŸ€” Expected Behavior

Test cases should use a mock or in-memory database for creating tools and performing all related operations, to avoid polluting the main/production database.


πŸ““ Logs / Error Output

Image

🧠 Environment Info

You can retrieve most of this from the /version endpoint.

Key Value
Version or commit e.g. v0.9.0 or main@a1b2c3d
Runtime e.g. Python 3.11, Gunicorn
Platform / OS e.g. Ubuntu 22.04, macOS
Container e.g. Docker, Podman, none

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriageIssues / Features awaiting triage

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions