DEV: Set uploads_id_seq starting point before tests (#15215)

Some tests don't pass when this is elevated. They should be fixed,
since, at some point, we may create enough uploads during tests that
they fail naturally.
This commit is contained in:
Daniel Waterworth 2021-12-07 12:26:35 -06:00 committed by GitHub
parent 6e8df3d66b
commit 95c75d3f4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -235,6 +235,12 @@ RSpec.configure do |config|
SiteSetting.provider = TestLocalProcessProvider.new
WebMock.disable_net_connect!
if ENV['ELEVATED_UPLOADS_ID']
DB.exec "SELECT setval('uploads_id_seq', 10000)"
else
DB.exec "SELECT setval('uploads_id_seq', 1)"
end
end
class TestLocalProcessProvider < SiteSettings::LocalProcessProvider