diff options
Diffstat (limited to 'spec/services/ci/compare_test_reports_service_spec.rb')
-rw-r--r-- | spec/services/ci/compare_test_reports_service_spec.rb | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/spec/services/ci/compare_test_reports_service_spec.rb b/spec/services/ci/compare_test_reports_service_spec.rb index 377c801b008..01d58b2095f 100644 --- a/spec/services/ci/compare_test_reports_service_spec.rb +++ b/spec/services/ci/compare_test_reports_service_spec.rb @@ -67,7 +67,7 @@ RSpec.describe Ci::CompareTestReportsService do # The JUnit fixture for the given build has 3 failures. # This service will create 1 test case failure record for each. - Ci::TestCasesService.new.execute(build) + Ci::TestFailureHistoryService.new(head_pipeline).execute end it 'loads recent failures on limited test cases to avoid building up a huge DB query', :aggregate_failures do @@ -80,34 +80,4 @@ RSpec.describe Ci::CompareTestReportsService do end end end - - describe '#latest?' do - subject { service.latest?(base_pipeline, head_pipeline, data) } - - let!(:base_pipeline) { nil } - let!(:head_pipeline) { create(:ci_pipeline, :with_test_reports, project: project) } - let!(:key) { service.send(:key, base_pipeline, head_pipeline) } - - context 'when cache key is latest' do - let(:data) { { key: key } } - - it { is_expected.to be_truthy } - end - - context 'when cache key is outdated' do - before do - head_pipeline.update_column(:updated_at, 10.minutes.ago) - end - - let(:data) { { key: key } } - - it { is_expected.to be_falsy } - end - - context 'when cache key is empty' do - let(:data) { { key: nil } } - - it { is_expected.to be_falsy } - end - end end |