Skip to content

Conversation

@addaleax
Copy link
Collaborator

@addaleax addaleax commented Dec 5, 2025

The first and last commits are mainly Search/Replace commits, so it may or may not be easier to review this commit-by-commit 🙂

Copilot AI review requested due to automatic review settings December 5, 2025 16:37
@addaleax addaleax requested a review from a team as a code owner December 5, 2025 16:37
@addaleax addaleax added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Dec 5, 2025
Copy link

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 e2e-tests package to import testing utilities from the @mongosh/testing package instead of using relative paths. The changes centralize testing utilities and improve the modularity of the codebase.

  • Replaced relative imports from ../../testing/src/ with imports from @mongosh/testing
  • Converted startTestShell from a Mocha Context prototype extension to a standalone function
  • Added runtime safety checks for global test hooks availability
  • Updated test configuration to remove the now-unnecessary test-shell-context require

Reviewed changes

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

Show a summary per file
File Description
packages/testing/src/integration-testing-hooks.ts Added runtime checks for global after hook availability and improved shared test server initialization
packages/e2e-tests/test/test-shell.ts Updated import to use @mongosh/testing package
packages/e2e-tests/test/test-shell-context.ts Converted startTestShell from prototype method to standalone function, removed Mocha Context module augmentation
packages/e2e-tests/test/test-shell-context.spec.ts Updated to use new startTestShell function signature with explicit context parameter
packages/e2e-tests/test/repl-helpers.ts Updated imports and removed unused getCertPath function
packages/e2e-tests/test/e2e.spec.ts Updated all test files to use @mongosh/testing imports and new startTestShell function signature
packages/e2e-tests/test/e2e-tls.spec.ts Updated imports and test calls to use new patterns
packages/e2e-tests/test/e2e-streams.spec.ts Updated imports and test calls
packages/e2e-tests/test/e2e-snippet.spec.ts Updated imports and test calls
packages/e2e-tests/test/e2e-snapshot.spec.ts Updated imports and test calls
packages/e2e-tests/test/e2e-proxy.spec.ts Updated imports, moved getCertPath to @mongosh/testing
packages/e2e-tests/test/e2e-oidc.spec.ts Updated imports and test calls
packages/e2e-tests/test/e2e-fle.spec.ts Updated imports and test calls
packages/e2e-tests/test/e2e-editor.spec.ts Updated imports and test calls
packages/e2e-tests/test/e2e-direct.spec.ts Updated imports and test calls
packages/e2e-tests/test/e2e-bson.spec.ts Updated imports and test calls
packages/e2e-tests/test/e2e-banners.spec.ts Updated imports and test calls
packages/e2e-tests/test/e2e-aws.spec.ts Updated test calls to use new function signature
packages/e2e-tests/test/e2e-auth.spec.ts Updated imports and test calls
packages/e2e-tests/test/e2e-analytics.spec.ts Updated imports and test calls
packages/e2e-tests/package.json Added @mongosh/testing dependency
packages/e2e-tests/.mocharc.json Removed test-shell-context from required modules

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@gagik gagik left a comment

Choose a reason for hiding this comment

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

Amazing, thank you for looking into this!

@gagik
Copy link
Contributor

gagik commented Dec 8, 2025

Ah seems like e2e tests are still failing but still seems like the right direction.

@addaleax addaleax merged commit 99d5227 into main Dec 8, 2025
152 of 155 checks passed
@addaleax addaleax deleted the testing-fixes branch December 8, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants