diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-02-29 16:22:30 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-02-29 16:23:36 +0100 |
commit | 3c39f5ac413cc1bd58a0647fcbb52982af81c078 (patch) | |
tree | 7dfecfbf46240e0c2db13a1ee8c2f5b927676530 /src/Wallabag/CoreBundle | |
parent | dfad9ba0f94562d81b2002b15a5bfd52b9dcba38 (diff) | |
download | wallabag-3c39f5ac413cc1bd58a0647fcbb52982af81c078.tar.gz wallabag-3c39f5ac413cc1bd58a0647fcbb52982af81c078.tar.zst wallabag-3c39f5ac413cc1bd58a0647fcbb52982af81c078.zip |
Skipping all Posgres test for wallabag:install
We already faced this problem but we are facing it again.
https://github.com/wallabag/wallabag/commit/d502762598db68ec822078642df8f6a8214202f7
It seems we can drop a database properly using wallabag:install.
The server log keep saying:
ERROR: source database "template1" is being accessed by other users
DETAIL: There is 1 other session using the database.
STATEMENT: CREATE DATABASE "wallabag_test"
Which means, it can't remove the database wallabag_test because one other person is using it.
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r-- | src/Wallabag/CoreBundle/Command/InstallCommand.php | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php | 38 |
2 files changed, 19 insertions, 21 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 771b3c5a..e97ba46a 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php | |||
@@ -193,7 +193,7 @@ class InstallCommand extends ContainerAwareCommand | |||
193 | $this->defaultOutput->writeln('<info><comment>Step 3 of 4.</comment> Administration setup.</info>'); | 193 | $this->defaultOutput->writeln('<info><comment>Step 3 of 4.</comment> Administration setup.</info>'); |
194 | 194 | ||
195 | $questionHelper = $this->getHelperSet()->get('question'); | 195 | $questionHelper = $this->getHelperSet()->get('question'); |
196 | $question = new ConfirmationQuestion('Would you like to create a new admin user (recommended) ? (y/N)', true); | 196 | $question = new ConfirmationQuestion('Would you like to create a new admin user (recommended) ? (Y/n)', true); |
197 | 197 | ||
198 | if (!$questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) { | 198 | if (!$questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) { |
199 | return $this; | 199 | return $this; |
diff --git a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php index a79d7b90..bb8fb888 100644 --- a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php +++ b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php | |||
@@ -14,6 +14,24 @@ use Wallabag\CoreBundle\Tests\WallabagCoreTestCase; | |||
14 | 14 | ||
15 | class InstallCommandTest extends WallabagCoreTestCase | 15 | class InstallCommandTest extends WallabagCoreTestCase |
16 | { | 16 | { |
17 | public function setUp() | ||
18 | { | ||
19 | parent::setUp(); | ||
20 | |||
21 | if ($this->getClient()->getContainer()->get('doctrine')->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOPgSql\Driver) { | ||
22 | /* | ||
23 | * LOG: statement: CREATE DATABASE "wallabag" | ||
24 | * ERROR: source database "template1" is being accessed by other users | ||
25 | * DETAIL: There is 1 other session using the database. | ||
26 | * STATEMENT: CREATE DATABASE "wallabag" | ||
27 | * FATAL: database "wallabag" does not exist | ||
28 | * | ||
29 | * http://stackoverflow.com/a/14374832/569101 | ||
30 | */ | ||
31 | $this->markTestSkipped('PostgreSQL spotted: can find a good way to drop current database, skipping.'); | ||
32 | } | ||
33 | } | ||
34 | |||
17 | public static function tearDownAfterClass() | 35 | public static function tearDownAfterClass() |
18 | { | 36 | { |
19 | $application = new Application(static::$kernel); | 37 | $application = new Application(static::$kernel); |
@@ -91,19 +109,6 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
91 | 109 | ||
92 | public function testRunInstallCommandWithDatabaseRemoved() | 110 | public function testRunInstallCommandWithDatabaseRemoved() |
93 | { | 111 | { |
94 | if ($this->getClient()->getContainer()->get('doctrine')->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOPgSql\Driver) { | ||
95 | /* | ||
96 | * LOG: statement: CREATE DATABASE "wallabag" | ||
97 | * ERROR: source database "template1" is being accessed by other users | ||
98 | * DETAIL: There is 1 other session using the database. | ||
99 | * STATEMENT: CREATE DATABASE "wallabag" | ||
100 | * FATAL: database "wallabag" does not exist | ||
101 | * | ||
102 | * http://stackoverflow.com/a/14374832/569101 | ||
103 | */ | ||
104 | $this->markTestSkipped('PostgreSQL spotted: can find a good way to drop current database, skipping.'); | ||
105 | } | ||
106 | |||
107 | $application = new Application($this->getClient()->getKernel()); | 112 | $application = new Application($this->getClient()->getKernel()); |
108 | $application->add(new DropDatabaseDoctrineCommand()); | 113 | $application->add(new DropDatabaseDoctrineCommand()); |
109 | 114 | ||
@@ -184,13 +189,6 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
184 | 189 | ||
185 | public function testRunInstallCommandChooseNothing() | 190 | public function testRunInstallCommandChooseNothing() |
186 | { | 191 | { |
187 | if ($this->getClient()->getContainer()->get('doctrine')->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOPgSql\Driver) { | ||
188 | /* | ||
189 | * @see testRunInstallCommandWithDatabaseRemoved | ||
190 | */ | ||
191 | $this->markTestSkipped('PostgreSQL spotted: can find a good way to drop current database, skipping.'); | ||
192 | } | ||
193 | |||
194 | $application = new Application($this->getClient()->getKernel()); | 192 | $application = new Application($this->getClient()->getKernel()); |
195 | $application->add(new InstallCommand()); | 193 | $application->add(new InstallCommand()); |
196 | $application->add(new DropDatabaseDoctrineCommand()); | 194 | $application->add(new DropDatabaseDoctrineCommand()); |