Skip to content

Stop using Gitlab::Shell#create_repository in specs

What does this MR do?

Extraction from !26924 (merged)

Gitlab::Shell#create_repository is going away, and its use in specs hinders that effort. In specs, it is used to set up scenarios where a repository conflicts with an attempt to create one, so going through a ::Repository is typically not an option. We can use TestEnv#create_bare_repository instead, though. We don't care about the content of the repository in these specs, just that a repository of some kind is on disk at the expected path.

Most of these instances are related to legacy storage, so we can expect to remove them as part of &2320

Instances found using grep create_repository ee/spec spec | grep -i shell. The remaining cases are either testing the method itself, or stubbing out the use of create_repository in application, rather than test, code.

Since I'm expecting to remove the create_repository method entirely soon, and needing to do this kind of thing in specs is extremely rare, I don't believe it's worth the effort of adding a cop to prevent recurrences in the meantime.

Does this MR meet the acceptance criteria?

Conformity

Part of #25095 (closed)

Edited by Nick Thomas

Merge request reports