Improve DORA metrics test to reduce flakiness
What does this MR do and why?
I noticed the job was flaky in gitlab-org/quality/engineering-productivity/master-broken-incidents#911 (closed) with:
1) Dora::DailyMetrics.aggregate_for! with multiple metrics when interval is all aggregates the rows
Failure/Error: is_expected.to eq({ 'date' => nil, 'deployment_frequency' => 6, 'change_failure_rate' => 4.0 / 6 })
expected: {"change_failure_rate"=>0.6666666666666666, "date"=>nil, "deployment_frequency"=>6}
got: {"change_failure_rate"=>0.666666666666667, "date"=>nil, "deployment_frequency"=>6}
(compared using ==)
Diff:
@@ -1 +1 @@
-"change_failure_rate" => 0.6666666666666666,
+"change_failure_rate" => 0.666666666666667,
This improves the tests to allow rounding on the assertion.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Rémy Coutable