Skip to content

Commit

Permalink
Merge pull request #78 from wizeline/feature/update_review_time_in_mi…
Browse files Browse the repository at this point in the history
…nutes_unit

GWZ-217: Update review time in PullRequest Information with minutes unit
  • Loading branch information
npak243 authored Aug 5, 2020
2 parents 5a70921 + 574cb3e commit 1823ccf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/controller/pullrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func getPullRequestSize(c *gin.Context) {
Title: pullRequest.Title,
Size: pullRequest.Addition + pullRequest.Deletion,
Status: pullRequest.Status,
ReviewTime: pullRequest.ReviewDuration / 3600,
ReviewTime: pullRequest.ReviewDuration / 60,
Url: pullRequest.Url,
CreatedDate: createdDate.Format(commonDateFormat),
CreatedBy: pullRequest.CreatedBy,
Expand All @@ -99,7 +99,7 @@ func getPullRequestSize(c *gin.Context) {
Title: pullRequest.Title,
Size: pullRequest.Addition + pullRequest.Deletion,
Status: "opened",
ReviewTime: pullRequest.ReviewDuration / 3600,
ReviewTime: pullRequest.ReviewDuration / 60,
Url: pullRequest.Url,
CreatedDate: createdDate.Format(commonDateFormat),
CreatedBy: pullRequest.CreatedBy,
Expand Down
18 changes: 9 additions & 9 deletions src/controller/pullrequest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ func Test_PullRequestSize_OK(t *testing.T) {
expected := "{" +
"\"2020-05-05\":[]," +
"\"2020-05-06\":[]," +
"\"2020-05-07\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":89," +
"\"2020-05-07\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":5379," +
"\"url\":\"https://github.com/wizeline/gitwize-be/pull/1\",\"created_date\":\"2020-05-07\",\"created_by\":\"ltvcuong\"}]," +
"\"2020-05-08\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":89," +
"\"2020-05-08\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":5379," +
"\"url\":\"https://github.com/wizeline/gitwize-be/pull/1\",\"created_date\":\"2020-05-07\",\"created_by\":\"ltvcuong\"}]," +
"\"2020-05-09\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":89," +
"\"2020-05-09\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":5379," +
"\"url\":\"https://github.com/wizeline/gitwize-be/pull/1\",\"created_date\":\"2020-05-07\",\"created_by\":\"ltvcuong\"}]," +
"\"2020-05-10\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":89," +
"\"2020-05-10\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":5379," +
"\"url\":\"https://github.com/wizeline/gitwize-be/pull/1\",\"created_date\":\"2020-05-07\",\"created_by\":\"ltvcuong\"}]," +
"\"2020-05-11\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"merged\",\"review_time\":89," +
"\"2020-05-11\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"merged\",\"review_time\":5379," +
"\"url\":\"https://github.com/wizeline/gitwize-be/pull/1\",\"created_date\":\"2020-05-07\",\"created_by\":\"ltvcuong\"}]," +
"\"2020-05-12\":[]}"
assert.Equal(t, expected, w.Body.String())
Expand All @@ -45,13 +45,13 @@ func Test_PullRequestSize_OK(t *testing.T) {
expected = "{" +
"\"2020-05-05\":[]," +
"\"2020-05-06\":[]," +
"\"2020-05-07\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":89," +
"\"2020-05-07\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":5379," +
"\"url\":\"https://github.com/wizeline/gitwize-be/pull/1\",\"created_date\":\"2020-05-07\",\"created_by\":\"ltvcuong\"}]," +
"\"2020-05-08\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":89," +
"\"2020-05-08\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":5379," +
"\"url\":\"https://github.com/wizeline/gitwize-be/pull/1\",\"created_date\":\"2020-05-07\",\"created_by\":\"ltvcuong\"}]," +
"\"2020-05-09\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":89," +
"\"2020-05-09\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":5379," +
"\"url\":\"https://github.com/wizeline/gitwize-be/pull/1\",\"created_date\":\"2020-05-07\",\"created_by\":\"ltvcuong\"}]," +
"\"2020-05-10\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":89," +
"\"2020-05-10\":[{\"title\":\"GWZ-23 verifies access token\",\"size\":120,\"status\":\"opened\",\"review_time\":5379," +
"\"url\":\"https://github.com/wizeline/gitwize-be/pull/1\",\"created_date\":\"2020-05-07\",\"created_by\":\"ltvcuong\"}]}"
assert.Equal(t, expected, w.Body.String())
}

0 comments on commit 1823ccf

Please sign in to comment.