Skip to content

Fix all the tests

Jacob Vosmaer requested to merge jv-fix-rspec-exit into master

Fixes https://gitlab.com/gitlab-org/gitlab-mail_room/-/issues/11 https://gitlab.com/gitlab-org/gitlab-mail_room/-/issues/12

  • Prevent exit in code under test from exiting the rspec process, with exit status 0 to make things worse
  • Make tests repeatable by putting Gemfile.lock under version control
  • Pin the mocha test gem to 1.9.0 because that appears to be the last version that still works with the bourne test gem: with mochoa 1.10.0 and up, almost all the tests fail with ArgumentErrors from bourne
  • Add Redis as a CI dependency
  • In tests, allow injecting Redis config with the REDIS_URL environment variable
  • Change signature of Mailroom::CrashHandler to make mocking/spying possible
  • Exercise JSON generation in CrashHandler tests

I don't like doing so many things all in one MR, but it seemed better to me than to have an intermediate state where master is failing CI.

Edited by Jacob Vosmaer

Merge request reports