Avoid enabling sidekiq when forking project in spec
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
The following discussion from !22418 (merged) should be addressed:
-
@reprazent started a discussion: (+4 comments) If the only reason we need sidekiq is to have the
fork_project
-spec helper work, perhaps we should consider running it inline there:create_repository = params.delete(:repository) # Avoid creating a repository if create_repository RepositoryForkWorker.new.perform(...) # with the right argument else allow(RepositoryForkWorker).to receive(:perform_async).and_return(true) shell = double('gitlab_shell', fork_repository: true) allow(service).to receive(:gitlab_shell).and_return(shell) end
Or is there another reason we need to have sidekiq jobs run?
We should look into how it'll affect the rest of the specs if we go with the suggested approach. If it is going to affect it negatively and it's significant, look into another approach.
Edited by 🤖 GitLab Bot 🤖