Skip to content

Commit 2f7d75f

Browse files
committed
use run_integration_tests.sh to run tests against disagg cluster
runs tests against disagg
1 parent fedbd7f commit 2f7d75f

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

common/testutil/testutil.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ func GetBareSession() (*mongo.Client, error) {
4040
// GetBareSessionProvider returns a session provider from the environment or
4141
// from a default host and port.
4242
func GetBareSessionProvider() (*db.SessionProvider, *options.ToolOptions, error) {
43+
fmt.Printf("-- GetBareSessionProvider ...\n")
4344
var toolOptions *options.ToolOptions
4445

4546
// get ToolOptions from URI or defaults
4647
if uri := os.Getenv("TOOLS_TESTING_MONGOD"); uri != "" {
48+
fmt.Printf("-- GetBareSessionProvider --uri=%s ...\n", uri)
4749
fakeArgs := []string{"--uri=" + uri}
48-
toolOptions = options.New("mongodump", "", "", "", true, options.EnabledOptions{URI: true})
50+
toolOptions = options.New("mongodump", "", "", "", true, options.EnabledOptions{Auth: true, URI: true})
4951
_, err := toolOptions.ParseArgs(fakeArgs)
5052
if err != nil {
5153
panic(fmt.Sprintf("Could not parse TOOLS_TESTING_MONGOD environment variable: %v", err))
@@ -70,10 +72,12 @@ func GetBareSessionProvider() (*db.SessionProvider, *options.ToolOptions, error)
7072
if err != nil {
7173
return nil, nil, err
7274
}
75+
fmt.Printf("-- db.NewSessionProvider ...\n")
7376
sessionProvider, err := db.NewSessionProvider(*toolOptions)
7477
if err != nil {
7578
return nil, nil, err
7679
}
80+
fmt.Printf("-- db.NewSessionProvider done\n")
7781
return sessionProvider, toolOptions, nil
7882
}
7983

mongodump/mongodump_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,11 @@ func TestMongoDumpTOOLS2498(t *testing.T) {
14801480
// during this period. Before the fix, the process will panic with Nil pointer error since it fails to getCollectionInfo.
14811481
go func() {
14821482
time.Sleep(2 * time.Second)
1483-
session, _ := md.SessionProvider.GetSession()
1483+
session, err := md.SessionProvider.GetSession()
1484+
if err != nil {
1485+
t.Fatalf("Error from GetSession: %v", err)
1486+
return
1487+
}
14841488
disconnectErr = session.Disconnect(context.Background())
14851489
}()
14861490

rcownie_disagg1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This branch is for work related to disaggregated storage testing.

run_integration_tests.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# Set environment variables here for the cluster to be tested.
4+
export TOOLS_TESTING_AUTH_USERNAME="rcownie"
5+
export TOOLS_TESTING_AUTH_PASSWORD="penguin"
6+
export TOOLS_TESTING_MONGOD="mongodb+srv://rcownie:[email protected]/?retryWrites=true&w=majority&appName=rcownie1"
7+
export TOOLS_TESTING_AUTH="non-empty-string"
8+
9+
echo "Running integration tests for cluster connection ${TOOLS_TESTING_MONGOD}"
10+
go run build.go test:integration
11+

0 commit comments

Comments
 (0)