Performance budget Test message update

Followup to Id5c28ecec20c4a74a113dd8781b6a022391ae443

- Make the message more readable

Bug: T350292
Change-Id: I299bcca61b8df30024ad70c17ca33bf0f6c322fe
This commit is contained in:
Moh'd Khier Abualruz 2023-11-03 13:31:25 +01:00
parent 2dfc70c842
commit bcc71fc459

View file

@ -152,9 +152,12 @@ class PerformanceBudgetTest extends MediaWikiIntegrationTestCase {
$size += $this->getContentTransferSize( $moduleName, $skinName ); $size += $this->getContentTransferSize( $moduleName, $skinName );
} }
$stylesMaxSize = $this->getSizeInBytes( $maxSizes[ 'styles' ] ); $stylesMaxSize = $this->getSizeInBytes( $maxSizes[ 'styles' ] );
$message = "Performance budget for style in skin $skinName on main article namespace has been exceeded." . $message = "T346813: Performance budget for style in skin" .
" Total size of style modules is $size bytes is greater than budget size $stylesMaxSize bytes" . " $skinName on main article namespace has been exceeded." .
" Reduce styles loaded on page load or talk to skin maintainer before modifying the budget."; " Total size of style modules is $size bytes is greater" .
" than the current budget size of $stylesMaxSize bytes" .
" Please reduce styles that you are loading on page load" .
" or talk to the skin maintainer about modifying the budget.";
$this->assertLessThanOrEqual( $stylesMaxSize, $size, $message ); $this->assertLessThanOrEqual( $stylesMaxSize, $size, $message );
$modulesScripts = $skin->getOutput()->getModules(); $modulesScripts = $skin->getOutput()->getModules();
$size = 0; $size = 0;
@ -162,9 +165,12 @@ class PerformanceBudgetTest extends MediaWikiIntegrationTestCase {
$size += $this->getContentTransferSize( $moduleName, $skinName ); $size += $this->getContentTransferSize( $moduleName, $skinName );
} }
$scriptsMaxSize = $this->getSizeInBytes( $maxSizes[ 'scripts' ] ); $scriptsMaxSize = $this->getSizeInBytes( $maxSizes[ 'scripts' ] );
$message = "Performance budget for scripts in skin $skinName on main article namespace has been exceeded." . $message = "T346813: Performance budget for scripts in skin" .
" Total size of script modules is $size bytes is greater than budget size $scriptsMaxSize bytes" . " $skinName on main article namespace has been exceeded." .
" Reduce scripts loaded on page load or talk to skin maintainer before modifying the budget."; " Total size of script modules is $size bytes is greater" .
" than the current budget size of $scriptsMaxSize bytes" .
" Please reduce scripts that you are loading on page load" .
" or talk to the skin maintainer about modifying the budget.";
$this->assertLessThanOrEqual( $scriptsMaxSize, $size, $message ); $this->assertLessThanOrEqual( $scriptsMaxSize, $size, $message );
} }
} }