FIX: Keep by_users check in S3 inventory

Partial revert of 8515d8fa - the by_users check is ensuring we don't raise errors for fixtures
This commit is contained in:
David Taylor
2020-07-21 17:19:56 +01:00
parent ef37460c93
commit ec4024fe6d
2 changed files with 5 additions and 3 deletions

View File

@ -67,7 +67,7 @@ describe "S3Inventory" do
upload = Fabricate(:upload, etag: "ETag", updated_at: 1.days.ago)
Fabricate(:upload, etag: "ETag2", updated_at: Time.now)
Fabricate(:upload, updated_at: 2.days.ago)
no_etag = Fabricate(:upload, updated_at: 2.days.ago)
inventory.expects(:files).returns([{ key: "Key", filename: "#{csv_filename}.gz" }]).times(3)
inventory.expects(:inventory_date).returns(Time.now)
@ -76,8 +76,8 @@ describe "S3Inventory" do
inventory.backfill_etags_and_list_missing
end
expect(output).to eq("#{upload.url}\n1 of 5 uploads are missing\n")
expect(Discourse.stats.get("missing_s3_uploads")).to eq(1)
expect(output).to eq("#{upload.url}\n#{no_etag.url}\n2 of 5 uploads are missing\n")
expect(Discourse.stats.get("missing_s3_uploads")).to eq(2)
end
it "should backfill etags to uploads table correctly" do