mirror of
https://github.com/pelican-dev/panel.git
synced 2026-05-04 18:00:48 +03:00
Simplify testing process for integration tests, don't require second connection
This commit is contained in:
@@ -22,9 +22,10 @@ $kernel->bootstrap();
|
||||
|
||||
$output = new ConsoleOutput();
|
||||
|
||||
if (config('database.default') !== 'testing') {
|
||||
$prefix = 'database.connections.' . config('database.default');
|
||||
if (config("$prefix.database") !== 'panel_test') {
|
||||
$output->writeln(PHP_EOL . '<error>Cannot run test process against non-testing database.</error>');
|
||||
$output->writeln(PHP_EOL . '<error>Environment is currently pointed at: "' . config('database.default') . '".</error>');
|
||||
$output->writeln(PHP_EOL . '<error>Environment is currently pointed at: "' . config("$prefix.database") . '".</error>');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -34,10 +35,10 @@ if (config('database.default') !== 'testing') {
|
||||
*/
|
||||
if (!env('SKIP_MIGRATIONS')) {
|
||||
$output->writeln(PHP_EOL . '<info>Refreshing database for Integration tests...</info>');
|
||||
$kernel->call('migrate:fresh', ['--database' => 'testing']);
|
||||
$kernel->call('migrate:fresh');
|
||||
|
||||
$output->writeln('<info>Seeding database for Integration tests...</info>' . PHP_EOL);
|
||||
$kernel->call('db:seed', ['--database' => 'testing']);
|
||||
$kernel->call('db:seed');
|
||||
} else {
|
||||
$output->writeln(PHP_EOL . '<comment>Skipping database migrations...</comment>' . PHP_EOL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user