Commit 1b06aa95 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch '218274-fix-gitaly-dependent-jobs-missing-gems' into 'master'

Ensure Gitaly is installed properly even when cache is stale

Closes #218274

See merge request gitlab-org/gitlab!32508
parents cc194a6d 18a4cf0e
.run-dev-fixtures: .run-dev-fixtures:
extends: extends:
- .default-retry - .default-retry
- .default-cache - .rails-cache
- .default-before_script - .default-before_script
- .use-pg11 - .use-pg11
stage: test stage: test
...@@ -19,8 +19,9 @@ run-dev-fixtures: ...@@ -19,8 +19,9 @@ run-dev-fixtures:
- .run-dev-fixtures - .run-dev-fixtures
- .dev-fixtures:rules:ee-and-foss - .dev-fixtures:rules:ee-and-foss
script: script:
- scripts/gitaly-test-spawn - run_timed_command "scripts/gitaly-test-build"
- RAILS_ENV=test bundle exec rake db:seed_fu - run_timed_command "scripts/gitaly-test-spawn"
- run_timed_command "RAILS_ENV=test bundle exec rake db:seed_fu"
run-dev-fixtures-ee: run-dev-fixtures-ee:
extends: extends:
...@@ -28,6 +29,7 @@ run-dev-fixtures-ee: ...@@ -28,6 +29,7 @@ run-dev-fixtures-ee:
- .dev-fixtures:rules:ee-only - .dev-fixtures:rules:ee-only
- .use-pg11-ee - .use-pg11-ee
script: script:
- scripts/gitaly-test-spawn - run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn"
- cp ee/db/fixtures/development/* $FIXTURE_PATH - cp ee/db/fixtures/development/* $FIXTURE_PATH
- RAILS_ENV=test bundle exec rake db:seed_fu - run_timed_command "RAILS_ENV=test bundle exec rake db:seed_fu"
...@@ -136,16 +136,15 @@ compile-assets pull-cache as-if-foss: ...@@ -136,16 +136,15 @@ compile-assets pull-cache as-if-foss:
.frontend-fixtures-base: .frontend-fixtures-base:
extends: extends:
- .default-retry - .default-retry
- .default-cache - .rails-cache
- .default-before_script - .default-before_script
- .use-pg11 - .use-pg11
stage: fixtures stage: fixtures
needs: ["setup-test-env", "compile-assets pull-cache"] needs: ["setup-test-env", "compile-assets pull-cache"]
script: script:
- date - run_timed_command "scripts/gitaly-test-build"
- scripts/gitaly-test-spawn - run_timed_command "scripts/gitaly-test-spawn"
- date - run_timed_command "bundle exec rake frontend:fixtures"
- bundle exec rake frontend:fixtures
artifacts: artifacts:
name: frontend-fixtures name: frontend-fixtures
expire_in: 31d expire_in: 31d
......
...@@ -29,6 +29,19 @@ ...@@ -29,6 +29,19 @@
- vendor/gitaly-ruby - vendor/gitaly-ruby
policy: pull policy: pull
.rails-cache:
cache:
key:
files:
- Gemfile.lock
- GITALY_SERVER_VERSION
prefix: "ruby-go-cache-v1"
paths:
- vendor/ruby
- vendor/gitaly-ruby
- .go/pkg/mod
policy: pull
.yarn-cache: .yarn-cache:
cache: cache:
key: key:
......
.rails:needs:setup-and-assets: .rails:needs:setup-and-assets:
needs: ["setup-test-env", "compile-assets pull-cache"] needs: ["setup-test-env", "compile-assets pull-cache"]
.rails-cache:
cache:
key: "ruby-go-cache-v1"
paths:
- vendor/ruby
- vendor/gitaly-ruby
- .go/pkg/mod
policy: pull
.rails-job-base: .rails-job-base:
extends: extends:
- .default-retry - .default-retry
...@@ -18,15 +9,18 @@ ...@@ -18,15 +9,18 @@
####################################################### #######################################################
# EE/FOSS: default refs (MRs, master, schedules) jobs # # EE/FOSS: default refs (MRs, master, schedules) jobs #
.base-setup-test-env: setup-test-env:
extends: extends:
- .rails-job-base - .rails-job-base
- .rails:rules:default-refs-code-backstage-qa
- .use-pg11
stage: prepare stage: prepare
variables: variables:
GITLAB_TEST_EAGER_LOAD: "0" GITLAB_TEST_EAGER_LOAD: "0"
script: script:
- run_timed_command "bundle exec ruby -I. -e 'require \"config/environment\"; TestEnv.init'" - run_timed_command "bundle exec ruby -I. -e 'require \"config/environment\"; TestEnv.init'"
- run_timed_command "scripts/gitaly-test-build" # Do not use 'bundle exec' here - run_timed_command "scripts/gitaly-test-build" # Do not use 'bundle exec' here
- rm tmp/tests/gitaly/.ruby-bundle # This file prevents gems from being installed even if vendor/gitaly-ruby is missing
artifacts: artifacts:
expire_in: 7d expire_in: 7d
paths: paths:
...@@ -44,12 +38,6 @@ ...@@ -44,12 +38,6 @@
cache: cache:
policy: pull-push policy: pull-push
setup-test-env:
extends:
- .base-setup-test-env
- .rails:rules:default-refs-code-backstage-qa
- .use-pg11
static-analysis: static-analysis:
extends: extends:
- .rails-job-base - .rails-job-base
...@@ -84,6 +72,8 @@ downtime_check: ...@@ -84,6 +72,8 @@ downtime_check:
stage: test stage: test
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache"] needs: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache"]
script: script:
- run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn"
- source scripts/rspec_helpers.sh - source scripts/rspec_helpers.sh
- rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag ~level:migration" - rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag ~level:migration"
artifacts: artifacts:
...@@ -108,6 +98,8 @@ downtime_check: ...@@ -108,6 +98,8 @@ downtime_check:
.rspec-base-migration: .rspec-base-migration:
script: script:
- run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn"
- source scripts/rspec_helpers.sh - source scripts/rspec_helpers.sh
- rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag level:migration" - rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag level:migration"
...@@ -193,6 +185,7 @@ gitlab:setup: ...@@ -193,6 +185,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
- run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn" - run_timed_command "scripts/gitaly-test-spawn"
- 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:
...@@ -300,6 +293,8 @@ rspec-ee system pg11: ...@@ -300,6 +293,8 @@ rspec-ee system pg11:
.rspec-ee-base-geo: .rspec-ee-base-geo:
extends: .rspec-base-ee extends: .rspec-base-ee
script: script:
- run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn"
- source scripts/rspec_helpers.sh - source scripts/rspec_helpers.sh
- scripts/prepare_postgres_fdw.sh - scripts/prepare_postgres_fdw.sh
- rspec_paralellized_job "--tag ~quarantine --tag geo" - rspec_paralellized_job "--tag ~quarantine --tag geo"
......
...@@ -53,8 +53,6 @@ function rspec_simple_job() { ...@@ -53,8 +53,6 @@ function rspec_simple_job() {
export NO_KNAPSACK="1" export NO_KNAPSACK="1"
scripts/gitaly-test-spawn
bin/rspec --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml ${rspec_opts} bin/rspec --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml ${rspec_opts}
} }
...@@ -104,8 +102,6 @@ function rspec_paralellized_job() { ...@@ -104,8 +102,6 @@ function rspec_paralellized_job() {
fi fi
fi fi
scripts/gitaly-test-spawn
mkdir -p tmp/memory_test mkdir -p tmp/memory_test
export MEMORY_TEST_PATH="tmp/memory_test/${report_name}_memory.csv" export MEMORY_TEST_PATH="tmp/memory_test/${report_name}_memory.csv"
......
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