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
|
|
|
|
2020-11-23 13:13:16 +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
|
|
|
|
|
2021-03-16 15:24:09 +00:00
|
|
|
.rspec_integration_rules: &rspec_integration_rules
|
2020-11-23 13:13:16 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_MERGE_REQUEST_ID
|
|
|
|
when: never
|
2021-04-30 09:35:39 +00:00
|
|
|
- if: '$CI_COMMIT_BRANCH =~ /^private/ && $INTEGRATION_TESTS == null'
|
2020-11-23 13:13:16 +00:00
|
|
|
when: manual
|
|
|
|
allow_failure: true
|
2021-03-15 08:22:23 +00:00
|
|
|
- when: on_success
|
2021-03-16 15:24:09 +00:00
|
|
|
|
|
|
|
rspec:integration:
|
|
|
|
stage: test
|
|
|
|
extends:
|
|
|
|
- .env_base
|
2021-06-30 08:24:58 +00:00
|
|
|
- .services_mysql_postgresql_redis
|
2021-03-16 15:24:09 +00:00
|
|
|
- .rspec_integration_rules
|
|
|
|
variables:
|
|
|
|
RAILS_ENV: "test"
|
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
|