forked from timescale/timescaledb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
245 lines (226 loc) · 13.2 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
sudo: required
language: c
os:
- linux
services:
- docker
env:
global:
- secure: "TurskgAodG44RKCUPfoUb4JlT+UZwaPjUN73MS4+2ED2ayf46iUpcMODovDf7CPQRriMAvii/5xQ9UWTGYZejJy/Si3aE0fQeSKHIOPmuHqmmBkC3jgK9A5vOMpaAwljSNvIAMfwhIjVsq87nyvxHYWReDWl5SrdxTvh91RJvOiMRNdqwBbnj2j1cC30783ICGZUazrUyhDDnXispyBJYFxlHJmQJpfs6428dTRNJY/X8nVDXFwQkRjlIXarquTsrifCfzdq40Ykb8/1CS0295R8/kdKamQqXM0aS7iIkw3JFmZIz08OHKc7wcJuv6KSnCfNSftJqy2+nb1gkyIqkr3mrpYUa+2tKVwpA6OfET2S2kC5B3bOTcyBgihhnivAOS9zG8PTouLSUzqZzo+H893xdaMlX4kX3oOrOqzbj8YvTw6Dgw8PWERfnOngpKmKJFb8yboXPmGY7luSVxOplnPnYO0jaAXPU4ESsFYL3EBG5Zo4rVIuA5g7aJ0Ex+e5GQWiHDM1ubUo2vcuVVlurs/Aj8eSpNhqo0S5MjI05Jcz82X+9+asFcP+QV81UrueiXTlQ/7buAyMyVtKOgOhZwR4ImA1zzWkJjNNbZMJqeO9tPEgU7IxrqLhMgIpBB/pn0gzJZ8LN7C2oyznMYGzS5lrYaavojFUViv8vFyAQ24="
- secure: "S8WfPsrVGg21vZPxjrmy1X19T7zpHNgaSAoqYGzJdDZcNYuZbI87+tP3VQZo4MxjP3Ag46zTI5K+6aMjCqYqFGKufZdEaSpPSLmppFbXALgSp/rOkzp1M9HhGj0QVP7QcoPbva5Bjnj3zVi9CMAo6MwtnGAvzqBLOsdtnXTxEmKYyeNgwUVbQi2nzO38GeLgabaFL4XD3f3bmHE5jG6QAwZ/L7+jajsD1biH4sOiRLCRshtvermtYxh3SK6rML2kiwATABxTd1xDdMVRO/llmDBN373tHK6mufJyIhrwG9oTprSSDDIJlEbSPCkH0uvJBGcDvOAWf9tr4TGs/beawx3ELcXqR/4EisFqvMiVL4Vpt1gMBg9gue4Y0wpHZYoBOOef2gFtuyL7PjYe9koYJAJxg9DJ29DMxIjuCLTnbHN6yLa9425pdvxcuNEJ2K2zD0ZWoLSVueL0MxLhOZJsqlMkmmrFyI7y5cj1XvJF3vcsa5yK3S7sXroKUzeLu6QMh8hO3jD/2IvdQJ7Huy5uiJk2a+KUceLzruxLbwPF4b8SEoTquJ9NFGtagCG77lbIbLltLs2fUf+JnM8ipdpoMibVRFBOahP8NZwpL/NFzG3WLH3tDncj/c3fneMiNv3FUHLf6ufOVOayQiAEidszcMct2R20qIxggXKymrjZA3k="
before_install:
# We need the PostgreSQL source for running the standard PostgreSQL
# regression tests
- git clone --branch ${PG_GIT_TAG} --depth 1 https://github.com/postgres/postgres.git /tmp/postgres
- docker run -d --name pgbuild -v ${TRAVIS_BUILD_DIR}:/build -v /tmp/postgres:/postgres postgres:${PG_VERSION}-alpine
install:
- docker exec -it pgbuild /bin/sh -c "apk add --no-cache --virtual .build-deps coreutils dpkg-dev gcc libc-dev make util-linux-dev diffutils cmake bison flex curl git openssl-dev && mkdir -p /build/debug /build/debug-nossl"
- docker exec -it pgbuild /bin/sh -c "apk add --no-cache --virtual --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted lcov"
# We set /usr/local as prefix so the regression tools will be able to find
# initdb, psql, and postgres
- docker exec -it pgbuild /bin/sh -c "cd /postgres && ./configure --prefix=/usr/local --enable-coverage --enable-debug --enable-cassert --without-readline --without-zlib"
# We only need to build the regress and isolation stuff
- docker exec -it pgbuild /bin/sh -c "make -C /postgres/src/test/regress"
- docker exec -it pgbuild /bin/sh -c "make -C /postgres/src/test/isolation"
# First build without OpenSSL
- docker exec -it pgbuild /bin/sh -c "cd /build/debug-nossl && CFLAGS=-Werror cmake .. -DCMAKE_BUILD_TYPE=Debug -DUSE_OPENSSL=false -DPG_SOURCE_DIR=/postgres && make install"
# Now build with OpenSSL
- docker exec -it pgbuild /bin/sh -c "cd /build/debug && CFLAGS=-Werror cmake .. -DCMAKE_BUILD_TYPE=Debug -DUSE_OPENSSL=true -DENABLE_CODECOVERAGE=TRUE -DPG_SOURCE_DIR=/postgres ${ADDITIONAL_CMAKE_FLAGS:-} && make install"
# Ensure postgres user has permissions
- docker exec -it pgbuild /bin/bash -c "chown -R postgres:postgres /build/"
script:
- docker exec -it pgbuild /bin/bash -c "chown -R postgres:postgres /postgres/"
# First run only telemetry test to see that it works without OpenSSL
- docker exec -u postgres -it pgbuild /bin/sh -c "make -C /build/debug-nossl installcheck TESTS=telemetry PG_REGRESS_OPTS='--temp-instance=/tmp/pgdata'"
# Now run all tests
- docker exec -u postgres -it pgbuild /bin/sh -c "make -C /build/debug installcheck PG_REGRESS_OPTS='--temp-instance=/tmp/pgdata'"
- docker exec -u postgres -it pgbuild /bin/sh -c "make -C /build/debug pginstallcheck PG_REGRESS_OPTS='--temp-instance=/tmp/pgdata'"
- ci_env=`bash <(curl -s https://codecov.io/env)`
- docker exec -it $ci_env pgbuild /bin/bash -c "cd /build/debug && bash <(curl -s https://codecov.io/bash) || echo \"Codecov did not collect coverage reports\" "
after_failure:
- docker exec -it pgbuild cat /build/debug/test/regression.diffs /build/debug/test/pgtest/regressions.diffs
after_script:
- docker rm -f pgbuild
jobs:
include:
# This tests the formatting of a PR.
- if: (type = pull_request) OR (type = cron) OR NOT (branch = master)
stage: test
name: "pgindent and license check"
env:
- PG_VERSION=10.2 PG_GIT_TAG=REL_10_2 ADDITIONAL_CMAKE_FLAGS="-DUSE_DEFAULT_VISIBILITY=1"
before_install:
- git clone --branch ${PG_GIT_TAG} --depth 1 https://github.com/postgres/postgres.git /tmp/postgres
- docker run -d --name pgbuild -v ${TRAVIS_BUILD_DIR}:/build -v /tmp/postgres:/postgres timescaledev/pgindent:10-alpine
after_failure:
- docker exec -it pgbuild /bin/bash -c 'diff -r /build/src /tmp/timescale_src'
- docker exec -it pgbuild /bin/bash -c 'diff -r /build/test/src /tmp/timescale_test_src'
script:
- docker exec -it pgbuild /bin/bash -c 'cp -R /build/src/ /tmp/timescale_src && cp -R /build/test/src/ /tmp/timescale_test_src'
- docker exec -it pgbuild /bin/bash -c 'cd /build/debug && make pgindent'
- docker exec -it pgbuild /bin/bash -c 'diff -r -q /build/src /tmp/timescale_src'
- docker exec -it pgbuild /bin/bash -c 'diff -r -q /build/test/src /tmp/timescale_test_src'
- docker exec -it pgbuild /bin/bash -c 'cd /build/debug && make licensecheck'
- "test -z \"`./build/scripts/export_prefix_check.sh`\" || (echo \"functions missing 'ts_' prefix or should be static\"; ./build/scripts/export_prefix_check.sh; exit 1)"
- if: (type = pull_request) OR (type = cron) OR NOT (branch = master)
stage: test
name: "Regression 9.6"
env: PG_VERSION=9.6.6 PG_GIT_TAG=REL9_6_6
- if: (type = pull_request) OR (type = cron) OR NOT (branch = master)
stage: test
name: "Regression 10"
env: PG_VERSION=10.2 PG_GIT_TAG=REL_10_2
- if: (type = pull_request) OR (type = cron) OR NOT (branch = master)
stage: test
name: "Regression 11"
env: PG_VERSION=11.0 PG_GIT_TAG=REL_11_0
# This tests the ability to upgrade to the latest version from versions without constraint support
- if: (type = pull_request) OR (type = cron)
stage: test
env: PG_VERSION=9.6.6 PG_GIT_TAG=REL9_6_6
name: "Update tests (versions w/o constraints support) 9.6"
before_install:
install:
after_failure:
after_script:
script:
- bash -x ./scripts/test_updates_no_constraints.sh
# This tests the ability to upgrade to the latest version from versions with constraint support
- if: (type = pull_request) OR (type = cron)
stage: test
env: PG_VERSION=9.6.6 PG_GIT_TAG=REL9_6_6
name: "Update tests (versions w/ constraints support) 9.6"
before_install:
install:
after_failure:
after_script:
script:
- bash -x ./scripts/test_updates_with_constraints.sh
- if: type = cron
stage: test
name: "ABI breakage smoketest 9.6"
before_install:
install:
after_failure:
after_script:
script:
# Version >= 9.6.3 is required by TimescaleDB
- PG_MAJOR=9.6 PG_MINOR_COMPILE=3 bash -x ./scripts/docker-run-abi-test.sh
- if: type = cron
stage: test
name: "ABI breakage smoketest 10"
before_install:
install:
after_failure:
after_script:
script:
# There is a breakage of ABI between 10.1->10.2 so test starting at 10.2
- PG_MAJOR=10 PG_MINOR_COMPILE=2 bash -x ./scripts/docker-run-abi-test.sh
- if: type = cron
stage: test
name: "ABI breakage smoketest 11"
before_install:
install:
after_failure:
after_script:
script:
- PG_MAJOR=11 PG_MINOR_COMPILE=0 bash -x ./scripts/docker-run-abi-test.sh
# Memory spike test when running out of order random inserts into timescaledb database
- if: (type = cron) OR (branch = prerelease_test)
stage: test
name: "Memory leak on insert tests"
before_install:
install:
after_failure:
after_script:
env:
- PG_VERSION=10.2 PG_GIT_TAG=REL_10_2
before_script:
- git clone --progress --verbose https://$USR:$PASSWORD@bitbucket.org/440-labs/tsdb-dev-tools.git /tmp/tsdb-dev-tools
script:
- bash ./scripts/docker-run-memory-test.sh
# Valgrind test #1 : first 40 excluding plan_hashagg_optimized* and plan_hashagg_results*
- if: (branch = prerelease_test)
stage: test
name: "Valgrind test #1"
before_install:
install:
after_failure:
before_script:
# clone valgrind test script
- git clone https://$USR:$PASSWORD@bitbucket.org/440-labs/tsdb-dev-tools.git /tmp/tsdb-dev-tools
- bash -c 'while true; do echo -e "keepalive\n"; sleep 60; done' & # print line every 60 minutes to avoid Travis timeout
script:
# TEST_MAX specifies the maximum test # to go up to
- cd /tmp/tsdb-dev-tools; USE_REMOTE=true TIMESCALE_DIR=$TRAVIS_BUILD_DIR TEST_MAX=35 EXCLUDE_PATTERN='plan_hashagg_optimized*|plan_hashagg_results*' bash ./test_valgrind.sh
after_script:
- kill $(jobs -p) # kill job that prints repeatedly
# Valgrind test #2: tests matching plan_hashagg_optimized*
- if: (branch = prerelease_test)
stage: test
name: "Valgrind test #2"
before_install:
install:
after_failure:
before_script:
# clone valgrind test script
- git clone https://$USR:$PASSWORD@bitbucket.org/440-labs/tsdb-dev-tools.git /tmp/tsdb-dev-tools
- bash -c 'while true; do echo -e "keepalive\n"; sleep 60; done' & # print line every 60 minutes to avoid Travis timeout
script:
# TEST_MAX specifies the maximum test # to go up to
- cd /tmp/tsdb-dev-tools; USE_REMOTE=true TIMESCALE_DIR=$TRAVIS_BUILD_DIR INCLUDE_PATTERN='plan_hashagg_optimized*' bash ./test_valgrind.sh
after_script:
- kill $(jobs -p) # kill job that prints repeatedly
# Valgrind test #3: tests matching plan_hashagg_results*
- if: (branch = prerelease_test)
stage: test
name: "Valgrind test #3"
before_install:
install:
after_failure:
before_script:
# clone valgrind test script
- git clone https://$USR:$PASSWORD@bitbucket.org/440-labs/tsdb-dev-tools.git /tmp/tsdb-dev-tools
- bash -c 'while true; do echo -e "keepalive\n"; sleep 60; done' & # print line every 60 minutes to avoid Travis timeout
script:
# TEST_MAX specifies the maximum test # to go up to
- cd /tmp/tsdb-dev-tools; USE_REMOTE=true TIMESCALE_DIR=$TRAVIS_BUILD_DIR INCLUDE_PATTERN='plan_hashagg_results*' bash ./test_valgrind.sh
after_script:
- kill $(jobs -p) # kill job that prints repeatedly
# Valgrind test #4 : tests from #41 to end excluding plan_hashagg_optimized* and plan_hashagg_results*
- if: (branch = prerelease_test)
stage: test
name: "Valgrind test #4"
before_install:
install:
after_failure:
before_script:
# clone valgrind test script
- git clone https://$USR:$PASSWORD@bitbucket.org/440-labs/tsdb-dev-tools.git /tmp/tsdb-dev-tools
- bash -c 'while true; do echo -e "keepalive\n"; sleep 60; done' & # print line every 60 minutes to avoid Travis timeout
script:
# TEST_MIN specifies the minimum test # to go start from
- cd /tmp/tsdb-dev-tools; USE_REMOTE=true TIMESCALE_DIR=$TRAVIS_BUILD_DIR TEST_MIN=36 EXCLUDE_PATTERN='plan_hashagg_optimized*|plan_hashagg_results*' bash ./test_valgrind.sh
after_script:
- kill $(jobs -p) # kill job that prints repeatedly
# Coverity test
- if: (branch = prerelease_test) OR (branch = coverity_scan)
stage: test
name: "Coverity"
env:
- secure: "jy4DQH2syPR2v13igCNPTr044h3H/ilbJk6FifDMxGZVrOZR0dnkBx3O7qJMQOkEQvNxKsoq41k6HCP16qcgt4+HjxhcZonz5hKIiF8IpcB9r+TIlZunNTx7HjSNFZ3WCnham4AvMEthBHgAttRUhscy39ELCNUEobKS/youi7OHLOEXXShc84yTh3aSuGR3SnDVK1diLN5ufX6tN20pc3QvLMGZmA/jmJFcIQHGilhWGwwiJ45LSLwM9slvgGKbTM/K6btVBMOUnjM0h5WqPjRjDUL2tF+iZLEIpY8lFN/MQCnj0vP/BryDdoVPZS3TDQYwYuvASevQ4sOmULnM770jFqzClq4zkeM2GhMq67aYMmXjblu/qcLeCjZL+vfjMKpBMUydK/bCb097HvdRWDEPA0zItKWX9Kd6lVf2XbJCCh0ljp5REJEyk+plJ2V12nLpOPwY6zTtzcoTxEN6wcvUJfHAdNovpp63hWTnbAbEZamIdxwyCqpzThDobeD354TeXFUaKvrUw00iAiIhGL2QvwapaCbhlwM6NQAmdU3tMy3nZpka6bRI1kjyTh7CXfdwXV98ZJSiPdUFxyIgFNI2dKiL3BI1pvFDfq3mnmi3WqzZHCaQqDKNEtUrzxC40swIJGLcLUiqc5xX37P47jNDWrNIRDs8IdbM0tS9pFM="
before_install:
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
- sudo apt-get install -y postgresql-9.6 postgresql-client-9.6 postgresql-contrib-9.6 postgresql-server-dev-9.6 cmake3
install: echo "Success"
script: echo "Success"
addons:
postgresql: "9.6"
coverity_scan:
project:
name: "timescale/timescaledb"
description: "TimescaledDB an open-source time-series DB"
notification_email: ci@timescale.com
build_command_prepend: "./bootstrap -DCMAKE_BUILD_TYPE=Debug && cd build"
build_command: "make"
branch_pattern: coverity_scan|prerelease_test