.travis.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. dist: trusty
  2. sudo: required
  3. group: deprecated-2017Q4
  4. language: python
  5. python: 2.7
  6. branches:
  7. only:
  8. - master
  9. cache:
  10. yarn: true
  11. directories:
  12. - "${HOME}/virtualenv/python$(python -c 'import platform; print(platform.python_version())')"
  13. - "$NODE_DIR"
  14. - node_modules
  15. - "${HOME}/google-cloud-sdk"
  16. addons:
  17. apt:
  18. update: true
  19. packages:
  20. - libxmlsec1-dev
  21. - libgeoip-dev
  22. chrome: stable
  23. env:
  24. global:
  25. - NODE_ENV=development
  26. - PIP_DISABLE_PIP_VERSION_CHECK=on
  27. - PIP_QUIET=1
  28. - SENTRY_LIGHT_BUILD=1
  29. - SENTRY_SKIP_BACKEND_VALIDATION=1
  30. - SOUTH_TESTS_MIGRATE=1
  31. - DJANGO_VERSION=">=1.6.11,<1.7"
  32. # node's version is pinned by .nvmrc and is autodetected by `nvm install`.
  33. - NODE_DIR="${HOME}/.nvm/versions/node/v$(< .nvmrc)"
  34. - YARN_VERSION="1.13.0"
  35. script:
  36. - make travis-lint-$TEST_SUITE
  37. - make travis-test-$TEST_SUITE
  38. - make travis-scan-$TEST_SUITE
  39. # installing dependencies for after_* steps here ensures they get cached
  40. # since those steps execute after travis runs `store build cache`
  41. - pip install codecov
  42. - npm install -g @zeus-ci/cli
  43. after_success:
  44. - codecov -e TEST_SUITE
  45. after_failure:
  46. - dmesg | tail -n 100
  47. after_script:
  48. - zeus upload -t "text/xml+xunit" .artifacts/*junit.xml
  49. - zeus upload -t "text/xml+coverage" .artifacts/*coverage.xml
  50. - zeus upload -t "text/xml+coverage" .artifacts/coverage/cobertura-coverage.xml
  51. - zeus upload -t "text/html+pytest" .artifacts/*pytest.html
  52. - zeus upload -t "text/plain+pycodestyle" .artifacts/*pycodestyle.log
  53. - zeus upload -t "text/xml+checkstyle" .artifacts/*checkstyle.xml
  54. - zeus upload -t "application/webpack-stats+json" .artifacts/*webpack-stats.json
  55. # each job in the matrix inherits `env/global` and uses everything above,
  56. # but custom `services`, `before_install`, `install`, and `before_script` directives
  57. # may be defined to define and setup individual job environments with more precision.
  58. matrix:
  59. fast_finish: true
  60. include:
  61. # only the sqlite suite runs riak tests
  62. - python: 2.7
  63. env: TEST_SUITE=sqlite DB=sqlite
  64. services:
  65. - memcached
  66. - riak
  67. - redis-server
  68. install:
  69. - python setup.py install_egg_info
  70. - pip install -e ".[dev,tests,optional]"
  71. - python: 2.7
  72. env: TEST_SUITE=postgres DB=postgres
  73. services:
  74. - memcached
  75. - redis-server
  76. - postgresql
  77. install:
  78. - python setup.py install_egg_info
  79. - pip install -e ".[dev,tests,optional]"
  80. before_script:
  81. - psql -c 'create database sentry;' -U postgres
  82. # XXX(markus): Remove after rust interfaces are done
  83. - python: 2.7
  84. env: TEST_SUITE=postgres DB=postgres SENTRY_TEST_USE_RUST_INTERFACE_RENORMALIZATION=1
  85. services:
  86. - memcached
  87. - redis-server
  88. - postgresql
  89. install:
  90. - python setup.py install_egg_info
  91. - pip install -e ".[dev,tests,optional]"
  92. before_script:
  93. - psql -c 'create database sentry;' -U postgres
  94. - python: 2.7
  95. env: TEST_SUITE=mysql DB=mysql
  96. services:
  97. - memcached
  98. - mysql
  99. - redis-server
  100. install:
  101. - python setup.py install_egg_info
  102. - pip install -e ".[dev,tests,optional]"
  103. # 1.3.14 causes test failures. Pinning to 1.3.13 for now, hopefully
  104. # a later release resolves this.
  105. - pip install mysqlclient==1.3.13
  106. before_script:
  107. - mysql -u root -e 'create database sentry;'
  108. - python: 2.7
  109. env: TEST_SUITE=acceptance
  110. services:
  111. - memcached
  112. - redis-server
  113. - postgresql
  114. before_install:
  115. - find "$NODE_DIR" -type d -empty -delete
  116. - nvm install
  117. - npm install -g "yarn@${YARN_VERSION}"
  118. - docker run -d --network host --name clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server:18.14.9
  119. - docker run -d --network host --name snuba --env SNUBA_SETTINGS=test --env CLICKHOUSE_SERVER=localhost:9000 getsentry/snuba
  120. - docker ps -a
  121. install:
  122. - yarn install --pure-lockfile
  123. - python setup.py install_egg_info
  124. - pip install -e ".[dev,tests,optional]"
  125. - wget -N "https://chromedriver.storage.googleapis.com/2.45/chromedriver_linux64.zip" -P ~/
  126. - unzip ~/chromedriver_linux64.zip -d ~/
  127. - rm ~/chromedriver_linux64.zip
  128. - sudo install -m755 ~/chromedriver /usr/local/bin/
  129. before_script:
  130. - psql -c 'create database sentry;' -U postgres
  131. # XXX(markus): Remove after rust interfaces are done
  132. - python: 2.7
  133. env: TEST_SUITE=acceptance SENTRY_TEST_USE_RUST_INTERFACE_RENORMALIZATION=1
  134. services:
  135. - memcached
  136. - redis-server
  137. - postgresql
  138. before_install:
  139. - find "$NODE_DIR" -type d -empty -delete
  140. - nvm install
  141. - npm install -g "yarn@${YARN_VERSION}"
  142. - docker run -d --network host --name clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server:18.14.9
  143. - docker run -d --network host --name snuba --env SNUBA_SETTINGS=test --env CLICKHOUSE_SERVER=localhost:9000 getsentry/snuba
  144. - docker ps -a
  145. install:
  146. - yarn install --pure-lockfile
  147. - python setup.py install_egg_info
  148. - pip install -e ".[dev,tests,optional]"
  149. - wget -N "https://chromedriver.storage.googleapis.com/2.45/chromedriver_linux64.zip" -P ~/
  150. - unzip ~/chromedriver_linux64.zip -d ~/
  151. - rm ~/chromedriver_linux64.zip
  152. - sudo install -m755 ~/chromedriver /usr/local/bin/
  153. before_script:
  154. - psql -c 'create database sentry;' -U postgres
  155. - python: 2.7
  156. env: TEST_SUITE=js
  157. before_install:
  158. - find "$NODE_DIR" -type d -empty -delete
  159. - nvm install
  160. - npm install -g "yarn@${YARN_VERSION}"
  161. install:
  162. - yarn install --pure-lockfile
  163. - python: 2.7
  164. env: TEST_SUITE=cli
  165. services:
  166. - postgresql
  167. - redis-server
  168. install:
  169. - python setup.py install_egg_info
  170. - pip install -e .
  171. before_script:
  172. - psql -c 'create database sentry;' -U postgres
  173. - python: 2.7
  174. env: TEST_SUITE=dist
  175. before_install:
  176. - find "$NODE_DIR" -type d -empty -delete
  177. - nvm install
  178. - npm install -g "yarn@${YARN_VERSION}"
  179. # django 1.8 compatibility
  180. - python: 2.7
  181. env: TEST_SUITE=postgres DJANGO_VERSION=">=1.8,<1.9"
  182. services:
  183. - memcached
  184. - redis-server
  185. - postgresql
  186. install:
  187. - python setup.py install_egg_info
  188. - pip install -e ".[dev,tests,optional]"
  189. before_script:
  190. - psql -c 'create database sentry;' -U postgres
  191. # django 1.8 compatibility with migrations
  192. - python: 2.7
  193. env: TEST_SUITE=postgres DJANGO_VERSION=">=1.8,<1.9" SOUTH_TESTS_MIGRATE=0
  194. services:
  195. - memcached
  196. - redis-server
  197. - postgresql
  198. install:
  199. - python setup.py install_egg_info
  200. - pip install -e ".[dev,tests,optional]"
  201. before_script:
  202. - psql -c 'create database sentry;' -U postgres
  203. # snuba in testing
  204. - python: 2.7
  205. env: TEST_SUITE=snuba SENTRY_TAGSTORE=sentry.tagstore.snuba.SnubaTagStorage SENTRY_ZOOKEEPER_HOSTS=localhost:2181 SENTRY_KAFKA_HOSTS=localhost:9092
  206. services:
  207. - docker
  208. - memcached
  209. - redis-server
  210. - postgresql
  211. before_install:
  212. - docker run -d --network host --name zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 confluentinc/cp-zookeeper:4.1.0
  213. - docker run -d --network host --name kafka -e KAFKA_ZOOKEEPER_CONNECT=localhost:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 confluentinc/cp-kafka:4.1.0
  214. - docker run -d --network host --name clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server:18.14.9
  215. - docker run -d --network host --name snuba --env SNUBA_SETTINGS=test --env CLICKHOUSE_SERVER=localhost:9000 getsentry/snuba
  216. - docker ps -a
  217. install:
  218. - python setup.py install_egg_info
  219. - pip install -e ".[dev,tests,optional]"
  220. - pip install confluent-kafka
  221. before_script:
  222. - psql -c 'create database sentry;' -U postgres
  223. # XXX(markus): Remove after rust interfaces are done
  224. - python: 2.7
  225. env: TEST_SUITE=snuba SENTRY_TAGSTORE=sentry.tagstore.snuba.SnubaTagStorage SENTRY_ZOOKEEPER_HOSTS=localhost:2181 SENTRY_KAFKA_HOSTS=localhost:9092 SENTRY_TEST_USE_RUST_INTERFACE_RENORMALIZATION=1
  226. services:
  227. - docker
  228. - memcached
  229. - redis-server
  230. - postgresql
  231. before_install:
  232. - docker run -d --network host --name zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 confluentinc/cp-zookeeper:4.1.0
  233. - docker run -d --network host --name kafka -e KAFKA_ZOOKEEPER_CONNECT=localhost:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 confluentinc/cp-kafka:4.1.0
  234. - docker run -d --network host --name clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server:18.14.9
  235. - docker run -d --network host --name snuba --env SNUBA_SETTINGS=test --env CLICKHOUSE_SERVER=localhost:9000 getsentry/snuba
  236. - docker ps -a
  237. install:
  238. - python setup.py install_egg_info
  239. - pip install -e ".[dev,tests,optional]"
  240. - pip install confluent-kafka
  241. before_script:
  242. - psql -c 'create database sentry;' -U postgres
  243. # Deploy 'storybook' (component & style guide) - allowed to fail
  244. - language: node_js
  245. env: STORYBOOK_BUILD=1
  246. before_install:
  247. # Decrypt the credentials we added to the repo using the key we added with the Travis command line tool
  248. - openssl aes-256-cbc -K $encrypted_020be61ef175_key -iv $encrypted_020be61ef175_iv -in .travis/storybook-credentials.tar.gz.enc -out credentials.tar.gz -d
  249. # If the SDK is not already cached, download it and unpack it
  250. - if [ ! -d ${HOME}/google-cloud-sdk ]; then curl https://sdk.cloud.google.com | bash; fi
  251. - tar -xzf credentials.tar.gz
  252. # Use the decrypted service account credentials to authenticate the command line tool
  253. - gcloud auth activate-service-account --key-file client-secret.json
  254. - npm install -g "yarn@${YARN_VERSION}"
  255. install:
  256. - yarn install --pure-lockfile
  257. - gcloud version
  258. script: bash .travis/deploy-storybook.sh
  259. after_success: skip
  260. after_failure: skip
  261. # jobs are defined in matrix/include
  262. # to specify which jobs are allowed to fail, match the env exactly in matrix/allow_failures
  263. allow_failures:
  264. - language: node_js
  265. env: STORYBOOK_BUILD=1
  266. # XXX(markus): Remove after rust interfaces are done
  267. - env: TEST_SUITE=postgres DB=postgres SENTRY_TEST_USE_RUST_INTERFACE_RENORMALIZATION=1
  268. notifications:
  269. webhooks:
  270. urls:
  271. - https://zeus.ci/hooks/fa079cf6-8e6b-11e7-9155-0a580a28081c/public/provider/travis/webhook
  272. on_success: always
  273. on_failure: always
  274. on_start: always
  275. on_cancel: always
  276. on_error: always