Skip to content

Commit 8481b43

Browse files
CLOUDP-64099: Implementing e2e test for metrics databases - atlas (#184)
1 parent 569b229 commit 8481b43

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

e2e/atlas/metrics_processes_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,29 @@ func TestAtlasMetrics(t *testing.T) {
8383
}
8484
})
8585

86+
t.Run("databases list", func(t *testing.T) {
87+
cmd := exec.Command(cliPath,
88+
atlasEntity,
89+
metricsEntity,
90+
"databases",
91+
"list",
92+
hostname)
93+
94+
cmd.Env = os.Environ()
95+
resp, err := cmd.CombinedOutput()
96+
97+
databases := &mongodbatlas.ProcessDatabasesResponse{}
98+
err = json.Unmarshal(resp, &databases)
99+
100+
if err != nil {
101+
t.Fatalf("unexpected error: %v", err)
102+
}
103+
104+
if databases.TotalCount != 2 {
105+
t.Errorf("got=%#v\nwant=%#v\n", databases.TotalCount, 2)
106+
}
107+
})
108+
86109
deleteCluster(cliPath, atlasEntity, clusterName)
87110
}
88111

0 commit comments

Comments
 (0)