Skip to content

Comments

feat - e2e tests + evals#32

Merged
kiliczsh merged 3 commits intokiliczsh:mainfrom
mclenhard:feat/add-e2e-test-and-evals
May 3, 2025
Merged

feat - e2e tests + evals#32
kiliczsh merged 3 commits intokiliczsh:mainfrom
mclenhard:feat/add-e2e-test-and-evals

Conversation

@mclenhard
Copy link
Contributor

Adds new e2e test that loads an MCP client, which in turn runs the server and processes the actual tool call. Afterwards, it then grades the response for correctness.

note: I'm the package author

Copy link

@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.

Hello @mclenhard, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request introduces end-to-end (e2e) tests and evaluations using the mcp-evals package. The goal is to load an MCP client, run the server, process tool calls, and then grade the responses for correctness. The changes include adding the mcp-evals dependency to package.json, creating a new evals.ts file with evaluation functions for various tools (query, aggregate, update, serverInfo, insert, createIndex, count, listCollections), and updating the README.md file with instructions on how to run the evals.

Highlights

  • E2E Testing: Adds new e2e tests to verify the functionality of the MCP client and server.
  • MCP Evals Integration: Integrates the mcp-evals package to grade the responses from tool calls.
  • New Eval Functions: Creates evaluation functions for various tools, including query, aggregate, update, and more.
  • Documentation: Updates the README with instructions on running the evals.

Changelog

  • README.md
    • Added a new section on running evals with instructions and an example command using npx mcp-eval.
  • package.json
    • Added mcp-evals as a dependency.
  • src/evals/evals.ts
    • Created a new file evals.ts containing evaluation functions for different tools.
    • Implemented evaluation functions for query, aggregate, update, serverInfo, insert, createIndex, count, and listCollections.
    • Configured the evals using EvalConfig and the OpenAI GPT-4 model.
    • Exported the configuration and the list of evals.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


The tests run, the evals grade,
Ensuring code is well-made.
With each tool's call,
We check them all,
Quality's promise, unafraid.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@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 introduces e2e tests using the mcp-evals package to evaluate the MCP client's interaction with the MongoDB server. The tests cover various MongoDB operations and grade the responses for correctness. Overall, this is a valuable addition to the project, enhancing its test coverage and reliability. However, there are a few areas that could be improved for clarity and maintainability.

Summary of Findings

  • Eval Function Coverage: While several eval functions are defined, only the query function is currently used in the config object. Consider expanding the coverage to include other eval functions to provide a more comprehensive test suite.
  • Duplicated Eval Definitions: The query eval is defined twice, once as a constant and again as part of the evals array. This redundancy should be removed to avoid confusion and potential maintenance issues.
  • README.md Documentation: The documentation added to the README is helpful, but could be expanded to provide more context on how the evals work and how to interpret the results.

Merge Readiness

The pull request introduces valuable e2e tests and is a step in the right direction for improving the project's reliability. However, the issues identified, particularly the limited eval function coverage and duplicated definitions, should be addressed before merging. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging.

@kiliczsh kiliczsh merged commit 54dbda2 into kiliczsh:main May 3, 2025
1 check failed
kiliczsh pushed a commit that referenced this pull request May 3, 2025
* feat - tests + evals

* [bugfix] fix readme

* [feat] add other evals to export
@kiliczsh
Copy link
Owner

kiliczsh commented May 3, 2025

@mclenhard thanks for improvement 🚀

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