bndr / gojenkins

Jenkins API Client in Go. Looking for maintainers to move this project forward.
Apache License 2.0
863 stars 443 forks source link

GetResultSet() - "duration" in "_class": "hudson.tasks.junit.TestResult" is coming 0 #227

Closed saurabh-openstack closed 3 years ago

saurabh-openstack commented 3 years ago

"duration" in "_class": "hudson.tasks.junit.TestResult" is coming 0. The type incorrectly configured to int64 while from Jenkins it is float. -- Jenkins API output {Jenkins URL}{JOB}testReport/api/json "_class": "hudson.tasks.junit.TestResult", "testActions": [], "duration": 343.131, <--- float "empty": false, "failCount": 0, "passCount": 394, "skipCount": 0,

--gojenkins sdk func (b Build) GetResultSet() (TestResult, error)

type TestResult struct { Duration int64 json:"duration". <---- int64 Empty bool json:"empty" FailCount int64 json:"failCount" PassCount int64 json:"passCount" SkipCount int64 json:"skipCount"

Due to mismatch of type the duration returned by GetResultSet() is coming to 0.

figo commented 3 years ago

Hi @saurabh-openstack thanks for reporting, would you mind open PR with a fix?

saurabh-openstack commented 3 years ago

@figo Thanks a lot. I was just about to fix this but observed it is already fixed. [FixLink]. So marking this issue as fixed.