|
1 | 1 | language: node_js
|
2 | 2 | dist: bionic
|
3 | 3 |
|
4 |
| -before_script: | |
5 |
| - yarn build |
6 |
| - node packages/pg/script/create-test-tables.js postgresql:/// |
7 |
| -
|
8 |
| -env: |
9 |
| - - CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres |
10 |
| - |
11 |
| -node_js: |
12 |
| - - lts/dubnium |
13 |
| - - lts/erbium |
14 |
| - # node 13.7 seems to have changed behavior of async iterators exiting early on streams |
15 |
| - # if 13.8 still has this problem when it comes down I'll talk to the node team about the change |
16 |
| - # in the mean time...peg to 13.6 |
17 |
| - - 13.6 |
18 |
| - - 14 |
19 |
| - |
20 | 4 | addons:
|
21 | 5 | postgresql: '10'
|
22 | 6 |
|
23 | 7 | matrix:
|
24 | 8 | include:
|
25 |
| - # Run tests/paths that require password authentication |
26 |
| - - node_js: lts/erbium |
27 |
| - env: |
28 |
| - - CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres PGPASSWORD=test-password SCRAM_TEST_PGUSER=scram_test SCRAM_TEST_PGPASSWORD=test4scram |
29 |
| - before_script: | |
30 |
| - sudo -u postgres sed -i \ |
31 |
| - -e '/^local/ s/trust$/peer/' \ |
32 |
| - -e '/^host/ s/trust$/md5/' \ |
33 |
| - /etc/postgresql/10/main/pg_hba.conf |
34 |
| - sudo -u postgres psql -c "ALTER ROLE postgres PASSWORD 'test-password'; SELECT pg_reload_conf()" |
35 |
| - yarn build |
36 |
| - node packages/pg/script/create-test-tables.js postgresql:/// |
37 |
| - sudo -u postgres -- psql \ |
38 |
| - -c "SET password_encryption = 'scram-sha-256'" \ |
39 |
| - -c "CREATE ROLE scram_test login password 'test4scram'" |
40 |
| -
|
41 |
| - - node_js: lts/carbon |
42 |
| - addons: |
43 |
| - postgresql: '9.5' |
44 |
| - dist: precise |
45 |
| - |
46 |
| - # different PostgreSQL versions on Node LTS |
47 |
| - - node_js: lts/erbium |
48 |
| - addons: |
49 |
| - postgresql: '9.3' |
50 |
| - - node_js: lts/erbium |
51 |
| - addons: |
52 |
| - postgresql: '9.4' |
53 |
| - - node_js: lts/erbium |
54 |
| - addons: |
55 |
| - postgresql: '9.5' |
56 |
| - - node_js: lts/erbium |
57 |
| - addons: |
58 |
| - postgresql: '9.6' |
59 |
| - |
60 |
| - # only run lint on latest Node LTS |
| 9 | + # Run tests/paths with client certificate authentication |
61 | 10 | - node_js: lts/*
|
62 |
| - script: yarn lint |
63 |
| - |
64 |
| - # PostgreSQL 9.2 only works on precise |
65 |
| - - node_js: lts/carbon |
66 |
| - addons: |
67 |
| - postgresql: '9.2' |
68 |
| - dist: precise |
| 11 | + env: |
| 12 | + - CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres |
| 13 | + PGSSLMODE=verify-full |
| 14 | + PGSSLROOTCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-server-ca.crt |
| 15 | + PGSSLCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.crt |
| 16 | + PGSSLKEY=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.key |
| 17 | + PG_CLIENT_CERT_TEST=1 |
| 18 | + before_script: |
| 19 | + - | |
| 20 | + cat <<'travis ci breaks heredoc' | sudo tee -a /etc/postgresql/10/main/postgresql.conf |
| 21 | + ssl = on |
| 22 | + ssl_cert_file = 'test-server.crt' |
| 23 | + ssl_key_file = 'test-server.key' |
| 24 | + ssl_ca_file = 'test-client-ca.crt' |
| 25 | +
|
| 26 | + - printf 'hostssl all all %s cert\n' 127.0.0.1/32 ::1/128 | sudo tee /etc/postgresql/10/main/pg_hba.conf |
| 27 | + - sudo make -C packages/pg/test/tls install DESTDIR=/etc/postgresql/10/main |
| 28 | + - sudo systemctl restart postgresql |
| 29 | + - yarn build |
| 30 | + script: | |
| 31 | + node packages/pg/test/integration/connection-pool/test-tls.js |
| 32 | + node packages/pg/test/integration/connection-pool/test-tls.js native |
0 commit comments