.travis.yml 11 KB

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