Merge branch '22057-fix-api-ossues-sorting-flaky-specs' into 'master'

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

## What does this MR do?

Ensure a deterministic order of issues on the existing API issues specs

## Are there points in the code the reviewer needs to double check?

## Why was this MR needed?

To avoid random failures as described on #22057

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- ~~[ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- ~~[ ] API support added~~
- Tests
  - ~~[ ] Added for this feature/bug~~
  - [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Closes #22057

See merge request !6306
This commit is contained in:
Stan Hu 2016-09-13 01:51:51 +00:00
commit 6b88cc6469
3 changed files with 8 additions and 0 deletions

View file

@ -19,6 +19,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
- Fix file permissions change when updating a file on the Gitlab UI !5979 - Fix file permissions change when updating a file on the Gitlab UI !5979

View file

@ -1,4 +1,8 @@
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

View file

@ -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
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
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