Skip to content

Prevent integration tests from running when testing with -short #2116

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthewdale
Copy link
Collaborator

Summary

  • Skip tests that call integtest.ConnString if running with -short.
  • Skip the TestServerHeartbeatTimeout test if running with -short because it's an integration test.

Background & Motivation

This should also fix the "Docker Runner Test" task.

@matthewdale matthewdale requested a review from a team as a code owner June 27, 2025 01:28
@matthewdale matthewdale requested a review from qingyang-hu June 27, 2025 01:28
@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the priority-3-low Low Priority PR for Review label Jun 27, 2025
Copy link
Contributor

API Change Report

No changes found!

@@ -223,6 +223,10 @@ func AddServerlessAuthCredentials(uri string) (string, error) {

// ConnString gets the globally configured connection string.
func ConnString(t *testing.T) *connstring.ConnString {
if testing.Short() {
t.Skip("skipping integration test in short mode")
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a little strange to skip the tests from a helper function. Is it possible to skip from TestXXX()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-3-low Low Priority PR for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants