2020-05-06 09:32:26 +00:00
|
|
|
include:
|
|
|
|
- local: '/.gitlab/ci/rspec/mysql.yml'
|
|
|
|
- local: '/.gitlab/ci/rspec/postgresql.yml'
|
|
|
|
|
|
|
|
.template_rspec: &template_rspec
|
|
|
|
extends:
|
|
|
|
- .env_base
|
|
|
|
variables:
|
|
|
|
RAILS_ENV: "test"
|
|
|
|
script:
|
|
|
|
- bundle exec rake zammad:db:init
|
2020-11-23 13:13:16 +00:00
|
|
|
- bundle exec rspec --exclude-pattern "spec/{system,integration}/**/*_spec.rb" -t ~searchindex -t ~db_strategy:reset
|
2020-09-16 12:43:04 +00:00
|
|
|
|
|
|
|
.template_rspec_db_reset: &template_rspec_db_reset
|
|
|
|
extends:
|
|
|
|
- .env_base
|
|
|
|
variables:
|
|
|
|
RAILS_ENV: "test"
|
|
|
|
script:
|
|
|
|
- bundle exec rake zammad:db:init
|
2020-11-23 13:13:16 +00:00
|
|
|
- bundle exec rspec --exclude-pattern "spec/{system,integration}/**/*_spec.rb" -t ~searchindex -t db_strategy:reset
|
2020-05-06 09:32:26 +00:00
|
|
|
|
2021-08-26 12:14:40 +00:00
|
|
|
# RSpec 3rd party integration tests are independent of the database
|
|
|
|
# therefore we need only one job and choose a random database for each run
|
|
|
|
# Optionally pass INTEGRATION_TESTS=enabled to run them in private- branch
|
|
|
|
|
2021-03-16 15:24:09 +00:00
|
|
|
rspec:integration:
|
|
|
|
stage: test
|
|
|
|
extends:
|
|
|
|
- .env_base
|
2021-07-02 11:46:37 +00:00
|
|
|
- .services_mysql_postgresql_redis_memcached
|
2021-07-06 19:13:02 +00:00
|
|
|
- .rules_integration_manual_start
|
2021-03-16 15:24:09 +00:00
|
|
|
variables:
|
|
|
|
RAILS_ENV: "test"
|
2021-08-26 12:14:40 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_MERGE_REQUEST_ID
|
|
|
|
when: never
|
|
|
|
- if: '$CI_COMMIT_BRANCH =~ /^private/ && $INTEGRATION_TESTS != "enabled"'
|
|
|
|
when: manual
|
|
|
|
allow_failure: true
|
|
|
|
- when: always
|
2020-05-06 09:32:26 +00:00
|
|
|
script:
|
2020-11-23 13:13:16 +00:00
|
|
|
- bundle exec rake zammad:db:init
|
|
|
|
- bundle exec rspec -t type:integration
|