diff --git a/.travis.yml b/.travis.yml index 03849285a..61a7a79af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: node_js dist: bionic -before_script: - - node packages/pg/script/create-test-tables.js pg://postgres@127.0.0.1:5432/postgres +before_script: | + node packages/pg/script/create-test-tables.js postgresql:/// env: - CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres @@ -17,6 +17,18 @@ addons: matrix: include: + # Run tests/paths that require password authentication + - node_js: lts/erbium + env: + - CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres PGPASSWORD=test-password + before_script: | + sudo -u postgres sed -i \ + -e '/^local/ s/trust$/peer/' \ + -e '/^host/ s/trust$/md5/' \ + /etc/postgresql/10/main/pg_hba.conf + sudo -u postgres psql -c "ALTER ROLE postgres PASSWORD 'test-password'; SELECT pg_reload_conf()" + node packages/pg/script/create-test-tables.js postgresql:/// + - node_js: lts/carbon addons: postgresql: "9.5" diff --git a/packages/pg/test/integration/connection/dynamic-password.js b/packages/pg/test/integration/connection/dynamic-password-tests.js similarity index 97% rename from packages/pg/test/integration/connection/dynamic-password.js rename to packages/pg/test/integration/connection/dynamic-password-tests.js index ebda433c1..20b509533 100644 --- a/packages/pg/test/integration/connection/dynamic-password.js +++ b/packages/pg/test/integration/connection/dynamic-password-tests.js @@ -8,6 +8,11 @@ const Client = pg.Client; const password = process.env.PGPASSWORD || null const sleep = millis => new Promise(resolve => setTimeout(resolve, millis)) +if (!password) { + // skip these tests; no password will be requested + return +} + suite.testAsync('Get password from a sync function', () => { let wasCalled = false function getPassword() { diff --git a/packages/pg/test/unit/client/set-keepalives.js b/packages/pg/test/unit/client/set-keepalives-tests.js similarity index 100% rename from packages/pg/test/unit/client/set-keepalives.js rename to packages/pg/test/unit/client/set-keepalives-tests.js