ryankert01 commented on code in PR #970:
URL: https://github.com/apache/yunikorn-core/pull/970#discussion_r1764319487
##########
pkg/webservice/handlers_test.go:
##########
@@ -318,6 +318,18 @@ func newApplication(appID, partitionName, queueName, rmID
string, ugi security.U
return objects.NewApplication(siApp, userGroup, nil, rmID)
}
+func TestGetStackInfo(t *testing.T) {
+ req, err := http.NewRequest("GET", "", strings.NewReader(baseConf))
+ assert.NilError(t, err, "Error creating request")
+ resp := &MockResponseWriter{}
+ getStackInfo(resp, req)
+
+ // assert stack trace
+ assert.Assert(t, strings.Contains(string(resp.outputBytes),
"goroutine"), "Stack trace should be present in the response")
+ assert.Assert(t, strings.Contains(string(resp.outputBytes), "test"),
"Stack trace should be present in the response")
+ assert.Assert(t, strings.Contains(string(resp.outputBytes),
"github.com/apache/yunikorn-core/pkg/webservice.getStackInfo"), "Stack trace
should be present in the response")
+}
Review Comment:
I don't think there's a negative case there, could you point it out?
Ps. I added a deep stack trace case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]