2019-04-12 04:56:38 -04:00
|
|
|
.use-pg: &use-pg
|
|
|
|
services:
|
2019-08-04 12:12:42 -04:00
|
|
|
- name: postgres:9.6.14
|
2019-04-12 04:56:38 -04:00
|
|
|
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
|
|
|
|
- name: redis:alpine
|
|
|
|
|
|
|
|
.use-pg-10: &use-pg-10
|
|
|
|
services:
|
2019-08-04 12:12:42 -04:00
|
|
|
- name: postgres:10.9
|
2019-05-22 08:16:49 -04:00
|
|
|
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
|
|
|
|
- name: redis:alpine
|
2019-04-12 04:56:38 -04:00
|
|
|
|
|
|
|
.only-schedules-master: &only-schedules-master
|
|
|
|
only:
|
|
|
|
- schedules@gitlab-org/gitlab-ce
|
|
|
|
- schedules@gitlab-org/gitlab-ee
|
|
|
|
- master@gitlab-org/gitlab-ce
|
|
|
|
- master@gitlab-org/gitlab-ee
|
|
|
|
- master@gitlab/gitlabhq
|
|
|
|
- master@gitlab/gitlab-ee
|
|
|
|
|
|
|
|
.gitlab-setup: &gitlab-setup
|
2019-07-01 11:04:19 -04:00
|
|
|
extends:
|
|
|
|
- .dedicated-no-docs-and-no-qa-pull-cache-job
|
|
|
|
- .use-pg
|
2019-04-12 04:56:38 -04:00
|
|
|
variables:
|
|
|
|
SETUP_DB: "false"
|
|
|
|
script:
|
|
|
|
# Manually clone gitlab-test and only seed this project in
|
|
|
|
# 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
|
|
|
|
- scripts/gitaly-test-spawn
|
|
|
|
- force=yes SIZE=1 FIXTURE_PATH="db/fixtures/development" bundle exec rake gitlab:setup
|
|
|
|
artifacts:
|
|
|
|
when: on_failure
|
|
|
|
expire_in: 1d
|
|
|
|
paths:
|
|
|
|
- log/development.log
|
|
|
|
|
|
|
|
.rake-exec: &rake-exec
|
|
|
|
extends: .dedicated-no-docs-no-db-pull-cache-job
|
|
|
|
script:
|
|
|
|
- bundle exec rake $CI_JOB_NAME
|
|
|
|
|
|
|
|
.rspec-metadata: &rspec-metadata
|
2019-07-01 11:04:19 -04:00
|
|
|
extends:
|
|
|
|
- .dedicated-pull-cache-job
|
|
|
|
- .no-docs-and-no-qa
|
2019-04-12 04:56:38 -04:00
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- JOB_NAME=( $CI_JOB_NAME )
|
|
|
|
- TEST_TOOL=${JOB_NAME[0]}
|
2019-05-22 08:16:49 -04:00
|
|
|
- TEST_LEVEL=${JOB_NAME[1]}
|
|
|
|
- DATABASE=${JOB_NAME[2]}
|
|
|
|
- export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${TEST_TOOL}_${TEST_LEVEL}_${DATABASE}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
|
|
|
|
- export KNAPSACK_GENERATE_REPORT=true KNAPSACK_LOG_LEVEL=debug KNAPSACK_TEST_DIR=spec
|
2019-04-12 04:56:38 -04:00
|
|
|
- export SUITE_FLAKY_RSPEC_REPORT_PATH=${FLAKY_RSPEC_SUITE_REPORT_PATH}
|
|
|
|
- export FLAKY_RSPEC_REPORT_PATH=rspec_flaky/all_${TEST_TOOL}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
|
|
|
|
- export NEW_FLAKY_RSPEC_REPORT_PATH=rspec_flaky/new_${TEST_TOOL}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
|
|
|
|
- export FLAKY_RSPEC_GENERATE_REPORT=true
|
|
|
|
- export CACHE_CLASSES=true
|
|
|
|
- cp ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH}
|
|
|
|
- '[[ -f $FLAKY_RSPEC_REPORT_PATH ]] || echo "{}" > ${FLAKY_RSPEC_REPORT_PATH}'
|
|
|
|
- '[[ -f $NEW_FLAKY_RSPEC_REPORT_PATH ]] || echo "{}" > ${NEW_FLAKY_RSPEC_REPORT_PATH}'
|
|
|
|
- scripts/gitaly-test-spawn
|
2019-05-22 08:16:49 -04:00
|
|
|
- date
|
|
|
|
- 'export KNAPSACK_TEST_FILE_PATTERN=$(ruby -r./lib/quality/test_level.rb -e "puts Quality::TestLevel.new.pattern(:${TEST_LEVEL})")'
|
2019-07-12 06:44:17 -04:00
|
|
|
- mkdir -p tmp/memory_test
|
|
|
|
- export MEMORY_TEST_PATH="tmp/memory_test/${TEST_TOOL}_${TEST_LEVEL}_${DATABASE}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_memory.csv"
|
2019-05-22 08:16:49 -04:00
|
|
|
- knapsack rspec "--color --format documentation --format RspecJunitFormatter --out junit_rspec.xml --tag level:${TEST_LEVEL} --tag ~geo"
|
|
|
|
- date
|
2019-04-12 04:56:38 -04:00
|
|
|
artifacts:
|
|
|
|
expire_in: 31d
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- coverage/
|
|
|
|
- knapsack/
|
|
|
|
- rspec_flaky/
|
|
|
|
- rspec_profiling/
|
|
|
|
- tmp/capybara/
|
2019-07-12 06:44:17 -04:00
|
|
|
- tmp/memory_test/
|
2019-07-19 02:53:53 -04:00
|
|
|
reports:
|
|
|
|
junit: junit_rspec.xml
|
2019-04-12 04:56:38 -04:00
|
|
|
|
|
|
|
.rspec-metadata-pg: &rspec-metadata-pg
|
|
|
|
<<: *rspec-metadata
|
|
|
|
<<: *use-pg
|
|
|
|
|
|
|
|
.rspec-metadata-pg-10: &rspec-metadata-pg-10
|
|
|
|
<<: *rspec-metadata
|
|
|
|
<<: *use-pg-10
|
2019-08-11 03:50:01 -04:00
|
|
|
image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-golang-1.11-git-2.22-chrome-73.0-node-12.x-yarn-1.16-postgresql-10-graphicsmagick-1.3.33"
|
2019-04-12 04:56:38 -04:00
|
|
|
|
|
|
|
# DB migration, rollback, and seed jobs
|
|
|
|
.db-migrate-reset: &db-migrate-reset
|
|
|
|
extends: .dedicated-no-docs-and-no-qa-pull-cache-job
|
|
|
|
script:
|
|
|
|
- bundle exec rake db:migrate:reset
|
|
|
|
dependencies:
|
|
|
|
- setup-test-env
|
|
|
|
|
|
|
|
.migration-paths: &migration-paths
|
|
|
|
extends: .dedicated-no-docs-and-no-qa-pull-cache-job
|
|
|
|
variables:
|
|
|
|
SETUP_DB: "false"
|
|
|
|
script:
|
2019-05-30 08:38:13 -04:00
|
|
|
- git fetch https://gitlab.com/gitlab-org/gitlab-ce.git v11.11.0
|
2019-04-12 04:56:38 -04:00
|
|
|
- git checkout -f FETCH_HEAD
|
|
|
|
- sed -i "s/gem 'oj', '~> 2.17.4'//" Gemfile
|
2019-05-06 06:35:35 -04:00
|
|
|
- sed -i "s/gem 'bootsnap', '~> 1.0.0'/gem 'bootsnap'/" Gemfile
|
|
|
|
- bundle update google-protobuf grpc bootsnap
|
2019-04-12 04:56:38 -04:00
|
|
|
- bundle install $BUNDLE_INSTALL_FLAGS
|
|
|
|
- date
|
|
|
|
- cp config/gitlab.yml.example config/gitlab.yml
|
|
|
|
- bundle exec rake db:drop db:create db:schema:load db:seed_fu
|
|
|
|
- date
|
|
|
|
- git checkout -f $CI_COMMIT_SHA
|
|
|
|
- bundle install $BUNDLE_INSTALL_FLAGS
|
|
|
|
- date
|
|
|
|
- . scripts/prepare_build.sh
|
|
|
|
- date
|
|
|
|
- bundle exec rake db:migrate
|
|
|
|
dependencies:
|
|
|
|
- setup-test-env
|
|
|
|
|
|
|
|
setup-test-env:
|
2019-07-01 11:04:19 -04:00
|
|
|
extends:
|
|
|
|
- .dedicated-runner-default-cache
|
|
|
|
- .no-docs
|
|
|
|
- .use-pg
|
2019-04-12 04:56:38 -04:00
|
|
|
stage: prepare
|
|
|
|
script:
|
|
|
|
- bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init'
|
2019-06-05 12:31:35 -04:00
|
|
|
- scripts/gitaly-test-build # Do not use 'bundle exec' here
|
2019-04-12 04:56:38 -04:00
|
|
|
artifacts:
|
|
|
|
expire_in: 7d
|
|
|
|
paths:
|
|
|
|
- tmp/tests
|
|
|
|
- config/secrets.yml
|
|
|
|
- vendor/gitaly-ruby
|
|
|
|
|
2019-05-22 08:16:49 -04:00
|
|
|
rspec unit pg:
|
2019-04-12 04:56:38 -04:00
|
|
|
<<: *rspec-metadata-pg
|
2019-07-05 17:52:16 -04:00
|
|
|
parallel: 20
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2019-05-22 08:16:49 -04:00
|
|
|
rspec integration pg:
|
|
|
|
<<: *rspec-metadata-pg
|
|
|
|
parallel: 6
|
|
|
|
|
|
|
|
rspec system pg:
|
|
|
|
<<: *rspec-metadata-pg
|
|
|
|
parallel: 24
|
|
|
|
|
|
|
|
rspec unit pg-10:
|
2019-04-12 04:56:38 -04:00
|
|
|
<<: *rspec-metadata-pg-10
|
|
|
|
<<: *only-schedules-master
|
2019-07-05 17:52:16 -04:00
|
|
|
parallel: 20
|
2019-05-22 08:16:49 -04:00
|
|
|
|
|
|
|
rspec integration pg-10:
|
|
|
|
<<: *rspec-metadata-pg-10
|
|
|
|
<<: *only-schedules-master
|
|
|
|
parallel: 6
|
|
|
|
|
|
|
|
rspec system pg-10:
|
|
|
|
<<: *rspec-metadata-pg-10
|
|
|
|
<<: *only-schedules-master
|
|
|
|
parallel: 24
|
|
|
|
|
2019-04-12 04:56:38 -04:00
|
|
|
rspec-fast-spec-helper:
|
|
|
|
<<: *rspec-metadata-pg
|
|
|
|
script:
|
|
|
|
- bundle exec rspec spec/fast_spec_helper.rb
|
|
|
|
|
|
|
|
.rspec-quarantine: &rspec-quarantine
|
|
|
|
<<: *only-schedules-master
|
|
|
|
script:
|
|
|
|
- export CACHE_CLASSES=true
|
|
|
|
- scripts/gitaly-test-spawn
|
2019-05-22 08:16:49 -04:00
|
|
|
- bin/rspec --color --format documentation --tag quarantine -- spec/
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2019-05-22 07:10:19 -04:00
|
|
|
rspec quarantine pg:
|
2019-04-12 04:56:38 -04:00
|
|
|
<<: *rspec-metadata-pg
|
|
|
|
<<: *rspec-quarantine
|
|
|
|
allow_failure: true
|
|
|
|
|
|
|
|
static-analysis:
|
|
|
|
extends: .dedicated-no-docs-no-db-pull-cache-job
|
|
|
|
dependencies:
|
|
|
|
- compile-assets
|
2019-06-14 06:13:35 -04:00
|
|
|
- compile-assets pull-cache
|
2019-04-12 04:56:38 -04:00
|
|
|
- setup-test-env
|
|
|
|
script:
|
|
|
|
- scripts/static-analysis
|
|
|
|
cache:
|
2019-06-14 02:54:44 -04:00
|
|
|
key: "debian-stretch-ruby-2.6.3-node-12.x-and-rubocop"
|
2019-04-12 04:56:38 -04:00
|
|
|
paths:
|
|
|
|
- vendor/ruby
|
|
|
|
- .yarn-cache/
|
|
|
|
- tmp/rubocop_cache
|
|
|
|
policy: pull-push
|
|
|
|
|
|
|
|
downtime_check:
|
|
|
|
<<: *rake-exec
|
|
|
|
except:
|
2019-07-01 11:04:19 -04:00
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
- tags
|
|
|
|
- /^[\d-]+-stable(-ee)?$/
|
2019-08-02 02:24:07 -04:00
|
|
|
- /(^docs[\/-].+|.+-docs$)/
|
2019-07-01 11:04:19 -04:00
|
|
|
- /(^qa[\/-].*|.*-qa$)/
|
2019-04-12 04:56:38 -04:00
|
|
|
dependencies:
|
|
|
|
- setup-test-env
|
|
|
|
|
|
|
|
ee_compat_check:
|
|
|
|
<<: *rake-exec
|
|
|
|
dependencies: []
|
|
|
|
except:
|
2019-07-01 11:04:19 -04:00
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
- tags
|
|
|
|
- /[\d-]+-stable(-ee)?/
|
|
|
|
- /^security-/
|
|
|
|
- branches@gitlab-org/gitlab-ee
|
|
|
|
- branches@gitlab/gitlab-ee
|
2019-08-02 02:24:07 -04:00
|
|
|
- /(^docs[\/-].+|.+-docs$)/
|
2019-04-12 04:56:38 -04:00
|
|
|
retry: 0
|
|
|
|
artifacts:
|
|
|
|
name: "${CI_JOB_NAME}_${CI_COMIT_REF_NAME}_${CI_COMMIT_SHA}"
|
|
|
|
when: always
|
|
|
|
expire_in: 10d
|
|
|
|
paths:
|
|
|
|
- ee_compat_check/patches/*.patch
|
|
|
|
|
|
|
|
db:migrate:reset-pg:
|
|
|
|
<<: *db-migrate-reset
|
|
|
|
<<: *use-pg
|
|
|
|
|
|
|
|
db:check-schema-pg:
|
|
|
|
<<: *db-migrate-reset
|
|
|
|
<<: *use-pg
|
|
|
|
script:
|
|
|
|
- source scripts/schema_changed.sh
|
|
|
|
|
|
|
|
migration:path-pg:
|
|
|
|
<<: *migration-paths
|
|
|
|
<<: *use-pg
|
|
|
|
|
|
|
|
.db-rollback: &db-rollback
|
|
|
|
extends: .dedicated-no-docs-and-no-qa-pull-cache-job
|
|
|
|
script:
|
2019-07-01 12:46:09 -04:00
|
|
|
- bundle exec rake db:migrate VERSION=20180101160629
|
2019-06-20 11:50:46 -04:00
|
|
|
- bundle exec rake db:migrate SKIP_SCHEMA_VERSION_CHECK=true
|
2019-04-12 04:56:38 -04:00
|
|
|
dependencies:
|
|
|
|
- setup-test-env
|
|
|
|
|
|
|
|
db:rollback-pg:
|
|
|
|
<<: *db-rollback
|
|
|
|
<<: *use-pg
|
|
|
|
|
|
|
|
gitlab:setup-pg:
|
|
|
|
<<: *gitlab-setup
|
|
|
|
<<: *use-pg
|
|
|
|
dependencies:
|
|
|
|
- setup-test-env
|
|
|
|
|
|
|
|
coverage:
|
|
|
|
# Don't include dedicated-no-docs-no-db-pull-cache-job here since we need to
|
|
|
|
# download artifacts from all the rspec jobs instead of from setup-test-env only
|
2019-07-01 11:04:19 -04:00
|
|
|
extends:
|
|
|
|
- .dedicated-runner-default-cache
|
|
|
|
- .no-docs-and-no-qa
|
2019-04-12 04:56:38 -04:00
|
|
|
cache:
|
|
|
|
policy: pull
|
|
|
|
variables:
|
|
|
|
SETUP_DB: "false"
|
|
|
|
stage: post-test
|
|
|
|
script:
|
|
|
|
- bundle exec scripts/merge-simplecov
|
2019-07-12 06:44:17 -04:00
|
|
|
- bundle exec scripts/gather-test-memory-data
|
2019-04-12 04:56:38 -04:00
|
|
|
coverage: '/LOC \((\d+\.\d+%)\) covered.$/'
|
|
|
|
artifacts:
|
|
|
|
name: coverage
|
|
|
|
expire_in: 31d
|
|
|
|
paths:
|
2019-06-05 12:31:35 -04:00
|
|
|
- coverage/index.html
|
|
|
|
- coverage/assets/
|
2019-07-12 06:44:17 -04:00
|
|
|
- tmp/memory_test/
|