GivenObjectInDB() and additional improvements in the tests suite to address false positive and slow tests

Rewrite tests on impact analysis to make them readable in the first place, then simplifiy the tests to focus on risk reduction, then complete with some edge case
Rewrite tests on impact graph build when the current user has restricted access to some parts of the graph
This commit is contained in:
Eric Espie
2024-05-28 09:22:35 +02:00
committed by Romain Quetiez
parent b8d8ec640d
commit 984f676d6e
11 changed files with 1137 additions and 1116 deletions

View File

@@ -40,15 +40,6 @@ class LoginTest extends ItopDataTestCase {
parent::tearDown();
}
public function testLoginInfiniteLoopFix() {
$iTimeStamp = microtime(true);
$sOutput = $this->CallItopUrlByCurl(sprintf("/pages/UI.php?login_mode=%s", $this->sLoginMode));
$iElapsedInMs = (microtime(true) - $iTimeStamp) * 1000;
$sMaxExecutionInS = 1;
$this->assertTrue($iElapsedInMs < $sMaxExecutionInS * 1000, "iTop answered in $iElapsedInMs ms. it should do it in less than $sMaxExecutionInS seconds (max_execution_time)");
$this->assertFalse(strpos($sOutput, "Fatal error"), "no fatal error due to max execution time should be returned" . $sOutput);
}
protected function CallItopUrlByCurl($sUri, ?array $aPostFields=[]){
$ch = curl_init();