From cb81e4007cec44b5a97dc573e6aff6b2fde314a1 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sat, 28 Mar 2020 11:01:54 -0700 Subject: [PATCH] Removed performance tests --- phpunit.xml.dist | 16 +---- .../TypeConversionPerformanceTest.php | 44 ------------- .../Tests/DbalPerformanceTestCase.php | 63 ------------------ .../Tests/DbalPerformanceTestListener.php | 65 ------------------- 4 files changed, 1 insertion(+), 187 deletions(-) delete mode 100644 tests/Doctrine/Tests/DBAL/Performance/TypeConversionPerformanceTest.php delete mode 100644 tests/Doctrine/Tests/DbalPerformanceTestCase.php delete mode 100644 tests/Doctrine/Tests/DbalPerformanceTestListener.php diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f62532ed9f9..cef52e33c5b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -44,11 +44,7 @@ - ./tests/Doctrine/Tests/DBAL - ./tests/Doctrine/Tests/DBAL/Performance - - - ./tests/Doctrine/Tests/DBAL/Performance + tests/Doctrine/Tests/DBAL @@ -57,14 +53,4 @@ lib/Doctrine - - - - - - - - performance - - diff --git a/tests/Doctrine/Tests/DBAL/Performance/TypeConversionPerformanceTest.php b/tests/Doctrine/Tests/DBAL/Performance/TypeConversionPerformanceTest.php deleted file mode 100644 index 6a76e90f897..00000000000 --- a/tests/Doctrine/Tests/DBAL/Performance/TypeConversionPerformanceTest.php +++ /dev/null @@ -1,44 +0,0 @@ -connection->getDatabasePlatform(); - $this->startTiming(); - for ($i = 0; $i < $count; $i++) { - $type->convertToDatabaseValue($value, $platform); - } - $this->stopTiming(); - } - - /** - * @return mixed[][] - */ - public static function itemCountProvider() : iterable - { - return [ - '100 items' => [100], - '1000 items' => [1000], - '10000 items' => [10000], - '100000 items' => [100000], - ]; - } -} diff --git a/tests/Doctrine/Tests/DbalPerformanceTestCase.php b/tests/Doctrine/Tests/DbalPerformanceTestCase.php deleted file mode 100644 index ac0beb3c5de..00000000000 --- a/tests/Doctrine/Tests/DbalPerformanceTestCase.php +++ /dev/null @@ -1,63 +0,0 @@ -startTime, 'Test timing was started'); - self::assertNotNull($this->runTime, 'Test timing was stopped'); - } - - /** - * begin timing - */ - protected function startTiming() : void - { - $this->startTime = microtime(true); - } - - /** - * end timing - */ - protected function stopTiming() : void - { - $this->runTime = microtime(true) - $this->startTime; - } - - /** - * @return float elapsed test execution time - */ - public function getTime() : float - { - return $this->runTime; - } -} diff --git a/tests/Doctrine/Tests/DbalPerformanceTestListener.php b/tests/Doctrine/Tests/DbalPerformanceTestListener.php deleted file mode 100644 index e9265c0f35f..00000000000 --- a/tests/Doctrine/Tests/DbalPerformanceTestListener.php +++ /dev/null @@ -1,65 +0,0 @@ -timings[$class])) { - $this->timings[$class] = []; - } - - // Store timing data for each test in the order they were run. - $this->timings[$class][$test->getName(true)] = $test->getTime(); - } - - /** - * Report performance test timings. - * - * Note: __destruct is used here because PHPUnit doesn't have a - * 'All tests over' hook. - */ - public function __destruct() - { - if (empty($this->timings)) { - return; - } - - // Report timings. - print "\nPerformance test results:\n\n"; - - foreach ($this->timings as $class => $tests) { - printf("%s:\n", $class); - foreach ($tests as $test => $time) { - printf("\t%s: %.3f seconds\n", $test, $time); - } - } - } -}