Commit ea5b5917 authored by Brett Walker's avatar Brett Walker

Fix flaky test by pushing the MR creation early

The values will be queried for a month range.
5 days ensures the MR is well within that range.
parent 0b5df713
......@@ -43,6 +43,10 @@ RSpec.describe 'Value Stream Analytics', :js do
end
context "when there's value stream analytics data" do
around do |example|
travel_to(5.days.ago) { example.run }
end
before do
project.add_maintainer(user)
......@@ -53,10 +57,10 @@ RSpec.describe 'Value Stream Analytics', :js do
merge_request = issue.merge_requests_closing_issues.first.merge_request
merge_request.update!(created_at: issue.metrics.first_associated_with_milestone_at + 1.hour)
merge_request.metrics.update!(
latest_build_started_at: 4.hours.ago,
latest_build_finished_at: 3.hours.ago,
merged_at: merge_request.created_at + 1.hour,
first_deployed_to_production_at: merge_request.created_at + 2.hours
latest_build_started_at: merge_request.created_at + 3.hours,
latest_build_finished_at: merge_request.created_at + 4.hours,
merged_at: merge_request.created_at + 4.hours,
first_deployed_to_production_at: merge_request.created_at + 5.hours
)
sign_in(user)
......
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