-
Notifications
You must be signed in to change notification settings - Fork 84
chore(e2e-tests): import from @mongosh/testing #2615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
startTestShellfrom 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.
gagik
left a comment
There was a problem hiding this 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!
|
Ah seems like e2e tests are still failing but still seems like the right direction. |
The first and last commits are mainly Search/Replace commits, so it may or may not be easier to review this commit-by-commit 🙂