Открыть боковую панель
Захаров Дмитрий Сергеевич
Gitlab
Коммиты
96bddca6
Коммит
96bddca6
создал
Май 03, 2023
по автору
Rémy Coutable
Просмотр файлов
Support fast-quarantine for E2E tests
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
владелец
f3e9ceb3
Изменения
13
Скрыть пробелы
Построчно
Рядом
.dockerignore
Просмотр файла @
96bddca6
...
...
@@ -7,6 +7,8 @@
# - ./ee/app/models/license.rb
# - ./lib/gitlab_edition.rb
# - ./lib/gitlab/utils.rb
# - ./spec/support/fast_quarantine.rb
# - ./tooling/lib/tooling/fast_quarantine.rb
# - ./qa/
# - ./INSTALLATION_TYPE
# - ./VERSION
...
...
@@ -77,7 +79,52 @@
/rubocop/
/scripts/
/shared/
/spec/
/spec/benchmarks/
/spec/bin/
/spec/channels/
/spec/commands/
/spec/components/
/spec/config/
/spec/contracts/
/spec/controllers/
/spec/db/
/spec/dependencies/
/spec/docs_screenshots/
/spec/experiments/
/spec/factories/
/spec/features/
/spec/finders/
/spec/fixtures/
/spec/frontend/
/spec/frontend_integration/
/spec/graphql/
/spec/haml_lint/
/spec/helpers/
/spec/initializers/
/spec/lib/
/spec/mailers/
/spec/metrics_server/
/spec/migrations/
/spec/models/
/spec/policies/
/spec/presenters/
/spec/rack_servers/
/spec/requests/
/spec/routing/
/spec/rubocop/
/spec/scripts/
/spec/serializers/
/spec/services/
/spec/sidekiq/
/spec/sidekiq_cluster/
/spec/spam/
/spec/support_specs/
/spec/tasks/
/spec/tooling/
/spec/uploaders/
/spec/validators/
/spec/views/
/spec/workers/
/symbol/
/tmp/
/vendor/
.gitlab-ci.yml
Просмотр файла @
96bddca6
...
...
@@ -165,7 +165,7 @@ variables:
RSPEC_PACKED_TESTS_MAPPING_PATH
:
crystalball/packed-mapping.json
RSPEC_PROFILING_FOLDER_PATH
:
rspec/profiling
RSPEC_TESTS_MAPPING_PATH
:
crystalball/mapping.json
RSPEC_FAST_QUARANTINE_
LOCAL_
PATH
:
rspec/fast_quarantine-gitlab.txt
RSPEC_FAST_QUARANTINE_PATH
:
rspec/fast_quarantine-gitlab.txt
TMP_TEST_FOLDER
:
"
${CI_PROJECT_DIR}/tmp/tests"
TMP_TEST_GITLAB_WORKHORSE_PATH
:
"
${TMP_TEST_FOLDER}/${GITLAB_WORKHORSE_FOLDER}"
...
...
.gitlab/ci/package-and-test/main.gitlab-ci.yml
Просмотр файла @
96bddca6
...
...
@@ -49,6 +49,11 @@ download-knapsack-report:
-
.download-knapsack-report
-
.rules:download-knapsack
download-fast-quarantine-report
:
extends
:
-
.download-fast-quarantine-report
-
.rules:download-fast-quarantine-report
cache-gems
:
extends
:
-
.qa-install
...
...
.gitlab/ci/qa-common/main.gitlab-ci.yml
Просмотр файла @
96bddca6
...
...
@@ -65,6 +65,17 @@ stages:
# todo: remove in 16.1 milestone when not needed for backwards compatibility anymore
EE_LICENSE
:
$QA_EE_LICENSE
GITHUB_ACCESS_TOKEN
:
$QA_GITHUB_ACCESS_TOKEN
SKIPPED_TESTS_REPORT_PATH
:
"
rspec/skipped_tests_${CI_JOB_NAME}.txt"
before_script
:
-
!reference
[
.qa-base
,
before_script
]
-
mkdir -p $(dirname "${RSPEC_FAST_QUARANTINE_PATH}") && cp "../${RSPEC_FAST_QUARANTINE_PATH}" "${RSPEC_FAST_QUARANTINE_PATH}"
# Prepend the fast-quarantine file with the absolute path from inside the container since the file is read there
-
export RSPEC_FAST_QUARANTINE_PATH="/home/gitlab/qa/${RSPEC_FAST_QUARANTINE_PATH}"
artifacts
:
# override artifacts:paths from `.qa-base`
paths
:
-
gitlab-qa-run-*
-
rspec/
# Allow QA jobs to fail as they are flaky. The top level `package-and-e2e:ee`
# pipeline is not allowed to fail, so without allowing QA to fail, we will be
# blocking merges due to flaky tests.
...
...
@@ -177,6 +188,25 @@ stages:
-
qa/knapsack/*.json
expire_in
:
1 day
.download-fast-quarantine-report
:
extends
:
-
.ruby-image
stage
:
.pre
variables
:
GIT_STRATEGY
:
none
script
:
-
mkdir -p $(dirname "${RSPEC_FAST_QUARANTINE_PATH}")
-
|
if [[ ! -f "${RSPEC_FAST_QUARANTINE_PATH}" ]]; then
curl --location -o "${RSPEC_FAST_QUARANTINE_PATH}" "https://gitlab-org.gitlab.io/quality/engineering-productivity/fast-quarantine/${RSPEC_FAST_QUARANTINE_PATH}" ||
echo "" > "${RSPEC_FAST_QUARANTINE_PATH}"
fi
allow_failure
:
true
artifacts
:
paths
:
-
"
${RSPEC_FAST_QUARANTINE_PATH}"
expire_in
:
1 day
.e2e-test-report
:
extends
:
-
.generate-allure-report-base
...
...
.gitlab/ci/qa-common/rules.gitlab-ci.yml
Просмотр файла @
96bddca6
...
...
@@ -76,6 +76,10 @@
rules
:
-
when
:
always
.rules:download-fast-quarantine-report:
rules
:
-
when
:
always
# ------------------------------------------
# Test
# ------------------------------------------
...
...
.gitlab/ci/qa-common/variables.gitlab-ci.yml
Просмотр файла @
96bddca6
...
...
@@ -17,3 +17,5 @@ variables:
# run all tests by default when package-and-test is included natively in other projects
# this will be overridden when selective test execution is used in gitlab canonical project
QA_RUN_ALL_TESTS
:
"
true"
QA_RSPEC_PATH
:
"
${CI_PROJECT_DIR}/qa/rspec"
RSPEC_FAST_QUARANTINE_PATH
:
rspec/fast_quarantine-gitlab.txt
.gitlab/ci/test-on-gdk/main.gitlab-ci.yml
Просмотр файла @
96bddca6
...
...
@@ -90,6 +90,11 @@ cache-gems:
script
:
-
cd qa && bundle install
download-fast-quarantine-report
:
extends
:
-
.download-fast-quarantine-report
-
.rules:download-fast-quarantine-report
gdk-qa-smoke
:
extends
:
-
.gdk-qa-base
...
...
qa/Dockerfile
Просмотр файла @
96bddca6
...
...
@@ -50,6 +50,8 @@ COPY ./config/feature_flags /home/gitlab/config/feature_flags
COPY
./config/bundler_setup.rb /home/gitlab/config/
COPY
./lib/gitlab_edition.rb /home/gitlab/lib/
COPY
./lib/gitlab/utils.rb /home/gitlab/lib/gitlab/
COPY
./spec/support/fast_quarantine.rb /home/gitlab/spec/support/
COPY
./tooling/lib/tooling/fast_quarantine.rb /home/gitlab/tooling/lib/tooling/
COPY
./INSTALLATION_TYPE ./VERSION /home/gitlab/
COPY
./qa /home/gitlab/qa
...
...
qa/Gemfile
Просмотр файла @
96bddca6
...
...
@@ -2,7 +2,7 @@
source
'https://rubygems.org'
gem
'gitlab-qa'
,
'~> 10'
,
'>= 10.4.1
'
,
require:
'gitlab/qa'
gem
'gitlab-qa'
,
git:
'https://gitlab.com/gitlab-org/gitlab-qa.git'
,
branch:
'support-fast-quarantine
'
,
require:
'gitlab/qa'
gem
'gitlab_quality-test_tooling'
,
'~> 0.4.3'
,
require:
false
gem
'activesupport'
,
'~> 6.1.7.2'
# This should stay in sync with the root's Gemfile
gem
'allure-rspec'
,
'~> 2.20.0'
...
...
qa/Gemfile.lock
Просмотр файла @
96bddca6
GIT
remote: https://gitlab.com/gitlab-org/gitlab-qa.git
revision: 8d4505a8b03a75762817316b0942a1b65b25a0e1
branch: support-fast-quarantine
specs:
gitlab-qa (10.5.0)
activesupport (~> 6.1)
gitlab (~> 4.18.0)
http (~> 5.0)
nokogiri (~> 1.10)
parallel (>= 1, < 2)
rainbow (>= 3, < 4)
table_print (= 1.5.7)
zeitwerk (>= 2, < 3)
GEM
remote: https://rubygems.org/
specs:
...
...
@@ -102,15 +117,6 @@ GEM
gitlab (4.18.0)
httparty (~> 0.18)
terminal-table (>= 1.5.1)
gitlab-qa (10.4.1)
activesupport (~> 6.1)
gitlab (~> 4.18.0)
http (~> 5.0)
nokogiri (~> 1.10)
parallel (>= 1, < 2)
rainbow (>= 3, < 4)
table_print (= 1.5.7)
zeitwerk (>= 2, < 3)
gitlab_quality-test_tooling (0.4.3)
activesupport (~> 6.1)
gitlab (~> 4.18.0)
...
...
@@ -327,7 +333,7 @@ DEPENDENCIES
faraday-retry (~> 2.1)
fog-core (= 2.1.0)
fog-google (~> 1.19)
gitlab-qa
(~> 10, >= 10.4.1)
gitlab-qa
!
gitlab_quality-test_tooling (~> 0.4.3)
influxdb-client (~> 2.9)
knapsack (~> 4.0)
...
...
qa/qa/specs/spec_helper.rb
Просмотр файла @
96bddca6
# frozen_string_literal: true
require_relative
'../../qa'
require
'active_support/testing/time_helpers'
require_relative
'../../qa'
# Require shared test tooling from Rails test suite
require_relative
'../../../spec/support/fast_quarantine'
QA
::
Specs
::
QaDeprecationToolkitEnv
.
configure!
Knapsack
::
Adapters
::
RSpecAdapter
.
bind
if
QA
::
Runtime
::
Env
.
knapsack?
...
...
scripts/rspec_helpers.sh
Просмотр файла @
96bddca6
...
...
@@ -13,9 +13,9 @@ function retrieve_tests_metadata() {
echo
"{}"
>
"
${
FLAKY_RSPEC_SUITE_REPORT_PATH
}
"
fi
if
[[
!
-f
"
${
RSPEC_FAST_QUARANTINE_
LOCAL_
PATH
}
"
]]
;
then
curl
--location
-o
"
${
RSPEC_FAST_QUARANTINE_
LOCAL_
PATH
}
"
"https://gitlab-org.gitlab.io/quality/engineering-productivity/fast-quarantine/
${
RSPEC_FAST_QUARANTINE_
LOCAL_
PATH
}
"
||
echo
""
>
"
${
RSPEC_FAST_QUARANTINE_
LOCAL_
PATH
}
"
if
[[
!
-f
"
${
RSPEC_FAST_QUARANTINE_PATH
}
"
]]
;
then
curl
--location
-o
"
${
RSPEC_FAST_QUARANTINE_PATH
}
"
"https://gitlab-org.gitlab.io/quality/engineering-productivity/fast-quarantine/
${
RSPEC_FAST_QUARANTINE_PATH
}
"
||
echo
""
>
"
${
RSPEC_FAST_QUARANTINE_PATH
}
"
fi
}
...
...
spec/support/fast_quarantine.rb
Просмотр файла @
96bddca6
...
...
@@ -7,10 +7,9 @@
require_relative
'../../tooling/lib/tooling/fast_quarantine'
RSpec
.
configure
do
|
config
|
fast_quarantine_local_path
=
ENV
.
fetch
(
'RSPEC_FAST_QUARANTINE_LOCAL_PATH'
,
'rspec/fast_quarantine-gitlab.txt'
)
fast_quarantine_path
=
ENV
.
fetch
(
'RSPEC_FAST_QUARANTINE_PATH'
,
File
.
expand_path
(
"../../
#{
fast_quarantine
_local_path
}
"
,
__dir__
)
File
.
expand_path
(
"../../
rspec/
fast_quarantine
-gitlab.txt
"
,
__dir__
)
)
fast_quarantine
=
Tooling
::
FastQuarantine
.
new
(
fast_quarantine_path:
fast_quarantine_path
)
skipped_examples
=
[]
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать