Stop relation batch export spec leaking a foo directory

What does this MR do and why?

Fixes broken master: gitlab-org/quality/engineering-productivity/master-broken-incidents#31488 (closed)

spec/lib/gitlab/import_export/snippet_repo_restorer_spec.rb:26 fails whenever it runs after spec/services/bulk_imports/relation_batch_export_service_spec.rb in the same job.

The bulk import spec pointed the export at a relative foo directory and stubbed out its cleanup, so a foo directory was left in the Rails root. The snippet restorer spec uses foo as a path that should not exist, finds it, and fails. Recent test splitting started putting both specs in the same job, which is why it broke today.

The bulk import spec now uses a temporary directory and removes it afterwards.

How to verify

bin/rspec spec/services/bulk_imports/relation_batch_export_service_spec.rb spec/lib/gitlab/import_export/snippet_repo_restorer_spec.rb

Before this change the second spec fails with expected true, got false. Afterwards both pass and no foo directory is left behind.

🤖 Generated with Claude Code

Merge request reports

Loading
Loading