Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Mar 27, 2024
1 parent afae718 commit 143f71e
Show file tree
Hide file tree
Showing 96 changed files with 7 additions and 4,339 deletions.
32 changes: 7 additions & 25 deletions tests/init
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@ function read_sql_file(string $file)
}

require __DIR__ . '/include/config.php';
require __DIR__ . '/swoole_pdo_pgsql/pdo_pgsql.inc';

Swoole\Coroutine\run(function () {
echo "[DB-init] initialization MySQL database...\n";
$mysql = new Swoole\Coroutine\MySQL();
$connected = $mysql->connect([
'host' => MYSQL_SERVER_HOST,
'port' => MYSQL_SERVER_PORT,
'user' => MYSQL_SERVER_USER,
'password' => MYSQL_SERVER_PWD,
'database' => MYSQL_SERVER_DB
]);
$mysql = new mysqli();
$connected = $mysql->connect(MYSQL_SERVER_HOST,
MYSQL_SERVER_USER,
MYSQL_SERVER_PWD,
MYSQL_SERVER_DB,
MYSQL_SERVER_PORT);
if (!$connected) {
echo "[DB-init] Connect failed! Error#{$mysql->connect_errno}: {$mysql->connect_error}\n";
exit(1);
Expand All @@ -60,23 +59,6 @@ Swoole\Coroutine\run(function () {
}
echo "[DB-init] MySQL Done!\n";

echo "[DB-init] initialization PostgreSQL database...\n";
$pgsql = new Swoole\Coroutine\PostgreSQL();
$connected = $pgsql->connect(PGSQL_CONNECTION_STRING);
if (!$connected) {
echo sprintf("[DB-init] Connect failed! Error#%s: %s", $pgsql->error, $pgsql->notices['sqlstate'] ?? ''), PHP_EOL;
exit(1);
}
$sql_file = read_sql_file(__DIR__ . '/pgsql.sql');
foreach ($sql_file as $line) {
if (!$pgsql->query($line)) {
echo sprintf("[DB-init] Failed! Error#%s: %s", $pgsql->error, $pgsql->notices['sqlstate'] ?? ''), PHP_EOL;
exit(1);
}
}
echo "[DB-init] PostgreSQL Done!\n";


echo "[DB-init] initialization ODBC...\n";
echo `set -ex`;

Expand Down
2 changes: 0 additions & 2 deletions tests/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ else
swoole_http_server \
swoole_websocket_server \
swoole_redis_server \
swoole_mysql_coro \
swoole_redis_coro \
swoole_socket_coro \
swoole_runtime"
if [ ${#} -gt 1 ]; then
Expand Down
29 changes: 0 additions & 29 deletions tests/swoole_mysql_coro/abandon_prepare_dtor.phpt

This file was deleted.

25 changes: 0 additions & 25 deletions tests/swoole_mysql_coro/aborted_clients.phpt

This file was deleted.

51 changes: 0 additions & 51 deletions tests/swoole_mysql_coro/another_coroutine.phpt

This file was deleted.

75 changes: 0 additions & 75 deletions tests/swoole_mysql_coro/bc_fetchAll.phpt

This file was deleted.

39 changes: 0 additions & 39 deletions tests/swoole_mysql_coro/bc_sync_properties.phpt

This file was deleted.

38 changes: 0 additions & 38 deletions tests/swoole_mysql_coro/big_data.phpt

This file was deleted.

72 changes: 0 additions & 72 deletions tests/swoole_mysql_coro/bug_0814.phpt

This file was deleted.

Loading

0 comments on commit 143f71e

Please sign in to comment.