Skip to content
Snippets Groups Projects
Commit a4f26a7b authored by catch's avatar catch
Browse files

Issue #3477191 by goz, pavel.bulat, benjifisher, catch: Add...

Issue #3477191 by goz, pavel.bulat, benjifisher, catch: Add PerformanceTestTrait::assertMetrics() so it is easier to write performance tests
parent a8ab8712
No related branches found
No related tags found
No related merge requests found
......@@ -640,7 +640,7 @@ protected function assertMetrics(
array $expected,
PerformanceData $performance_data,
): void {
// Allow those metrics to have a range of +/- 50 bytes, so small changes
// Allow those metrics to have a range of +/- 500 bytes, so small changes
// are not significant enough to break tests.
$assertRange = [
'ScriptBytes',
......@@ -648,7 +648,7 @@ protected function assertMetrics(
];
foreach ($expected as $name => $metric) {
if (in_array($name, $assertRange)) {
$this->assertCountBetween($metric - 50, $metric + 50, $performance_data->{"get$name"}(), "Asserting $name");
$this->assertCountBetween($metric - 500, $metric + 500, $performance_data->{"get$name"}(), "Asserting $name");
}
else {
$this->assertSame($metric, $performance_data->{"get$name"}(), "Asserting $name");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment