Merge branch 'master' of abf.rosalinux.ru:abf/rosa-build

This commit is contained in:
Alexander Machehin 2014-09-30 17:20:15 +06:00
commit 6339880d49
2 changed files with 5 additions and 2 deletions

View File

@ -6,6 +6,7 @@ module BuildLists
def self.perform def self.perform
build_lists = BuildList.where(save_buildroot: true). build_lists = BuildList.where(save_buildroot: true).
for_status(BuildList::BUILD_ERROR).
where('updated_at < ?', Time.now - 1.hour). where('updated_at < ?', Time.now - 1.hour).
where('results ~ ?', "file_name: #{FILENAME}") where('results ~ ?', "file_name: #{FILENAME}")

View File

@ -6,7 +6,7 @@ describe BuildLists::CleanBuildrootJob do
subject { BuildLists::CleanBuildrootJob } subject { BuildLists::CleanBuildrootJob }
it 'ensures that not raises error' do it 'ensures that not raises error' do
FactoryGirl.create(:build_list) FactoryGirl.create(:build_list, status: BuildList::BUILD_ERROR)
expect(FileStoreService::File).to_not receive(:new) expect(FileStoreService::File).to_not receive(:new)
expect do expect do
subject.perform subject.perform
@ -20,11 +20,13 @@ describe BuildLists::CleanBuildrootJob do
] ]
FactoryGirl.create(:build_list, FactoryGirl.create(:build_list,
results: results, results: results,
save_buildroot: true save_buildroot: true,
status: BuildList::BUILD_ERROR
) )
bl = FactoryGirl.create(:build_list, bl = FactoryGirl.create(:build_list,
results: results, results: results,
save_buildroot: true, save_buildroot: true,
status: BuildList::BUILD_ERROR,
updated_at: Time.now - 2.hours updated_at: Time.now - 2.hours
) )
file_store_service = double(:file_store_service, destroy: true) file_store_service = double(:file_store_service, destroy: true)