Skip to content

Conversation

kevalmahajan
Copy link
Member

🐛 Bug-fix PR


📌 Summary

Closes #810
Previously, test cases were unintentionally using the production (or main) database configured in the .env file. As a result, test data including tools created during tests were being written to the main DB, causing data pollution and potentially impacting the integrity of production data.

💡 Fix Description

  1. All test cases now use an in-memory (mock) database, isolated from the production environment.
  2. Test data is ephemeral and discarded after each test run, maintaining a clean state.
  3. The .env configuration for the production database is no longer referenced during test execution.
  4. Tools and other entities created during testing are now invisible in the UI or any environment tied to the main DB.

Testing 🛠️

  1. Run make test.
  2. Confirm that no tools are created in your main database (as configured in .env).
  3. Run make serve and open the UI.
  4. Ensure that no new tools appear in the UI as a result of running the test cases.

🧪 Verification

Check Command Status
Lint suite make lint
Unit tests make test
Coverage ≥ 90 % make coverage
Manual regression no longer fails steps / screenshots

📐 MCP Compliance (if relevant)

  • Matches current MCP spec
  • No breaking change to MCP clients

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • No secrets/credentials committed

@crivetimihai
Copy link
Member

crivetimihai commented Aug 25, 2025

I believe this is already fixed in main, can you check and rebase please?

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.

[Bug]: Ensure Test Cases Use Mock Database instead of Main DB
2 participants