rspec.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. include:
  2. - local: '/.gitlab/ci/rspec/mysql.yml'
  3. - local: '/.gitlab/ci/rspec/postgresql.yml'
  4. .template_rspec: &template_rspec
  5. extends:
  6. - .env_base
  7. variables:
  8. RAILS_ENV: "test"
  9. script:
  10. - bundle exec rake zammad:db:init
  11. - bundle exec rspec --exclude-pattern "spec/{system,integration}/**/*_spec.rb" -t ~searchindex -t ~db_strategy:reset
  12. .template_rspec_db_reset: &template_rspec_db_reset
  13. extends:
  14. - .env_base
  15. variables:
  16. RAILS_ENV: "test"
  17. script:
  18. - bundle exec rake zammad:db:init
  19. - bundle exec rspec --exclude-pattern "spec/{system,integration}/**/*_spec.rb" -t ~searchindex -t db_strategy:reset
  20. # RSpec 3rd party integration tests are independent of the database
  21. # therefore we need only one job and choose a random database for each run
  22. .rspec_integration_rules: &rspec_integration_rules
  23. rules:
  24. - if: $CI_MERGE_REQUEST_ID
  25. when: never
  26. - if: '$CI_COMMIT_BRANCH =~ /^private/ && $INTEGRATION_TESTS != null'
  27. when: manual
  28. allow_failure: true
  29. - when: on_success
  30. rspec:integration:
  31. stage: test
  32. extends:
  33. - .env_base
  34. - .services_mysql_postgresql
  35. - .rspec_integration_rules
  36. variables:
  37. RAILS_ENV: "test"
  38. script:
  39. - bundle exec rake zammad:db:init
  40. - bundle exec rspec -t type:integration