Commit b76bd0d8 authored by Vladimir Shushlin's avatar Vladimir Shushlin

Fix broken dora4 spec

By default dora4 metrics controller returns data for last 3 months

We use 2021-01-01 as fixture date in specs.

So controllers stoped returning this data on 2021-04-02

Also, max range was calculated as 91 days, while it's actually
possible to have 92 days in 3 months.
I caught this trying to fix the issue
parent 0cc1b04b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Dora module Dora
class AggregateMetricsService < ::BaseContainerService class AggregateMetricsService < ::BaseContainerService
MAX_RANGE = 3.months / 1.day MAX_RANGE = 92 # the maximum number of days in 3 months
DEFAULT_ENVIRONMENT_TIER = 'production' DEFAULT_ENVIRONMENT_TIER = 'production'
DEFAULT_INTERVAL = Dora::DailyMetrics::INTERVAL_DAILY DEFAULT_INTERVAL = Dora::DailyMetrics::INTERVAL_DAILY
......
...@@ -15,7 +15,7 @@ RSpec.describe API::Dora::Metrics do ...@@ -15,7 +15,7 @@ RSpec.describe API::Dora::Metrics do
let(:user) { maintainer } let(:user) { maintainer }
around do |example| around do |example|
freeze_time do travel_to '2021-01-03'.to_time do
example.run example.run
end end
end end
......
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