diff options
author | Stan Hu <stanhu@gmail.com> | 2018-03-27 19:04:57 -0700 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2018-03-28 08:58:04 +0200 |
commit | d7dc9ad154b2589b6a1b702d76d29be4480d1211 (patch) | |
tree | 5550e0762e4bdbb69c03cd75baee30cc099122b0 /spec/spec_helper.rb | |
parent | 092445a4025bc1033e2028655ba739961f5e4ebb (diff) | |
download | gitlab-ce-d7dc9ad154b2589b6a1b702d76d29be4480d1211.tar.gz |
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.rb | 4 |
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]) |