Skip to content

Stub keeping commits around in tests

Igor Drozdov requested to merge id-stub-keeping-around into master

What does this MR do?

The logic for keeping commits around in the repo is called quite often, for example, any time when a merge request diff is created. And it's not actually necessary for the tests (most of the time) according to the description of what this method does

What about extracting the logic into a separate service and stubbing it. It speeds up the creating of merge requests: locally I got 0.3s instead of 0.4s

For the whole spec/models/merge_request_spec.rb file, the execution time reduced from 2m45s to 2m00s

Edited by Igor Drozdov

Merge request reports