Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
容器镜像库
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
925b4d28
提交
925b4d28
编辑于
1 year ago
作者:
David Dieulivol
提交者:
Lin Jen-Shin
1 year ago
浏览文件
操作
下载
补丁
差异文件
Add the rspec_section function
This will make it easier to wrap the RSpec commands into sections.
上级
d399ef60
No related branches found
No related tags found
无相关合并请求
变更
3
隐藏空白变更内容
行内
左右并排
显示
3 个更改的文件
.gitlab/ci/rails.gitlab-ci.yml
+3
-3
3 个添加, 3 个删除
.gitlab/ci/rails.gitlab-ci.yml
.gitlab/ci/rails/shared.gitlab-ci.yml
+7
-4
7 个添加, 4 个删除
.gitlab/ci/rails/shared.gitlab-ci.yml
scripts/utils.sh
+8
-1
8 个添加, 1 个删除
scripts/utils.sh
有
18 个添加
和
8 个删除
.gitlab/ci/rails.gitlab-ci.yml
+
3
−
3
浏览文件 @
925b4d28
...
@@ -320,7 +320,7 @@ rspec fast_spec_helper:
...
@@ -320,7 +320,7 @@ rspec fast_spec_helper:
script
:
script
:
-
fast_spec_helper_specs=$(git grep -l -E '^require.*fast_spec_helper')
-
fast_spec_helper_specs=$(git grep -l -E '^require.*fast_spec_helper')
# Load fast_spec_helper as well just in case there are no specs available.
# Load fast_spec_helper as well just in case there are no specs available.
-
bin/rspec --dry-run spec/fast_spec_helper.rb $fast_spec_helper_specs
-
rspec_section
bin/rspec --dry-run spec/fast_spec_helper.rb $
{
fast_spec_helper_specs
}
rspec unit clickhouse
:
rspec unit clickhouse
:
extends
:
extends
:
...
@@ -1236,7 +1236,7 @@ rspec-ee system pg16 es8:
...
@@ -1236,7 +1236,7 @@ rspec-ee system pg16 es8:
stage
:
test
stage
:
test
script
:
script
:
-
!reference
[
.base-script
,
script
]
-
!reference
[
.base-script
,
script
]
-
rspec_fail_fast "${MATCHING_TESTS_PATH}" "--fail-fast=${RSPEC_FAIL_FAST_THRESHOLD} --tag ~quarantine --tag ~zoekt --tag ~click_house"
-
rspec_section
rspec_fail_fast "${MATCHING_TESTS_PATH}" "--fail-fast=${RSPEC_FAIL_FAST_THRESHOLD} --tag ~quarantine --tag ~zoekt --tag ~click_house"
rspec fail-fast
:
rspec fail-fast
:
extends
:
extends
:
...
@@ -1315,7 +1315,7 @@ fail-pipeline-early:
...
@@ -1315,7 +1315,7 @@ fail-pipeline-early:
-
job
:
"
detect-previous-failed-tests"
-
job
:
"
detect-previous-failed-tests"
script
:
script
:
-
!reference
[
.base-script
,
script
]
-
!reference
[
.base-script
,
script
]
-
rspec_rerun_previous_failed_tests
"
${PREVIOUS_FAILED_TESTS_FILE}
"
-
rspec_section
rspec_rerun_previous_failed_tests ${PREVIOUS_FAILED_TESTS_FILE}
rspec rspec-pg14-rerun-previous-failed-tests
:
rspec rspec-pg14-rerun-previous-failed-tests
:
extends
:
extends
:
...
...
此差异已折叠。
点击以展开。
.gitlab/ci/rails/shared.gitlab-ci.yml
+
7
−
4
浏览文件 @
925b4d28
...
@@ -27,7 +27,10 @@ include:
...
@@ -27,7 +27,10 @@ include:
-
section_start "gitaly-test-spawn" "Spawning Gitaly"; scripts/gitaly-test-spawn; section_end "gitaly-test-spawn"
# Do not use 'bundle exec' here
-
section_start "gitaly-test-spawn" "Spawning Gitaly"; scripts/gitaly-test-spawn; section_end "gitaly-test-spawn"
# Do not use 'bundle exec' here
-
export RSPEC_SKIPPED_TESTS_REPORT_PATH="rspec/skipped_tests-${CI_JOB_ID}.txt"
-
export RSPEC_SKIPPED_TESTS_REPORT_PATH="rspec/skipped_tests-${CI_JOB_ID}.txt"
-
export RSPEC_RETRIED_TESTS_REPORT_PATH="rspec/retried_tests-${CI_JOB_ID}.txt"
-
export RSPEC_RETRIED_TESTS_REPORT_PATH="rspec/retried_tests-${CI_JOB_ID}.txt"
-
tooling/bin/create_job_metrics_file ||
true
-
|
section_start "job-metrics" "Create Job Metrics file"
tooling/bin/create_job_metrics_file || true
section_end "job-metrics"
.no-redis-cluster
:
.no-redis-cluster
:
variables
:
variables
:
...
@@ -87,7 +90,7 @@ include:
...
@@ -87,7 +90,7 @@ include:
# spec/lib, yet background migration tests are also sitting there,
# spec/lib, yet background migration tests are also sitting there,
# and they should run on their own jobs so we don't need to run them
# and they should run on their own jobs so we don't need to run them
# in unit tests again.
# in unit tests again.
-
rspec_parallelized_job "--fail-fast=${RSPEC_FAIL_FAST_THRESHOLD} --tag ~quarantine --tag ~level:background_migration --tag ~click_house --tag ~real_ai_request"
-
rspec_section
rspec_parallelized_job "--fail-fast=${RSPEC_FAIL_FAST_THRESHOLD} --tag ~quarantine --tag ~level:background_migration --tag ~click_house --tag ~real_ai_request"
after_script
:
after_script
:
-
echo -e "\e[0Ksection_start:`date +%s`:report_results_section[collapsed=true]\r\e[0KReport results"
-
echo -e "\e[0Ksection_start:`date +%s`:report_results_section[collapsed=true]\r\e[0KReport results"
-
bundle exec gem list gitlab_quality-test_tooling
-
bundle exec gem list gitlab_quality-test_tooling
...
@@ -165,7 +168,7 @@ include:
...
@@ -165,7 +168,7 @@ include:
.rspec-base-migration
:
.rspec-base-migration
:
script
:
script
:
-
!reference
[
.base-script
,
script
]
-
!reference
[
.base-script
,
script
]
-
rspec_parallelized_job "--fail-fast=${RSPEC_FAIL_FAST_THRESHOLD} --tag ~quarantine --tag ~zoekt --tag ~click_house"
-
rspec_section
rspec_parallelized_job "--fail-fast=${RSPEC_FAIL_FAST_THRESHOLD} --tag ~quarantine --tag ~zoekt --tag ~click_house"
after_script
:
after_script
:
-
!reference
[
.rspec-base
,
after_script
]
-
!reference
[
.rspec-base
,
after_script
]
...
@@ -187,7 +190,7 @@ include:
...
@@ -187,7 +190,7 @@ include:
-
cp config/click_house.yml.example config/click_house.yml
-
cp config/click_house.yml.example config/click_house.yml
-
'
sed
-i
"s|url:.*$|url:
http://clickhouse:8123|g"
config/click_house.yml'
-
'
sed
-i
"s|url:.*$|url:
http://clickhouse:8123|g"
config/click_house.yml'
-
!reference
[
.base-script
,
script
]
-
!reference
[
.base-script
,
script
]
-
rspec_parallelized_job "--fail-fast=${RSPEC_FAIL_FAST_THRESHOLD} --tag click_house"
-
rspec_section
rspec_parallelized_job "--fail-fast=${RSPEC_FAIL_FAST_THRESHOLD} --tag click_house"
.rspec-base-pg14-as-if-foss
:
.rspec-base-pg14-as-if-foss
:
extends
:
extends
:
...
...
此差异已折叠。
点击以展开。
scripts/utils.sh
+
8
−
1
浏览文件 @
925b4d28
...
@@ -67,8 +67,9 @@ function test_url() {
...
@@ -67,8 +67,9 @@ function test_url() {
function
section_start
()
{
function
section_start
()
{
local
section_title
=
"
${
1
}
"
local
section_title
=
"
${
1
}
"
local
section_description
=
"
${
2
:-
$section_title
}
"
local
section_description
=
"
${
2
:-
$section_title
}
"
local
collapsed
=
"
${
3
:-
true
}
"
echo
-e
"section_start:
`
date
+%s
`
:
${
section_title
}
[collapsed=
true
]
\r\e
[0K
${
section_description
}
"
echo
-e
"section_start:
`
date
+%s
`
:
${
section_title
}
[collapsed=
${
collapsed
}
]
\r\e
[0K
${
section_description
}
"
}
}
function
section_end
()
{
function
section_end
()
{
...
@@ -77,6 +78,12 @@ function section_end () {
...
@@ -77,6 +78,12 @@ function section_end () {
echo
-e
"section_end:
`
date
+%s
`
:
${
section_title
}
\r\e
[0K"
echo
-e
"section_end:
`
date
+%s
`
:
${
section_title
}
\r\e
[0K"
}
}
function
rspec_section
()
{
section_start
"rspec"
"RSpec"
"false"
"
$@
"
section_end
"rspec"
}
function
bundle_install_script
()
{
function
bundle_install_script
()
{
local
extra_install_args
=
"
${
1
}
"
local
extra_install_args
=
"
${
1
}
"
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录