Коммит 96bddca6 создал по автору Rémy Coutable's avatar Rémy Coutable
Просмотр файлов

Support fast-quarantine for E2E tests



Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
владелец f3e9ceb3
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
# - ./ee/app/models/license.rb # - ./ee/app/models/license.rb
# - ./lib/gitlab_edition.rb # - ./lib/gitlab_edition.rb
# - ./lib/gitlab/utils.rb # - ./lib/gitlab/utils.rb
# - ./spec/support/fast_quarantine.rb
# - ./tooling/lib/tooling/fast_quarantine.rb
# - ./qa/ # - ./qa/
# - ./INSTALLATION_TYPE # - ./INSTALLATION_TYPE
# - ./VERSION # - ./VERSION
...@@ -77,7 +79,52 @@ ...@@ -77,7 +79,52 @@
/rubocop/ /rubocop/
/scripts/ /scripts/
/shared/ /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/ /symbol/
/tmp/ /tmp/
/vendor/ /vendor/
...@@ -165,7 +165,7 @@ variables: ...@@ -165,7 +165,7 @@ variables:
RSPEC_PACKED_TESTS_MAPPING_PATH: crystalball/packed-mapping.json RSPEC_PACKED_TESTS_MAPPING_PATH: crystalball/packed-mapping.json
RSPEC_PROFILING_FOLDER_PATH: rspec/profiling RSPEC_PROFILING_FOLDER_PATH: rspec/profiling
RSPEC_TESTS_MAPPING_PATH: crystalball/mapping.json 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_FOLDER: "${CI_PROJECT_DIR}/tmp/tests"
TMP_TEST_GITLAB_WORKHORSE_PATH: "${TMP_TEST_FOLDER}/${GITLAB_WORKHORSE_FOLDER}" TMP_TEST_GITLAB_WORKHORSE_PATH: "${TMP_TEST_FOLDER}/${GITLAB_WORKHORSE_FOLDER}"
......
...@@ -49,6 +49,11 @@ download-knapsack-report: ...@@ -49,6 +49,11 @@ download-knapsack-report:
- .download-knapsack-report - .download-knapsack-report
- .rules:download-knapsack - .rules:download-knapsack
download-fast-quarantine-report:
extends:
- .download-fast-quarantine-report
- .rules:download-fast-quarantine-report
cache-gems: cache-gems:
extends: extends:
- .qa-install - .qa-install
......
...@@ -65,6 +65,17 @@ stages: ...@@ -65,6 +65,17 @@ stages:
# todo: remove in 16.1 milestone when not needed for backwards compatibility anymore # todo: remove in 16.1 milestone when not needed for backwards compatibility anymore
EE_LICENSE: $QA_EE_LICENSE EE_LICENSE: $QA_EE_LICENSE
GITHUB_ACCESS_TOKEN: $QA_GITHUB_ACCESS_TOKEN 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` # 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 # pipeline is not allowed to fail, so without allowing QA to fail, we will be
# blocking merges due to flaky tests. # blocking merges due to flaky tests.
...@@ -177,6 +188,25 @@ stages: ...@@ -177,6 +188,25 @@ stages:
- qa/knapsack/*.json - qa/knapsack/*.json
expire_in: 1 day 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: .e2e-test-report:
extends: extends:
- .generate-allure-report-base - .generate-allure-report-base
......
...@@ -76,6 +76,10 @@ ...@@ -76,6 +76,10 @@
rules: rules:
- when: always - when: always
.rules:download-fast-quarantine-report:
rules:
- when: always
# ------------------------------------------ # ------------------------------------------
# Test # Test
# ------------------------------------------ # ------------------------------------------
......
...@@ -17,3 +17,5 @@ variables: ...@@ -17,3 +17,5 @@ variables:
# run all tests by default when package-and-test is included natively in other projects # 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 # this will be overridden when selective test execution is used in gitlab canonical project
QA_RUN_ALL_TESTS: "true" QA_RUN_ALL_TESTS: "true"
QA_RSPEC_PATH: "${CI_PROJECT_DIR}/qa/rspec"
RSPEC_FAST_QUARANTINE_PATH: rspec/fast_quarantine-gitlab.txt
...@@ -90,6 +90,11 @@ cache-gems: ...@@ -90,6 +90,11 @@ cache-gems:
script: script:
- cd qa && bundle install - cd qa && bundle install
download-fast-quarantine-report:
extends:
- .download-fast-quarantine-report
- .rules:download-fast-quarantine-report
gdk-qa-smoke: gdk-qa-smoke:
extends: extends:
- .gdk-qa-base - .gdk-qa-base
......
...@@ -50,6 +50,8 @@ COPY ./config/feature_flags /home/gitlab/config/feature_flags ...@@ -50,6 +50,8 @@ COPY ./config/feature_flags /home/gitlab/config/feature_flags
COPY ./config/bundler_setup.rb /home/gitlab/config/ COPY ./config/bundler_setup.rb /home/gitlab/config/
COPY ./lib/gitlab_edition.rb /home/gitlab/lib/ COPY ./lib/gitlab_edition.rb /home/gitlab/lib/
COPY ./lib/gitlab/utils.rb /home/gitlab/lib/gitlab/ 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 ./INSTALLATION_TYPE ./VERSION /home/gitlab/
COPY ./qa /home/gitlab/qa COPY ./qa /home/gitlab/qa
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
source 'https://rubygems.org' 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 '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 'activesupport', '~> 6.1.7.2' # This should stay in sync with the root's Gemfile
gem 'allure-rspec', '~> 2.20.0' gem 'allure-rspec', '~> 2.20.0'
......
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 GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
...@@ -102,15 +117,6 @@ GEM ...@@ -102,15 +117,6 @@ GEM
gitlab (4.18.0) gitlab (4.18.0)
httparty (~> 0.18) httparty (~> 0.18)
terminal-table (>= 1.5.1) 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) gitlab_quality-test_tooling (0.4.3)
activesupport (~> 6.1) activesupport (~> 6.1)
gitlab (~> 4.18.0) gitlab (~> 4.18.0)
...@@ -327,7 +333,7 @@ DEPENDENCIES ...@@ -327,7 +333,7 @@ DEPENDENCIES
faraday-retry (~> 2.1) faraday-retry (~> 2.1)
fog-core (= 2.1.0) fog-core (= 2.1.0)
fog-google (~> 1.19) fog-google (~> 1.19)
gitlab-qa (~> 10, >= 10.4.1) gitlab-qa!
gitlab_quality-test_tooling (~> 0.4.3) gitlab_quality-test_tooling (~> 0.4.3)
influxdb-client (~> 2.9) influxdb-client (~> 2.9)
knapsack (~> 4.0) knapsack (~> 4.0)
......
# frozen_string_literal: true # frozen_string_literal: true
require_relative '../../qa'
require 'active_support/testing/time_helpers' 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! QA::Specs::QaDeprecationToolkitEnv.configure!
Knapsack::Adapters::RSpecAdapter.bind if QA::Runtime::Env.knapsack? Knapsack::Adapters::RSpecAdapter.bind if QA::Runtime::Env.knapsack?
......
...@@ -13,9 +13,9 @@ function retrieve_tests_metadata() { ...@@ -13,9 +13,9 @@ function retrieve_tests_metadata() {
echo "{}" > "${FLAKY_RSPEC_SUITE_REPORT_PATH}" echo "{}" > "${FLAKY_RSPEC_SUITE_REPORT_PATH}"
fi fi
if [[ ! -f "${RSPEC_FAST_QUARANTINE_LOCAL_PATH}" ]]; then if [[ ! -f "${RSPEC_FAST_QUARANTINE_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}" || 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_LOCAL_PATH}" echo "" > "${RSPEC_FAST_QUARANTINE_PATH}"
fi fi
} }
......
...@@ -7,10 +7,9 @@ ...@@ -7,10 +7,9 @@
require_relative '../../tooling/lib/tooling/fast_quarantine' require_relative '../../tooling/lib/tooling/fast_quarantine'
RSpec.configure do |config| 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( fast_quarantine_path = ENV.fetch(
'RSPEC_FAST_QUARANTINE_PATH', '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) fast_quarantine = Tooling::FastQuarantine.new(fast_quarantine_path: fast_quarantine_path)
skipped_examples = [] skipped_examples = []
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать