[CI] Can we get some faster phpunit execution? (#27113)
* Don't backup globals and static attributes * Unset global variable to remove impact on followup tests Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
daa7e11095
commit
5bfce597a9
|
@ -48,6 +48,9 @@ class FileTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
unset($_SERVER['HTTP_OC_CHUNKED']);
|
||||||
|
unset($_SERVER['CONTENT_LENGTH']);
|
||||||
|
unset($_SERVER['REQUEST_METHOD']);
|
||||||
|
|
||||||
\OC_Hook::clear();
|
\OC_Hook::clear();
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,8 @@ abstract class RequestTest extends TestCase {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
|
unset($_SERVER['HTTP_OC_CHUNKED']);
|
||||||
|
|
||||||
$this->serverFactory = new ServerFactory(
|
$this->serverFactory = new ServerFactory(
|
||||||
\OC::$server->getConfig(),
|
\OC::$server->getConfig(),
|
||||||
\OC::$server->getLogger(),
|
\OC::$server->getLogger(),
|
||||||
|
|
|
@ -38,6 +38,7 @@ use OCP\Files\IRootFolder;
|
||||||
use OCP\Lock\LockedException;
|
use OCP\Lock\LockedException;
|
||||||
use OCP\Share\IManager;
|
use OCP\Share\IManager;
|
||||||
use OCP\Share;
|
use OCP\Share;
|
||||||
|
use Test\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ShareAPIControllerTest
|
* Class ShareAPIControllerTest
|
||||||
|
@ -45,7 +46,7 @@ use OCP\Share;
|
||||||
* @package OCA\Files_Sharing\Tests\Controller
|
* @package OCA\Files_Sharing\Tests\Controller
|
||||||
* @group DB
|
* @group DB
|
||||||
*/
|
*/
|
||||||
class ShareAPIControllerTest extends \Test\TestCase {
|
class ShareAPIControllerTest extends TestCase {
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
private $appName = 'files_sharing';
|
private $appName = 'files_sharing';
|
||||||
|
|
|
@ -8,10 +8,15 @@
|
||||||
|
|
||||||
namespace Test\Repair;
|
namespace Test\Repair;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Connection;
|
||||||
|
use Doctrine\DBAL\Platforms\MySqlPlatform;
|
||||||
|
use OC\Repair\Collation;
|
||||||
|
use OCP\IDBConnection;
|
||||||
use OCP\ILogger;
|
use OCP\ILogger;
|
||||||
use OCP\Migration\IOutput;
|
use OCP\Migration\IOutput;
|
||||||
|
use Test\TestCase;
|
||||||
|
|
||||||
class TestCollationRepair extends \OC\Repair\Collation {
|
class TestCollationRepair extends Collation {
|
||||||
/**
|
/**
|
||||||
* @param \Doctrine\DBAL\Connection $connection
|
* @param \Doctrine\DBAL\Connection $connection
|
||||||
* @return string[]
|
* @return string[]
|
||||||
|
@ -28,7 +33,7 @@ class TestCollationRepair extends \OC\Repair\Collation {
|
||||||
*
|
*
|
||||||
* @see \OC\Repair\RepairMimeTypes
|
* @see \OC\Repair\RepairMimeTypes
|
||||||
*/
|
*/
|
||||||
class RepairCollationTest extends \Test\TestCase {
|
class RepairCollationTest extends TestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var TestCollationRepair
|
* @var TestCollationRepair
|
||||||
|
@ -36,7 +41,7 @@ class RepairCollationTest extends \Test\TestCase {
|
||||||
private $repair;
|
private $repair;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Doctrine\DBAL\Connection
|
* @var Connection|IDBConnection
|
||||||
*/
|
*/
|
||||||
private $connection;
|
private $connection;
|
||||||
|
|
||||||
|
@ -59,7 +64,7 @@ class RepairCollationTest extends \Test\TestCase {
|
||||||
$this->connection = \OC::$server->getDatabaseConnection();
|
$this->connection = \OC::$server->getDatabaseConnection();
|
||||||
$this->logger = $this->createMock(ILogger::class);
|
$this->logger = $this->createMock(ILogger::class);
|
||||||
$this->config = \OC::$server->getConfig();
|
$this->config = \OC::$server->getConfig();
|
||||||
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
|
if (!$this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
|
||||||
$this->markTestSkipped("Test only relevant on MySql");
|
$this->markTestSkipped("Test only relevant on MySql");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<phpunit bootstrap="bootstrap.php"
|
<phpunit bootstrap="bootstrap.php"
|
||||||
strict="true"
|
strict="true"
|
||||||
verbose="true"
|
verbose="true"
|
||||||
|
backupGlobals="false"
|
||||||
timeoutForSmallTests="900"
|
timeoutForSmallTests="900"
|
||||||
timeoutForMediumTests="900"
|
timeoutForMediumTests="900"
|
||||||
timeoutForLargeTests="900"
|
timeoutForLargeTests="900"
|
||||||
|
|
Loading…
Reference in New Issue