BigW Consortium Gitlab

Commit b7814205 by Paco Guzman

Ensure specs on sorting of issues in API are deterministic on MySQL

MySQL could not have support for millisecond precision, depends on the MySQL version so we just create issues in different seconds in a deterministic way
parent 45afdbef
...@@ -18,6 +18,7 @@ v 8.12.0 (unreleased) ...@@ -18,6 +18,7 @@ v 8.12.0 (unreleased)
- Use Search::GlobalService.new in the `GET /projects/search/:query` endpoint - Use Search::GlobalService.new in the `GET /projects/search/:query` endpoint
- Fix pagination on user snippets page - Fix pagination on user snippets page
- Fix sorting of issues in API - Fix sorting of issues in API
- Ensure specs on sorting of issues in API are deterministic on MySQL
- Escape search term before passing it to Regexp.new !6241 (winniehell) - Escape search term before passing it to Regexp.new !6241 (winniehell)
- Fix pinned sidebar behavior in smaller viewports !6169 - Fix pinned sidebar behavior in smaller viewports !6169
- Change merge_error column from string to text type - Change merge_error column from string to text type
......
FactoryGirl.define do FactoryGirl.define do
sequence :issue_created_at do |n|
4.hours.ago + ( 2 * n ).seconds
end
factory :issue do factory :issue do
title title
author author
......
...@@ -18,6 +18,7 @@ describe API::API, api: true do ...@@ -18,6 +18,7 @@ describe API::API, api: true do
project: project, project: project,
state: :closed, state: :closed,
milestone: milestone, milestone: milestone,
created_at: generate(:issue_created_at),
updated_at: 3.hours.ago updated_at: 3.hours.ago
end end
let!(:confidential_issue) do let!(:confidential_issue) do
...@@ -26,6 +27,7 @@ describe API::API, api: true do ...@@ -26,6 +27,7 @@ describe API::API, api: true do
project: project, project: project,
author: author, author: author,
assignee: assignee, assignee: assignee,
created_at: generate(:issue_created_at),
updated_at: 2.hours.ago updated_at: 2.hours.ago
end end
let!(:issue) do let!(:issue) do
...@@ -34,6 +36,7 @@ describe API::API, api: true do ...@@ -34,6 +36,7 @@ describe API::API, api: true do
assignee: user, assignee: user,
project: project, project: project,
milestone: milestone, milestone: milestone,
created_at: generate(:issue_created_at),
updated_at: 1.hour.ago updated_at: 1.hour.ago
end end
let!(:label) do let!(:label) do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment