12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- performance:
- stage: test
- rules:
- - if: $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"
- - if: $CI_PIPELINE_SOURCE == "merge_request_event"
- changes:
- - .gitlab/ci/test/performance.yml
- - .gitlab/performance/**/*
- # Make sure this gets executed exclusively on a runner.
- tags: ['no_concurrency']
- services:
- - !reference [.services, postgresql]
- - !reference [.services, redis]
- cache: []
- before_script:
- # Copy performance checking code to tmp/ so that it survives branch switching
- - cp -rv .gitlab/performance tmp/
- # First, checkout stable and set it up.
- - git fetch --unshallow >/dev/null 2>&1
- - git checkout stable-6.0
- - !reference [.scripts, source_rvm]
- - rvm use 3.1.3
- - !reference [.scripts, bundle_install]
- - !reference [.scripts, configure_environment]
- - !reference [.scripts, zammad_db_init]
- - yarn install --silent # Required for assets:precompile test
- script:
- - bundle exec rails r tmp/performance/fill_db.rb
- # Run performance tests for stable.
- - bundle exec rails r tmp/performance/run_tests.rb
- # Then, switch to the current commit, migrate to it and run a few selected tests.
- - git checkout $CI_COMMIT_SHA
- - rvm use 3.2.4
- - !reference [.scripts, bundle_install]
- # Force redis usage, even if it was disabled by the initial configure_environment script of stable.
- - export REDIS_URL=redis://redis
- - bundle exec rails db:migrate > /dev/null
- - rm -rf node_modules && pnpm install > /dev/null # Required for assets:precompile test.
- - bundle exec rails assets:clobber && git checkout public/assets # Clear previously generated assets to have a full regeneration.
- # Run performance tests for current branch.
- - bundle exec rails r tmp/performance/run_tests.rb
- after_script: []
|