Maintenance: Run further integration tests only in non-private branches.

This commit is contained in:
Thorsten Eckel 2021-07-06 21:13:02 +02:00
parent 05e1ae82ff
commit 605f5f6fa2
3 changed files with 11 additions and 13 deletions

View file

@ -158,6 +158,15 @@
- <<: *docker_redis - <<: *docker_redis
- <<: *docker_memcached - <<: *docker_memcached
.rules_integration_manual_start: &rules_integration_manual_start
rules:
- if: $CI_MERGE_REQUEST_ID
when: never
- if: '$CI_COMMIT_BRANCH =~ /^private/ && $INTEGRATION_TESTS == null'
when: manual
allow_failure: true
- when: on_success
# we need at least one job to store and include this template # we need at least one job to store and include this template
# but we skip this via 'only' -> 'variables' -> '$IGNORE' # but we skip this via 'only' -> 'variables' -> '$IGNORE'
# $IGNORE is not defined # $IGNORE is not defined

View file

@ -12,6 +12,7 @@ include:
extends: extends:
- .env_base - .env_base
- .services_mysql_postgresql - .services_mysql_postgresql
- .rules_integration_manual_start
tags: tags:
- integration - integration
stage: test stage: test

View file

@ -20,24 +20,12 @@ include:
- bundle exec rake zammad:db:init - bundle exec rake zammad:db:init
- bundle exec rspec --exclude-pattern "spec/{system,integration}/**/*_spec.rb" -t ~searchindex -t db_strategy:reset - bundle exec rspec --exclude-pattern "spec/{system,integration}/**/*_spec.rb" -t ~searchindex -t db_strategy:reset
# RSpec 3rd party integration tests are independent of the database
# therefore we need only one job and choose a random database for each run
.rspec_integration_rules: &rspec_integration_rules
rules:
- if: $CI_MERGE_REQUEST_ID
when: never
- if: '$CI_COMMIT_BRANCH =~ /^private/ && $INTEGRATION_TESTS == null'
when: manual
allow_failure: true
- when: on_success
rspec:integration: rspec:integration:
stage: test stage: test
extends: extends:
- .env_base - .env_base
- .services_mysql_postgresql_redis_memcached - .services_mysql_postgresql_redis_memcached
- .rspec_integration_rules - .rules_integration_manual_start
variables: variables:
RAILS_ENV: "test" RAILS_ENV: "test"
script: script: