test: check server warnings after each e2e test COMPASS-10017#7845
Merged
paula-stacho merged 15 commits intomainfrom Mar 19, 2026
Merged
test: check server warnings after each e2e test COMPASS-10017#7845paula-stacho merged 15 commits intomainfrom
paula-stacho merged 15 commits intomainfrom
Conversation
c9f9b31 to
8e90bd1
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an automated guardrail to the Compass e2e test harness to fail tests when MongoDB server logs emit unexpected warnings/errors, with mechanisms to allowlist known/expected warnings in a scoped way.
Changes:
- Introduces
ServerLogsCheckerin@mongodb-js/compass-test-serverand re-exports it for use by test infrastructure. - Wires server log checking into the e2e runner (global setup creates checkers; root hook runs a checkpoint after each test).
- Updates e2e tests to use the new
mongo-clientshelper import path and adds scoped allowlists for tests that intentionally trigger server warnings.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/compass-test-server/src/server-logs-checker.ts | New server log warning checker |
| packages/compass-test-server/src/index.ts | Export checker and types |
| packages/compass-e2e-tests/tests/time-to-first-query.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/tabs.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/read-write.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/read-only.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/my-queries-tab.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/instance-sidebar.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/instance-databases-tab.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/database-collections-tab.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/data-modeling-tab.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/collection-validation-tab.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/collection-schema-tab.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/collection-rename.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/collection-indexes-tab.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/collection-import.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/collection-heading.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/collection-export.test.ts | Add scoped server-warning allowlist |
| packages/compass-e2e-tests/tests/collection-documents-tab.test.ts | Add scoped server-warning allowlists |
| packages/compass-e2e-tests/tests/collection-bulk-update.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/collection-bulk-delete.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/collection-ai-query.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/collection-aggregations-tab.test.ts | Add scoped server-warning allowlists |
| packages/compass-e2e-tests/tests/atlas-cloud/rolling-indexes.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/atlas-cloud/global-writes.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/tests/atlas-cloud/collection-ai-query.test.ts | Switch helper import to mongo-clients |
| packages/compass-e2e-tests/index.ts | Use mochaRootHooks from mongo-clients |
| packages/compass-e2e-tests/helpers/test-runner-global-fixtures.ts | Create/close log checkers + allowlists |
| packages/compass-e2e-tests/helpers/mongo-clients.ts | Add afterEach server-warning checkpoint |
packages/compass-e2e-tests/helpers/test-runner-global-fixtures.ts
Outdated
Show resolved
Hide resolved
packages/compass-e2e-tests/helpers/test-runner-global-fixtures.ts
Outdated
Show resolved
Hide resolved
addaleax
approved these changes
Mar 9, 2026
| * Monitors MongoDB server logs and validates that no unexpected warnings occur. | ||
| * Modeled after the mongosh implementation in PR #2574. | ||
| */ | ||
| export class ServerLogsChecker { |
Collaborator
There was a problem hiding this comment.
Do we want to put this file into devtools-shared? We're almost certainly going to end up using the same code in mongosh
Collaborator
There was a problem hiding this comment.
addaleax
reviewed
Mar 9, 2026
| ].includes(l.attr?.error?.codeName) | ||
| ); | ||
| }, | ||
| ]; |
Collaborator
There was a problem hiding this comment.
This should maybe include a few more warnings from the mongosh version of the PR
I'll create a suggestion for a PR to add this to devtools-shared
addaleax
added a commit
that referenced
this pull request
Mar 19, 2026
13 tasks
paula-stacho
added a commit
that referenced
this pull request
Mar 24, 2026
…er package (#7890) * chore(compass-test-server): switch to shared mongodb-server-log-checker package Refs: #7845 (comment) * update server-log-checker --------- Co-authored-by: Paula Stachova <paula.stachova@mongodb.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Following mongodb-js/mongosh#2574
Added exceptions for warnings that we run into now. There is a global exceptions list, other exceptions can be added & removed at runtime.
I tried to keep them specific if possible, so that we'll see if something new is introduced.
Note: do hide whitespaces for review
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes