Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3db92d7c
Commit
3db92d7c
authored
Jan 22, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
a4d0f3bd
03def93b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
7 deletions
+67
-7
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+11
-0
app/views/layouts/_init_client_detection_flags.html.haml
app/views/layouts/_init_client_detection_flags.html.haml
+7
-0
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+2
-1
changelogs/unreleased/50013-add-browser-platform-flags.yml
changelogs/unreleased/50013-add-browser-platform-flags.yml
+5
-0
doc/development/testing_guide/flaky_tests.md
doc/development/testing_guide/flaky_tests.md
+27
-6
spec/helpers/application_helper_spec.rb
spec/helpers/application_helper_spec.rb
+15
-0
No files found.
app/helpers/application_helper.rb
View file @
3db92d7c
...
@@ -268,6 +268,17 @@ module ApplicationHelper
...
@@ -268,6 +268,17 @@ module ApplicationHelper
_
(
'You are on a read-only GitLab instance.'
)
_
(
'You are on a read-only GitLab instance.'
)
end
end
def
client_class_list
"gl-browser-
#{
browser
.
id
}
gl-platform-
#{
browser
.
platform
.
id
}
"
end
def
client_js_flags
{
"is
#{
browser
.
id
.
to_s
.
titlecase
}
"
:
true
,
"is
#{
browser
.
platform
.
id
.
to_s
.
titlecase
}
"
:
true
}
end
def
autocomplete_data_sources
(
object
,
noteable_type
)
def
autocomplete_data_sources
(
object
,
noteable_type
)
return
{}
unless
object
&&
noteable_type
return
{}
unless
object
&&
noteable_type
...
...
app/views/layouts/_init_client_detection_flags.html.haml
0 → 100644
View file @
3db92d7c
-
client
=
client_js_flags
-
if
client
-# haml-lint:disable InlineJavaScript
:javascript
gl
=
window
.
gl
||
{};
gl
.
client
=
#{
client
.
to_json
}
;
app/views/layouts/application.html.haml
View file @
3db92d7c
!!! 5
!!! 5
%html
{
lang:
I18n
.
locale
,
class:
page_class
}
%html
{
lang:
I18n
.
locale
,
class:
page_class
}
=
render
"layouts/head"
=
render
"layouts/head"
%body
{
class:
"#{user_application_theme} #{@body_class}"
,
data:
{
page:
body_data_page
,
project:
"#{@project.path if @project}"
,
group:
"#{@group.path if @group}"
,
find_file:
find_file_path
}
}
%body
{
class:
"#{user_application_theme} #{@body_class}
#{client_class_list}
"
,
data:
{
page:
body_data_page
,
project:
"#{@project.path if @project}"
,
group:
"#{@group.path if @group}"
,
find_file:
find_file_path
}
}
=
render
"layouts/init_auto_complete"
if
@gfm_form
=
render
"layouts/init_auto_complete"
if
@gfm_form
=
render
"layouts/init_client_detection_flags"
=
render
'peek/bar'
=
render
'peek/bar'
=
header_message
=
header_message
=
render
partial:
"layouts/header/default"
,
locals:
{
project:
@project
,
group:
@group
}
=
render
partial:
"layouts/header/default"
,
locals:
{
project:
@project
,
group:
@group
}
...
...
changelogs/unreleased/50013-add-browser-platform-flags.yml
0 → 100644
View file @
3db92d7c
---
title
:
Add CSS & JS global flags to represent browser and platform
merge_request
:
24017
author
:
type
:
other
doc/development/testing_guide/flaky_tests.md
View file @
3db92d7c
...
@@ -7,16 +7,37 @@ eventually.
...
@@ -7,16 +7,37 @@ eventually.
## Quarantined tests
## Quarantined tests
Tests can be put in quarantine by assigning
`:quarantine`
metadata. This means
When a test frequently fails in
`master`
,
they will be skipped unless run with
`--tag quarantine`
. This can be used for
[
a ~"broken master" issue
](
https://about.gitlab.com/handbook/engineering/workflow/#broken-master
)
tests that are expected to fail while a fix is in progress (similar to how
should be created.
[
`skip` or `pending`
](
https://relishapp.com/rspec/rspec-core/v/3-8/docs/pending-and-skipped-examples
)
If the test cannot be fixed in a timely fashion, there is an impact on the
can be used).
productivity of all the developers, so it should be placed in quarantine by
assigning the
`:quarantine`
metadata.
```
This means it will be skipped unless run with
`--tag quarantine`
:
```
shell
bin/rspec
--tag
quarantine
bin/rspec
--tag
quarantine
```
```
**
Before putting a test in quarantine, you should make sure that a
~"broken master" issue exists for it so it won't stay in quarantine forever.
**
Once a test is in quarantine, there are 3 choices:
-
Should the test be fixed (i.e. get rid of its flakiness)?
-
Should the test be moved to a lower level of testing?
-
Should the test be removed entirely (e.g. because there's already a
lower-level test, or it's duplicating another same-level test, or it's testing
too much etc.)?
### Quarantine tests on the CI
Quarantined tests are run on the CI in dedicated jobs that are allowed to fail:
-
`rspec-pg-quarantine`
and
`rspec-mysql-quarantine`
(CE & EE)
-
`rspec-pg-quarantine-ee`
and
`rspec-mysql-quarantine-ee`
(EE only)
## Automatic retries and flaky tests detection
## Automatic retries and flaky tests detection
On our CI, we use [rspec-retry] to automatically retry a failing example a few
On our CI, we use [rspec-retry] to automatically retry a failing example a few
...
...
spec/helpers/application_helper_spec.rb
View file @
3db92d7c
...
@@ -168,6 +168,21 @@ describe ApplicationHelper do
...
@@ -168,6 +168,21 @@ describe ApplicationHelper do
end
end
end
end
describe
'#client_class_list'
do
it
'returns string containing CSS classes representing client browser and platform'
do
class_list
=
helper
.
client_class_list
expect
(
class_list
).
to
eq
(
'gl-browser-generic gl-platform-other'
)
end
end
describe
'#client_js_flags'
do
it
'returns map containing JS flags representing client browser and platform'
do
flags_list
=
helper
.
client_js_flags
expect
(
flags_list
[
:isGeneric
]).
to
eq
(
true
)
expect
(
flags_list
[
:isOther
]).
to
eq
(
true
)
end
end
describe
'#autocomplete_data_sources'
do
describe
'#autocomplete_data_sources'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:noteable_type
)
{
Issue
}
let
(
:noteable_type
)
{
Issue
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment