Skip to content

Commit 50ca5fa

Browse files
committed
Works on my machine - adding logging for gh actions
1 parent 71a66dd commit 50ca5fa

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

packages/pg/test/unit/client/password-callback-tests.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const helper = require('./test-helper')
33
const assert = require('assert')
44
const suite = new helper.Suite()
55
const pgpass = require('pgpass')
6+
const fs = require('fs')
67

78
class Wait {
89
constructor() {
@@ -31,7 +32,7 @@ suite.test('password callback is called with conenction params', async function
3132
database: 'bar',
3233
host: 'baz',
3334
password: async () => {
34-
wait.done(1)
35+
wait.done(10)
3536
return 'password'
3637
},
3738
})
@@ -46,15 +47,24 @@ suite.test('password callback is called with conenction params', async function
4647
suite.test('cleartext password auth does not crash with null password using pg-pass', async function () {
4748
process.env.PGPASSFILE = `${__dirname}/pgpass.file`
4849
const wait = new Wait()
50+
console.log()
51+
console.log('hit hit hit')
52+
console.log('PGPASSFILE', process.env.PGPASSFILE)
53+
// check if file exists
54+
if (!fs.existsSync(process.env.PGPASSFILE)) {
55+
throw new Error('PGPASSFILE does not exist')
56+
}
4957
const client = helper.client({
5058
host: 'foo',
5159
port: 5432,
5260
database: 'bar',
5361
user: 'baz',
5462
password: (params) => {
63+
console.log('in password callback')
5564
return new Promise((resolve) => {
5665
pgpass(params, (pass) => {
57-
wait.done(1)
66+
console.log('in pgpass callback. read password:', pass)
67+
wait.done(10)
5868
resolve(pass)
5969
})
6070
})

0 commit comments

Comments
 (0)