Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-03-28 05:04:57 +0300
committerToon Claes <toon@gitlab.com>2018-03-28 09:58:04 +0300
commitd7dc9ad154b2589b6a1b702d76d29be4480d1211 (patch)
tree5550e0762e4bdbb69c03cd75baee30cc099122b0 /spec/spec_helper.rb
parent092445a4025bc1033e2028655ba739961f5e4ebb (diff)
Clean the test path after each spec run
FactoryBot's build_stubbed ignores the current database sequence of the projects table and starts at ID 1000. If more than 1000 projects are created during a test run, leftover repositories can cause spec failures. For example, a spec that expects an empty repository may fail since there may be existing content. Closes #5461
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 5051cd34564..e8cecf361ff 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -97,6 +97,10 @@ RSpec.configure do |config|
TestEnv.init
end
+ config.after(:all) do
+ TestEnv.clean_test_path
+ end
+
config.before(:example) do
# Skip pre-receive hook check so we can use the web editor and merge.
allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([true, nil])