[
https://issues.apache.org/jira/browse/YUNIKORN-2590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chia-Ping Tsai resolved YUNIKORN-2590.
--------------------------------------
Fix Version/s: 1.6.0
Resolution: Fixed
> Handler tests should check for nil request on create
> ----------------------------------------------------
>
> Key: YUNIKORN-2590
> URL: https://issues.apache.org/jira/browse/YUNIKORN-2590
> Project: Apache YuniKorn
> Issue Type: Improvement
> Components: core - common, test - unit
> Reporter: Wilfred Spiegelenburg
> Assignee: Hsien-Cheng(Ryan) Huang
> Priority: Major
> Labels: newbie, pull-request-available
> Fix For: 1.6.0
>
>
> In the handler_test.go file we have an anti pattern showing a large number
> (40+) warnings in an IDE:
> {quote}'req' might have 'nil' or other unexpected value as its corresponding
> error variable might be not 'nil'
> {quote}
> The warning are due to the fact that we have the following pattern:
> {code:java}
> req, err = http.NewRequest("GET", "path", strings.NewReader(""))
> req = req.WithContext(context.WithValue(req.Context(), httprouter.ParamsKey,
> httprouter.Params{})){code}
> There is no error assertion after the request creation. We should add a
> simple {{assert.NilError(t, err, "HTTP request create failed")}} inserted
> between creating and using the request.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]