Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
bac547dc
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bac547dc
编写于
1月 11, 2020
作者:
G
GitLab Bot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add latest changes from gitlab-org/gitlab@master
上级
7873bb3c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
66 addition
and
21 deletion
+66
-21
doc/user/project/merge_requests/code_quality.md
doc/user/project/merge_requests/code_quality.md
+40
-0
qa/qa/page/layout/performance_bar.rb
qa/qa/page/layout/performance_bar.rb
+1
-1
qa/qa/specs/features/browser_ui/non_devops/performance_bar_spec.rb
...cs/features/browser_ui/non_devops/performance_bar_spec.rb
+25
-20
未找到文件。
doc/user/project/merge_requests/code_quality.md
浏览文件 @
bac547dc
...
...
@@ -66,6 +66,19 @@ will scan your source code for code quality issues. The report will be saved as
that you can later download and analyze. Due to implementation limitations we always
take the latest Code Quality artifact available.
It is also possible to override the URL to the Code Quality image by
setting the
`CODE_QUALITY_IMAGE`
variable. This is particularly useful if you want
to lock in a specific version of Code Quality, or use a fork of it:
```
yaml
include
:
-
template
:
Code-Quality.gitlab-ci.yml
code_quality
:
variables
:
CODE_QUALITY_IMAGE
:
"
registry.example.com/codequality-fork:latest"
```
By default, report artifacts are not downloadable. If you need them downloadable on the
job details page, you can add
`gl-code-quality-report.json`
to the artifact paths like so:
...
...
@@ -125,6 +138,33 @@ code_quality:
codequality
:
gl-code-quality-report.json
```
In GitLab 12.6, Code Quality switched to the
[
new versioning scheme
](
https://gitlab.com/gitlab-org/security-products/codequality/merge_requests/38
)
.
It is highly recommended to include the Code Quality template as shown in the
[
example configuration
](
#example-configuration
)
, which uses the new versioning scheme.
If not using the template, the
`SP_VERSION`
variable can be hardcoded to use the
new image versions:
```
yaml
code_quality
:
image
:
docker:stable
variables
:
DOCKER_DRIVER
:
overlay2
SP_VERSION
:
0.85.6
allow_failure
:
true
services
:
-
docker:stable-dind
script
:
-
docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts
:
reports
:
codequality
:
gl-code-quality-report.json
```
For GitLab 11.4 and earlier, the job should look like:
```
yaml
...
...
qa/qa/page/layout/performance_bar.rb
浏览文件 @
bac547dc
...
...
@@ -21,7 +21,7 @@ module QA
has_element?
(
:performance_bar
)
end
def
has_detailed_metrics?
def
has_detailed_metrics?
(
count
)
retry_until
(
sleep_interval:
1
)
do
all_elements
(
:detailed_metric_content
,
count:
count
).
all?
do
|
metric
|
metric
.
has_text?
(
%r{
\d
+}
)
...
...
qa/qa/specs/features/browser_ui/non_devops/performance_bar_spec.rb
浏览文件 @
bac547dc
# frozen_string_literal: true
module
QA
context
'Performance bar'
do
context
'when logged in as an admin user'
,
:requires_admin
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/issues/196141'
do
before
do
Flow
::
Login
.
sign_in_as_admin
Page
::
Main
::
Menu
.
perform
(
&
:go_to_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_metrics_and_profiling_settings
)
context
'Non-devops'
do
describe
'Performance bar display'
,
:requires_admin
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/issues/196141'
do
context
'when logged in as an admin user'
do
# 4 metrics: pg, gitaly, redis, total
let
(
:metrics_count
)
{
4
}
Page
::
Admin
::
Settings
::
MetricsAndProfiling
.
perform
do
|
setting
|
setting
.
expand_performance_bar
do
|
page
|
page
.
enable_performance_bar
page
.
save_settings
before
do
Flow
::
Login
.
sign_in_as_admin
Page
::
Main
::
Menu
.
perform
(
&
:go_to_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_metrics_and_profiling_settings
)
Page
::
Admin
::
Settings
::
MetricsAndProfiling
.
perform
do
|
setting
|
setting
.
expand_performance_bar
do
|
page
|
page
.
enable_performance_bar
page
.
save_settings
end
end
end
end
it
'shows results for the original request and AJAX requests'
do
# Issue pages always make AJAX requests
Resource
::
Issue
.
fabricate_via_browser_ui!
do
|
issue
|
issue
.
title
=
'Performance bar test'
end
it
'shows results for the original request and AJAX requests'
do
# Issue pages always make AJAX requests
Resource
::
Issue
.
fabricate_via_browser_ui!
do
|
issue
|
issue
.
title
=
'Performance bar test'
end
Page
::
Layout
::
PerformanceBar
.
perform
do
|
bar_component
|
expect
(
bar_component
).
to
have_performance_bar
expect
(
bar_component
).
to
have_detailed_metrics
(
4
)
expect
(
bar_component
).
to
have_request_for
(
'realtime_changes'
)
# Always requested on issue pages
Page
::
Layout
::
PerformanceBar
.
perform
do
|
bar_component
|
expect
(
bar_component
).
to
have_performance_bar
expect
(
bar_component
).
to
have_detailed_metrics
(
metrics_count
)
expect
(
bar_component
).
to
have_request_for
(
'realtime_changes'
)
# Always requested on issue pages
end
end
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录