mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
* Test client certificate authentication * Forward options’ ssl.key even when non-enumerable
101 lines
3.3 KiB
YAML
101 lines
3.3 KiB
YAML
language: node_js
|
|
dist: bionic
|
|
|
|
before_script: |
|
|
yarn build
|
|
node packages/pg/script/create-test-tables.js postgresql:///
|
|
|
|
env:
|
|
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres
|
|
|
|
node_js:
|
|
- lts/dubnium
|
|
- lts/erbium
|
|
# node 13.7 seems to have changed behavior of async iterators exiting early on streams
|
|
# if 13.8 still has this problem when it comes down I'll talk to the node team about the change
|
|
# in the mean time...peg to 13.6
|
|
- 13.6
|
|
- 14
|
|
|
|
addons:
|
|
postgresql: '10'
|
|
|
|
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 SCRAM_TEST_PGUSER=scram_test SCRAM_TEST_PGPASSWORD=test4scram
|
|
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()"
|
|
yarn build
|
|
node packages/pg/script/create-test-tables.js postgresql:///
|
|
sudo -u postgres -- psql \
|
|
-c "SET password_encryption = 'scram-sha-256'" \
|
|
-c "CREATE ROLE scram_test login password 'test4scram'"
|
|
|
|
- node_js: lts/carbon
|
|
addons:
|
|
postgresql: '9.5'
|
|
dist: precise
|
|
|
|
# Run tests/paths with client certificate authentication
|
|
- node_js: lts/*
|
|
env:
|
|
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres
|
|
PGSSLMODE=verify-full
|
|
PGSSLROOTCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-server-ca.crt
|
|
PGSSLCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.crt
|
|
PGSSLKEY=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.key
|
|
PG_CLIENT_CERT_TEST=1
|
|
before_script:
|
|
- chmod go= packages/pg/test/tls/test-client.key
|
|
- |
|
|
sudo sed -i \
|
|
-e '/^ssl_cert_file =/d' \
|
|
-e '/^ssl_key_file =/d' \
|
|
/etc/postgresql/10/main/postgresql.conf
|
|
|
|
cat <<'travis ci breaks heredoc' | sudo tee -a /etc/postgresql/10/main/postgresql.conf > /dev/null
|
|
ssl_cert_file = 'test-server.crt'
|
|
ssl_key_file = 'test-server.key'
|
|
ssl_ca_file = 'test-client-ca.crt'
|
|
|
|
- printf 'hostssl all all %s cert\n' 127.0.0.1/32 ::1/128 | sudo tee /etc/postgresql/10/main/pg_hba.conf > /dev/null
|
|
- sudo make -C packages/pg/test/tls install DESTDIR=/var/ramfs/postgresql/10/main
|
|
- sudo systemctl restart postgresql@10-main
|
|
- yarn build
|
|
script:
|
|
- cd packages/pg
|
|
- node test/integration/connection-pool/tls-tests.js
|
|
- npm install --no-save pg-native
|
|
- node test/integration/connection-pool/tls-tests.js native
|
|
|
|
# different PostgreSQL versions on Node LTS
|
|
- node_js: lts/erbium
|
|
addons:
|
|
postgresql: '9.3'
|
|
- node_js: lts/erbium
|
|
addons:
|
|
postgresql: '9.4'
|
|
- node_js: lts/erbium
|
|
addons:
|
|
postgresql: '9.5'
|
|
- node_js: lts/erbium
|
|
addons:
|
|
postgresql: '9.6'
|
|
|
|
# only run lint on latest Node LTS
|
|
- node_js: lts/*
|
|
script: yarn lint
|
|
|
|
# PostgreSQL 9.2 only works on precise
|
|
- node_js: lts/carbon
|
|
addons:
|
|
postgresql: '9.2'
|
|
dist: precise
|