Skip to content

Conversation

himanshusinghs
Copy link
Collaborator

@himanshusinghs himanshusinghs commented Oct 14, 2025

Proposed changes

In some places we were doing the same wiring as the one that is already done in describeWithMongoDB and the reason for that was we needed some extra configuration to be passed down to setupIntegrationTest or to setupMongoDBIntegrationTest. This PR modifies describeWithMongoDB to accept the additional parameters and pass them down to setupIntegrationTest and setupMongoDBIntegrationTest and unify the usage in tests to use describeWithMongoDB instead of manual wiring.

The motivation is to have one place to have checks like skipping test on specific environments.

Notes for reviewers

Review individual commits.

  • The first commit is only a refactor, changes the describeWithMongoDB interface to accept test suite config instead of individual function parameters.
  • The second commit adds elicitation related options to the interface of describeWithMongoDB and adapts elicitation tests to use describeWithMongoDB.

Checklist

@himanshusinghs himanshusinghs marked this pull request as ready for review October 14, 2025 11:12
@himanshusinghs himanshusinghs requested a review from a team as a code owner October 14, 2025 11:12
@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 11:12
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the describeWithMongoDB helper function interface to accept a configuration object instead of individual parameters, and adds support for elicitation-related options. The change improves maintainability as the number of parameters was increasing.

Key changes:

  • Refactored describeWithMongoDB to accept a TestSuiteConfig object instead of separate function parameters
  • Added elicitation support with getMockElicitationInput and getClientCapabilities options
  • Updated all test files to use the new interface with defaultTestSuiteConfig as the base configuration

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

File Description
tests/integration/tools/mongodb/mongodbHelpers.ts Defines new TestSuiteConfig interface and updates describeWithMongoDB function signature
tests/integration/elicitation.test.ts Converts elicitation tests to use describeWithMongoDB with new elicitation options
Multiple test files (search, read, connect, etc.) Updates all existing describeWithMongoDB calls to use new object-based configuration

@himanshusinghs himanshusinghs changed the title chore: change interface of describeWithMongoDB helper chore: use describeWithMongoDB to setup test suites instead of custom wiring Oct 14, 2025
@himanshusinghs himanshusinghs added the no-title-validation Add this label to disable the title check for this PR. label Oct 14, 2025
The number of parameters were increasing as I wanted to add elicitInput
as another argument. This commit compacts the rest of the config
parameters in an object and modifies the usage to call the method
correctly.

Additionally, in places where we were just doing the defaults, this
commit modifies those calls to not pass anything and rely on default.
Additionally modifies elicitation tests to use describeWithMongoDB
@himanshusinghs himanshusinghs force-pushed the chore/tests-helper-refactor branch from d8fea3a to 475ea09 Compare October 14, 2025 12:13
Copy link
Collaborator

@nirinchev nirinchev left a comment

Choose a reason for hiding this comment

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

Makes sense - just a minor ergonomics suggestion from me.

@himanshusinghs himanshusinghs enabled auto-merge (squash) October 14, 2025 17:33
@himanshusinghs himanshusinghs merged commit 9a2c002 into main Oct 14, 2025
18 of 26 checks passed
@himanshusinghs himanshusinghs deleted the chore/tests-helper-refactor branch October 14, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Add this label to disable the title check for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants