Skip to content

Commit ae3f13f

Browse files
charmanderbrianc
authored andcommitted
Fix tests skipped because of missing suffixes (#2071)
* Fix tests skipped because of missing suffixes Mocha will happen eventually! * Skip password tests when they can’t work Will be made more visible when tests are ported to Mocha. * Add testing with a user with a password to CI Should reveal a bug in the password enumerability work, I think. * Explain new CI matrix entry for password authentication [ci skip]
1 parent 5cf8f5f commit ae3f13f

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

Diff for: .travis.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: node_js
22
dist: bionic
33

4-
before_script:
5-
- node packages/pg/script/create-test-tables.js pg://[email protected]:5432/postgres
4+
before_script: |
5+
node packages/pg/script/create-test-tables.js postgresql:///
66
77
env:
88
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres
@@ -17,6 +17,18 @@ addons:
1717

1818
matrix:
1919
include:
20+
# Run tests/paths that require password authentication
21+
- node_js: lts/erbium
22+
env:
23+
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres PGPASSWORD=test-password
24+
before_script: |
25+
sudo -u postgres sed -i \
26+
-e '/^local/ s/trust$/peer/' \
27+
-e '/^host/ s/trust$/md5/' \
28+
/etc/postgresql/10/main/pg_hba.conf
29+
sudo -u postgres psql -c "ALTER ROLE postgres PASSWORD 'test-password'; SELECT pg_reload_conf()"
30+
node packages/pg/script/create-test-tables.js postgresql:///
31+
2032
- node_js: lts/carbon
2133
addons:
2234
postgresql: "9.5"

Diff for: packages/pg/test/integration/connection/dynamic-password.js renamed to packages/pg/test/integration/connection/dynamic-password-tests.js

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ const Client = pg.Client;
88
const password = process.env.PGPASSWORD || null
99
const sleep = millis => new Promise(resolve => setTimeout(resolve, millis))
1010

11+
if (!password) {
12+
// skip these tests; no password will be requested
13+
return
14+
}
15+
1116
suite.testAsync('Get password from a sync function', () => {
1217
let wasCalled = false
1318
function getPassword() {

0 commit comments

Comments
 (0)