Commit 0e64a819 authored by Albert Salim's avatar Albert Salim

Merge branch 'experiment-reference-keyword' into 'master'

ci: Experiment with the new !reference CI keyword

See merge request gitlab-org/gitlab!55617
parents f6b074d1 f4900ad8
...@@ -6,12 +6,17 @@ ...@@ -6,12 +6,17 @@
- .default-before_script - .default-before_script
- .rails-cache - .rails-cache
.base-script: &base-script .minimal-bundle-install:
# Only install knapsack after bundle install! Otherwise oddly some native script:
# gems could not be found under some circumstance. No idea why, hours wasted. - run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519"
- run_timed_command "gem install knapsack --no-document"
- run_timed_command "scripts/gitaly-test-spawn" .base-script:
- source ./scripts/rspec_helpers.sh script:
# Only install knapsack after bundle install! Otherwise oddly some native
# gems could not be found under some circumstance. No idea why, hours wasted.
- run_timed_command "gem install knapsack --no-document"
- run_timed_command "scripts/gitaly-test-spawn"
- source ./scripts/rspec_helpers.sh
.minimal-rspec-tests: .minimal-rspec-tests:
variables: variables:
...@@ -27,7 +32,7 @@ ...@@ -27,7 +32,7 @@
RECORD_DEPRECATIONS: "true" RECORD_DEPRECATIONS: "true"
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"] needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"]
script: script:
- *base-script - !reference [.base-script, script]
- rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag ~level:migration" - rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag ~level:migration"
artifacts: artifacts:
expire_in: 31d expire_in: 31d
...@@ -49,7 +54,7 @@ ...@@ -49,7 +54,7 @@
.rspec-base-migration: .rspec-base-migration:
extends: .rails:rules:ee-and-foss-migration extends: .rails:rules:ee-and-foss-migration
script: script:
- *base-script - !reference [.base-script, script]
- rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag level:migration" - rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag level:migration"
.rspec-base-pg11: .rspec-base-pg11:
...@@ -82,7 +87,7 @@ ...@@ -82,7 +87,7 @@
.rspec-ee-base-geo: .rspec-ee-base-geo:
extends: .rspec-base extends: .rspec-base
script: script:
- *base-script - !reference [.base-script, script]
- rspec_paralellized_job "--tag ~quarantine --tag geo" - rspec_paralellized_job "--tag ~quarantine --tag geo"
.rspec-ee-base-geo-pg11: .rspec-ee-base-geo-pg11:
...@@ -213,7 +218,7 @@ update-coverage-cache: ...@@ -213,7 +218,7 @@ update-coverage-cache:
- .shared:rules:update-cache - .shared:rules:update-cache
stage: prepare stage: prepare
script: script:
- run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519" - !reference [.minimal-bundle-install, script]
cache: cache:
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up. policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
...@@ -317,7 +322,7 @@ rspec db-library-code pg12: ...@@ -317,7 +322,7 @@ rspec db-library-code pg12:
- .rspec-base-pg12 - .rspec-base-pg12
- .rails:rules:ee-and-foss-db-library-code - .rails:rules:ee-and-foss-db-library-code
script: script:
- *base-script - !reference [.base-script, script]
- rspec_db_library_code - rspec_db_library_code
rspec fast_spec_helper: rspec fast_spec_helper:
...@@ -406,7 +411,7 @@ gitlab:setup: ...@@ -406,7 +411,7 @@ gitlab:setup:
# db/fixtures/development/04_project.rb thanks to SIZE=1 below # db/fixtures/development/04_project.rb thanks to SIZE=1 below
- git clone https://gitlab.com/gitlab-org/gitlab-test.git - git clone https://gitlab.com/gitlab-org/gitlab-test.git
/home/git/repositories/gitlab-org/gitlab-test.git /home/git/repositories/gitlab-org/gitlab-test.git
- *base-script - !reference [.base-script, script]
- force=yes SIZE=1 FIXTURE_PATH="db/fixtures/development" bundle exec rake gitlab:setup - force=yes SIZE=1 FIXTURE_PATH="db/fixtures/development" bundle exec rake gitlab:setup
artifacts: artifacts:
when: on_failure when: on_failure
...@@ -486,7 +491,7 @@ rspec:coverage: ...@@ -486,7 +491,7 @@ rspec:coverage:
- memory-static - memory-static
- memory-on-boot - memory-on-boot
script: script:
- run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519" - !reference [.minimal-bundle-install, script]
- run_timed_command "bundle exec scripts/merge-simplecov" - run_timed_command "bundle exec scripts/merge-simplecov"
- run_timed_command "bundle exec scripts/gather-test-memory-data" - run_timed_command "bundle exec scripts/gather-test-memory-data"
coverage: '/LOC \((\d+\.\d+%)\) covered.$/' coverage: '/LOC \((\d+\.\d+%)\) covered.$/'
...@@ -523,7 +528,7 @@ rspec:feature-flags: ...@@ -523,7 +528,7 @@ rspec:feature-flags:
- memory-static - memory-static
- memory-on-boot - memory-on-boot
script: script:
- run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519" - !reference [.minimal-bundle-install, script]
- if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then - if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then
run_timed_command "bundle exec scripts/used-feature-flags" || (scripts/slack master-broken "☠️ \`${CI_JOB_NAME}\` failed! ☠️ See ${CI_JOB_URL}" ci_failing "GitLab Bot" && exit 1); run_timed_command "bundle exec scripts/used-feature-flags" || (scripts/slack master-broken "☠️ \`${CI_JOB_NAME}\` failed! ☠️ See ${CI_JOB_URL}" ci_failing "GitLab Bot" && exit 1);
else else
...@@ -763,7 +768,7 @@ rspec fail-fast: ...@@ -763,7 +768,7 @@ rspec fail-fast:
stage: test stage: test
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"] needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"]
script: script:
- *base-script - !reference [.base-script, script]
- rspec_fail_fast tmp/matching_tests.txt "--tag ~quarantine" - rspec_fail_fast tmp/matching_tests.txt "--tag ~quarantine"
artifacts: artifacts:
expire_in: 7d expire_in: 7d
...@@ -776,7 +781,7 @@ rspec foss-impact: ...@@ -776,7 +781,7 @@ rspec foss-impact:
- .rails:rules:rspec-foss-impact - .rails:rules:rspec-foss-impact
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets as-if-foss", "detect-tests as-if-foss"] needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets as-if-foss", "detect-tests as-if-foss"]
script: script:
- *base-script - !reference [.base-script, script]
- rspec_matched_foss_tests tmp/matching_foss_tests.txt "--tag ~quarantine" - rspec_matched_foss_tests tmp/matching_foss_tests.txt "--tag ~quarantine"
artifacts: artifacts:
expire_in: 7d expire_in: 7d
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment