Skip to content

Commit 1d362ac

Browse files
authored
Added node and type selector UI to Error Logs screen (#1715)
1 parent 6f5cb4d commit 1d362ac

21 files changed

+951
-91
lines changed

integration/admin_api_integration_test.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,29 @@ func RestartService() (*http.Response, error) {
5555
return response, err
5656
}
5757

58+
func GetNodes() (*http.Response, error) {
59+
/*
60+
Helper function to get nodes
61+
HTTP Verb: GET
62+
URL: /api/v1/nodes
63+
*/
64+
request, err := http.NewRequest(
65+
"GET",
66+
"http://localhost:9090/api/v1/nodes",
67+
nil,
68+
)
69+
if err != nil {
70+
log.Println(err)
71+
}
72+
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
73+
request.Header.Add("Content-Type", "application/json")
74+
client := &http.Client{
75+
Timeout: 2000 * time.Second, // increased timeout since restart takes time, more than other APIs.
76+
}
77+
response, err := client.Do(request)
78+
return response, err
79+
}
80+
5881
func NotifyPostgres() (*http.Response, error) {
5982
/*
6083
Helper function to add Postgres Notification
@@ -257,3 +280,23 @@ func TestListUsersWithAccessToBucket(t *testing.T) {
257280
}
258281

259282
}
283+
284+
func TestGetNodes(t *testing.T) {
285+
286+
assert := assert.New(t)
287+
getNodesResponse, getNodesError := GetNodes()
288+
assert.Nil(getNodesError)
289+
if getNodesError != nil {
290+
log.Println(getNodesError)
291+
return
292+
}
293+
addObjRsp := inspectHTTPResponse(getNodesResponse)
294+
if getNodesResponse != nil {
295+
assert.Equal(
296+
200,
297+
getNodesResponse.StatusCode,
298+
addObjRsp,
299+
)
300+
}
301+
302+
}

0 commit comments

Comments
 (0)