FIX Prevent vacuum from running multiple times during test runs
This commit is contained in:
parent
e123f69b7b
commit
6b5a18503a
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
Name: postgrestest
|
||||
---
|
||||
SilverStripe\Core\Injector\Injector:
|
||||
SilverStripe\Dev\State\SapphireTestState:
|
||||
properties:
|
||||
States:
|
||||
disablepostgresvacuum: '%$SilverStripe\PostgreSQL\Dev\State\DisableVacuumState'
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
namespace SilverStripe\PostgreSQL\Dev\State;
|
||||
|
||||
use SilverStripe\Core\Config\Config;
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
use SilverStripe\Dev\State\TestState;
|
||||
use SilverStripe\PostgreSQL\PostgreSQLSchemaManager;
|
||||
|
||||
class DisableVacuumState implements TestState
|
||||
{
|
||||
/**
|
||||
* Called on setup
|
||||
*
|
||||
* @param SapphireTest $test
|
||||
*/
|
||||
public function setUp(SapphireTest $test)
|
||||
{
|
||||
// TODO: Implement setUp() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on tear down
|
||||
*
|
||||
* @param SapphireTest $test
|
||||
*/
|
||||
public function tearDown(SapphireTest $test)
|
||||
{
|
||||
// TODO: Implement tearDown() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Called once on setup
|
||||
*
|
||||
* @param string $class Class being setup
|
||||
*/
|
||||
public function setUpOnce($class)
|
||||
{
|
||||
Config::modify()->set(PostgreSQLSchemaManager::class, 'check_and_repair_on_build', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called once on tear down
|
||||
*
|
||||
* @param string $class Class being torn down
|
||||
*/
|
||||
public function tearDownOnce($class)
|
||||
{
|
||||
// TODO: Implement tearDownOnce() method.
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue