.only-schedules-master: only: refs: - schedules@gitlab-org/gitlab-foss - schedules@gitlab-org/gitlab - master@gitlab-org/gitlab-foss - master@gitlab-org/gitlab - master@gitlab/gitlabhq - master@gitlab/gitlab-ee .only-gitlab-ee: only: - branches@gitlab-org/gitlab - tags@gitlab-org/gitlab .rake-exec: extends: - .default-tags - .default-retry - .default-cache - .default-before_script variables: SETUP_DB: "false" script: - bundle exec rake $CI_JOB_NAME .rspec-base: extends: - .default-tags - .default-retry - .default-cache - .default-before_script - .except-docs-qa stage: test script: - JOB_NAME=( $CI_JOB_NAME ) - TEST_TOOL=${JOB_NAME[0]} - 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 - 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 - date - 'export KNAPSACK_TEST_FILE_PATTERN=$(ruby -r./lib/quality/test_level.rb -e "puts Quality::TestLevel.new.pattern(:${TEST_LEVEL})")' - 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" - knapsack rspec "--color --format documentation --format RspecJunitFormatter --out junit_rspec.xml --tag level:${TEST_LEVEL} --tag ~geo" - date artifacts: expire_in: 31d when: always paths: - coverage/ - knapsack/ - rspec_flaky/ - rspec_profiling/ - tmp/capybara/ - tmp/memory_test/ reports: junit: junit_rspec.xml .rspec-base-pg: extends: - .rspec-base - .use-pg .rspec-base-pg-10: extends: - .rspec-base - .use-pg-10 setup-test-env: extends: - .default-tags - .default-retry - .default-cache - .default-before_script - .use-pg - .except-docs stage: prepare script: - bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init' - scripts/gitaly-test-build # Do not use 'bundle exec' here artifacts: expire_in: 7d paths: - tmp/tests - config/secrets.yml - vendor/gitaly-ruby rspec unit pg: extends: .rspec-base-pg parallel: 20 rspec integration pg: extends: .rspec-base-pg parallel: 6 rspec system pg: extends: .rspec-base-pg parallel: 24 rspec unit pg-10: extends: - .rspec-base-pg-10 - .only-schedules-master parallel: 20 rspec integration pg-10: extends: - .rspec-base-pg-10 - .only-schedules-master parallel: 6 rspec system pg-10: extends: - .rspec-base-pg-10 - .only-schedules-master parallel: 24 rspec-fast-spec-helper: extends: .rspec-base-pg script: - bundle exec rspec spec/fast_spec_helper.rb rspec quarantine pg: extends: - .default-before_script - .rspec-base-pg - .only-schedules-master script: - export NO_KNAPSACK=1 CACHE_CLASSES=true - scripts/gitaly-test-spawn - bin/rspec --color --format documentation --tag quarantine -- spec/ allow_failure: true static-analysis: extends: - .default-tags - .default-retry - .default-cache - .default-before_script - .except-docs dependencies: ["setup-test-env", "compile-assets", "compile-assets pull-cache"] variables: SETUP_DB: "false" script: - scripts/static-analysis cache: key: "debian-stretch-ruby-2.6.3-and-rubocop" paths: - vendor/ruby - tmp/rubocop_cache policy: pull-push downtime_check: extends: .rake-exec except: refs: - master - tags - /^[\d-]+-stable(-ee)?$/ - /(^docs[\/-].+|.+-docs$)/ - /(^qa[\/-].*|.*-qa$)/ stage: test dependencies: ["setup-test-env"] needs: ["setup-test-env"] ee_compat_check: extends: .rake-exec dependencies: [] except: refs: - master - tags - branches@gitlab-org/gitlab - branches@gitlab/gitlab-ee - /^[\d-]+-stable(-ee)?$/ - /(^docs[\/-].+|.+-docs$)/ - /^security-/ artifacts: name: "${CI_JOB_NAME}_${CI_COMIT_REF_NAME}_${CI_COMMIT_SHA}" when: always expire_in: 10d paths: - ee_compat_check/patches/*.patch # DB migration, rollback, and seed jobs db:migrate:reset: extends: - .default-tags - .default-retry - .default-cache - .default-before_script - .use-pg - .except-docs-qa stage: test dependencies: ["setup-test-env"] needs: ["setup-test-env"] script: - bundle exec rake db:migrate:reset db:check-schema: extends: - .default-tags - .default-retry - .default-cache - .default-before_script - .use-pg - .except-docs-qa stage: test dependencies: ["setup-test-env"] needs: ["setup-test-env"] script: - source scripts/schema_changed.sh db:migrate-from-v11.11.0: extends: - .default-tags - .default-retry - .default-cache - .default-before_script - .use-pg - .except-docs-qa stage: test dependencies: ["setup-test-env"] needs: ["setup-test-env"] variables: SETUP_DB: "false" script: - git fetch https://gitlab.com/gitlab-org/gitlab.git v11.11.0-ee - git checkout -f FETCH_HEAD - sed -i "s/gem 'oj', '~> 2.17.4'//" Gemfile - sed -i "s/gem 'bootsnap', '~> 1.0.0'/gem 'bootsnap'/" Gemfile - bundle update google-protobuf grpc bootsnap - 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 db:rollback: extends: - .default-tags - .default-retry - .default-cache - .default-before_script - .use-pg - .except-docs-qa stage: test dependencies: ["setup-test-env"] needs: ["setup-test-env"] script: - bundle exec rake db:migrate VERSION=20180101160629 - bundle exec rake db:migrate SKIP_SCHEMA_VERSION_CHECK=true gitlab:setup: extends: - .default-tags - .default-retry - .default-cache - .default-before_script - .use-pg - .except-docs-qa stage: test dependencies: ["setup-test-env"] needs: ["setup-test-env"] 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 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 extends: - .default-tags - .default-retry - .default-cache - .default-before_script - .except-docs-qa cache: policy: pull variables: SETUP_DB: "false" stage: post-test script: - bundle exec scripts/merge-simplecov - bundle exec scripts/gather-test-memory-data coverage: '/LOC \((\d+\.\d+%)\) covered.$/' artifacts: name: coverage expire_in: 31d paths: - coverage/index.html - coverage/assets/ - tmp/memory_test/ ## EE-specific content .rspec-base-ee: extends: - .rspec-base - .only-gitlab-ee script: - JOB_NAME=( $CI_JOB_NAME ) - TEST_TOOL=${JOB_NAME[0]} - TEST_LEVEL=${JOB_NAME[1]} - DATABASE=${JOB_NAME[2]} - export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${TEST_TOOL}_${TEST_LEVEL}_${DATABASE}_ee_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json - export KNAPSACK_GENERATE_REPORT=true KNAPSACK_LOG_LEVEL=debug KNAPSACK_TEST_DIR=spec - export CACHE_CLASSES=true - cp ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH} - scripts/gitaly-test-spawn - date - 'export KNAPSACK_TEST_FILE_PATTERN=$(ruby -r./lib/quality/test_level.rb -e "puts Quality::TestLevel.new(%(ee/)).pattern(:${TEST_LEVEL})")' - mkdir -p tmp/memory_test - export MEMORY_TEST_PATH="tmp/memory_test/ee_${TEST_TOOL}_${TEST_LEVEL}_${DATABASE}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_memory.csv" - knapsack rspec "--color --format documentation --format RspecJunitFormatter --out junit_rspec.xml --tag level:${TEST_LEVEL} --tag ~geo" - date .rspec-base-pg-ee: extends: .rspec-base-ee services: - name: postgres:9.6 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] - name: redis:alpine - name: docker.elastic.co/elasticsearch/elasticsearch:5.6.12 rspec unit pg ee: extends: .rspec-base-pg-ee parallel: 7 rspec integration pg ee: extends: .rspec-base-pg-ee parallel: 3 rspec system pg ee: extends: .rspec-base-pg-ee parallel: 5 .rspec-base-pg-geo: extends: - .rspec-base - .only-gitlab-ee script: - JOB_NAME=( $CI_JOB_NAME ) - TEST_TOOL=${JOB_NAME[0]} - TEST_LEVEL=${JOB_NAME[1]} - DATABASE=${JOB_NAME[2]} - export KNAPSACK_TEST_FILE_PATTERN="ee/spec/**{,/*/**}/*_spec.rb" KNAPSACK_GENERATE_REPORT=true CACHE_CLASSES=true - export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${TEST_TOOL}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json - cp ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH} - source scripts/prepare_postgres_fdw.sh - scripts/gitaly-test-spawn - mkdir -p tmp/memory_test - export MEMORY_TEST_PATH="tmp/memory_test/ee_${TEST_TOOL}_${TEST_LEVEL}_${DATABASE}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_memory.csv" - knapsack rspec "-Ispec --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml --tag geo" rspec geo pg ee: extends: - .rspec-base-pg-geo - .use-pg - .except-docs-qa-geo parallel: 3 rspec geo pg-10 ee: extends: - .rspec-base-pg-geo - .use-pg-10 - .except-docs-qa-geo parallel: 3 quick-rspec geo pg ee: extends: - .rspec-base-pg-geo - .use-pg stage: quick-test only: - /(^geo[\/-].*|.*-geo$)/ quick-rspec geo pg-10 ee: extends: - .rspec-base-pg-geo - .use-pg-10 stage: quick-test only: - /(^geo[\/-].*|.*-geo$)/ rspec quarantine pg ee: extends: rspec quarantine pg script: - export NO_KNAPSACK=1 CACHE_CLASSES=true - scripts/gitaly-test-spawn - bin/rspec --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml --tag quarantine -- ee/spec/ migration:upgrade-pg-ce-to-ee: extends: - .default-tags - .default-retry - .default-cache - .default-before_script - .use-pg - .except-docs-qa dependencies: ["setup-test-env"] variables: SETUP_DB: "false" script: - ruby -r./scripts/ee_specific_check/ee_specific_check -e'EESpecificCheck.fetch_remote_ce_branch' - git checkout -f FETCH_HEAD - . scripts/utils.sh - . scripts/prepare_build.sh - date - setup_db - date - git checkout -f $CI_COMMIT_SHA - date - . scripts/prepare_build.sh - date - bundle exec rake db:migrate db:rollback geo: extends: - db:rollback - .only-gitlab-ee script: - bundle exec rake geo:db:migrate VERSION=20170627195211 - bundle exec rake geo:db:migrate ## END of EE-specific content