diff options
Diffstat (limited to '.gitlab/ci/rails.gitlab-ci.yml')
-rw-r--r-- | .gitlab/ci/rails.gitlab-ci.yml | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index 22aa92779ea..e1ddefca99e 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -6,12 +6,17 @@ - .default-before_script - .rails-cache -.base-script: &base-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-bundle-install: + script: + - run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519" + +.base-script: + 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: variables: @@ -27,7 +32,7 @@ RECORD_DEPRECATIONS: "true" needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"] script: - - *base-script + - !reference [.base-script, script] - rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag ~level:migration" artifacts: expire_in: 31d @@ -49,7 +54,7 @@ .rspec-base-migration: extends: .rails:rules:ee-and-foss-migration script: - - *base-script + - !reference [.base-script, script] - rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag level:migration" .rspec-base-pg11: @@ -82,7 +87,7 @@ .rspec-ee-base-geo: extends: .rspec-base script: - - *base-script + - !reference [.base-script, script] - rspec_paralellized_job "--tag ~quarantine --tag geo" .rspec-ee-base-geo-pg11: @@ -142,7 +147,7 @@ setup-test-env: extends: - .rails-job-base - .setup-test-env-cache - - .rails:rules:default-refs-code-backstage-qa + - .rails:rules:code-backstage-qa - .use-pg11 stage: prepare variables: @@ -162,6 +167,7 @@ setup-test-env: - tmp/tests/gitaly/gitaly-lfs-smudge - tmp/tests/gitaly/gitaly-ssh - tmp/tests/gitaly/internal/ + - tmp/tests/gitaly/internal_gitaly2/ - tmp/tests/gitaly/internal_sockets/ - tmp/tests/gitaly/Makefile - tmp/tests/gitaly/praefect @@ -212,7 +218,7 @@ update-coverage-cache: - .shared:rules:update-cache stage: prepare 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: policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up. @@ -243,7 +249,7 @@ update-static-analysis-cache: static-analysis: extends: - .static-analysis-base - - .rails:rules:default-refs-code-backstage-qa + - .rails:rules:code-backstage-qa stage: test parallel: 4 script: @@ -316,7 +322,7 @@ rspec db-library-code pg12: - .rspec-base-pg12 - .rails:rules:ee-and-foss-db-library-code script: - - *base-script + - !reference [.base-script, script] - rspec_db_library_code rspec fast_spec_helper: @@ -405,7 +411,7 @@ gitlab:setup: # db/fixtures/development/04_project.rb thanks to SIZE=1 below - git clone https://gitlab.com/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 artifacts: when: on_failure @@ -485,7 +491,7 @@ rspec:coverage: - memory-static - memory-on-boot 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/gather-test-memory-data" coverage: '/LOC \((\d+\.\d+%)\) covered.$/' @@ -522,7 +528,7 @@ rspec:feature-flags: - memory-static - memory-on-boot 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 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 @@ -762,7 +768,7 @@ rspec fail-fast: stage: test needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"] script: - - *base-script + - !reference [.base-script, script] - rspec_fail_fast tmp/matching_tests.txt "--tag ~quarantine" artifacts: expire_in: 7d @@ -775,7 +781,7 @@ 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"] script: - - *base-script + - !reference [.base-script, script] - rspec_matched_foss_tests tmp/matching_foss_tests.txt "--tag ~quarantine" artifacts: expire_in: 7d |