test: add detailed connection testing with connection string
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 6m15s
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 6m15s
This commit is contained in:
parent
b2706bc747
commit
03f615bf57
@ -21,8 +21,10 @@ spec:
|
||||
echo "POSTGRES_HOSTNAME: $POSTGRES_HOSTNAME"
|
||||
echo "POSTGRES_PORT: $POSTGRES_PORT"
|
||||
echo "POSTGRES_USER: $POSTGRES_USER"
|
||||
echo "Testing direct connection..."
|
||||
echo "Testing direct connection with psql..."
|
||||
PGPASSWORD=$POSTGRES_PASSWORD psql -h $POSTGRES_HOSTNAME -p $POSTGRES_PORT -U $POSTGRES_USER -d $POSTGRES_NAME -c "SELECT 1"
|
||||
echo "Testing direct connection with connection string..."
|
||||
PGPASSWORD=$POSTGRES_PASSWORD psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOSTNAME:$POSTGRES_PORT/$POSTGRES_NAME" -c "SELECT 1"
|
||||
echo "Testing MikroORM connection..."
|
||||
node -e "
|
||||
const { PostgreSqlDriver } = require('@mikro-orm/postgresql');
|
||||
@ -34,8 +36,11 @@ spec:
|
||||
port: parseInt(process.env.POSTGRES_PORT),
|
||||
user: process.env.POSTGRES_USER,
|
||||
password: process.env.POSTGRES_PASSWORD,
|
||||
driverOptions: {
|
||||
connectionString: \`postgresql://\${process.env.POSTGRES_USER}:\${process.env.POSTGRES_PASSWORD}@\${process.env.POSTGRES_HOSTNAME}:\${process.env.POSTGRES_PORT}/\${process.env.POSTGRES_NAME}\`
|
||||
}
|
||||
};
|
||||
console.log('MikroORM config:', config);
|
||||
console.log('MikroORM config:', JSON.stringify(config, null, 2));
|
||||
MikroORM.init(config).then(orm => {
|
||||
console.log('Connected successfully!');
|
||||
orm.close();
|
||||
|
Loading…
Reference in New Issue
Block a user