Skip to content
代码片段 群组 项目
提交 925b4d28 编辑于 作者: David Dieulivol's avatar David Dieulivol 提交者: Lin Jen-Shin
浏览文件

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
无相关合并请求
...@@ -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:
......
...@@ -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:
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册