Commit 15c1a003 authored by Albert Salim's avatar Albert Salim

Run test at a fixed time

Due to how HLLRedisCounter#weekly_redis_keys converts
dates to calendar week, it would result in an empty
array when the calendar week of end_date occurs before
the calendar week of start_date.

For example, given start_date 2020-12-01 and
end_date 2021-01-01, the calendar week would be reversed,
resulting in empty array from #weekly_redis_keys
parent 5a73f50f
......@@ -6,6 +6,12 @@ RSpec.describe Ci::BuildReportResultService do
describe '#execute', :clean_gitlab_redis_shared_state do
subject(:build_report_result) { described_class.new.execute(build) }
around do |example|
travel_to(DateTime.parse('2020-07-01')) do
example.run
end
end
context 'when build is finished' do
let(:build) { create(:ci_build, :success, :test_reports) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment