Makefile 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. PIP := python -m pip --disable-pip-version-check
  2. WEBPACK := yarn build-acceptance
  3. bootstrap \
  4. develop \
  5. clean \
  6. init-config \
  7. run-dependent-services \
  8. drop-db \
  9. create-db \
  10. apply-migrations \
  11. reset-db \
  12. setup-git \
  13. node-version-check \
  14. install-js-dev \
  15. install-py-dev :
  16. @./scripts/do.sh $@
  17. build-platform-assets \
  18. direnv-help \
  19. upgrade-pip \
  20. setup-git-config :
  21. @SENTRY_NO_VENV_CHECK=1 ./scripts/do.sh $@
  22. setup-pyenv:
  23. @./scripts/pyenv_setup.sh
  24. build-js-po: node-version-check
  25. mkdir -p build
  26. SENTRY_EXTRACT_TRANSLATIONS=1 $(WEBPACK)
  27. build: locale
  28. merge-locale-catalogs: build-js-po
  29. $(PIP) install Babel
  30. cd src/sentry && sentry django makemessages -i static -l en
  31. ./bin/merge-catalogs en
  32. compile-locale:
  33. ./bin/find-good-catalogs src/sentry/locale/catalogs.json
  34. cd src/sentry && sentry django compilemessages
  35. locale: merge-locale-catalogs compile-locale
  36. sync-transifex: merge-locale-catalogs
  37. $(PIP) install transifex-client
  38. tx push -s
  39. tx pull -a
  40. update-transifex: sync-transifex compile-locale
  41. build-chartcuterie-config:
  42. @echo "--> Building chartcuterie config module"
  43. yarn build-chartcuterie-config
  44. fetch-release-registry:
  45. @echo "--> Fetching release registry"
  46. @echo "from sentry.utils.distutils import sync_registry; sync_registry()" | sentry exec
  47. run-acceptance:
  48. @echo "--> Running acceptance tests"
  49. pytest tests/acceptance --cov . --cov-report="xml:.artifacts/acceptance.coverage.xml" --junit-xml=".artifacts/acceptance.junit.xml"
  50. @echo ""
  51. test-cli:
  52. @echo "--> Testing CLI"
  53. rm -rf test_cli
  54. mkdir test_cli
  55. cd test_cli && sentry init test_conf
  56. cd test_cli && sentry --config=test_conf help
  57. cd test_cli && sentry --config=test_conf upgrade --traceback --noinput
  58. cd test_cli && sentry --config=test_conf export
  59. rm -r test_cli
  60. @echo ""
  61. test-js-build: node-version-check
  62. @echo "--> Running type check"
  63. @yarn run tsc -p config/tsconfig.build.json
  64. @echo "--> Building static assets"
  65. @NODE_ENV=production yarn webpack-profile > .artifacts/webpack-stats.json
  66. test-js: node-version-check
  67. @echo "--> Running JavaScript tests"
  68. @yarn run test
  69. @echo ""
  70. test-js-ci: node-version-check
  71. @echo "--> Running CI JavaScript tests"
  72. @yarn run test-ci
  73. @echo ""
  74. test-python:
  75. @echo "--> Running Python tests"
  76. # This gets called by getsentry
  77. pytest tests/integration tests/sentry
  78. test-python-ci:
  79. make build-platform-assets
  80. @echo "--> Running CI Python tests"
  81. pytest tests/integration tests/sentry --cov . --cov-report="xml:.artifacts/python.coverage.xml" --junit-xml=".artifacts/python.junit.xml" || exit 1
  82. @echo ""
  83. test-snuba:
  84. @echo "--> Running snuba tests"
  85. pytest tests/snuba tests/sentry/eventstream/kafka tests/sentry/snuba/test_discover.py -vv --cov . --cov-report="xml:.artifacts/snuba.coverage.xml" --junit-xml=".artifacts/snuba.junit.xml"
  86. @echo ""
  87. backend-typing:
  88. @echo "--> Running Python typing checks"
  89. mypy --strict --warn-unreachable --config-file mypy.ini
  90. @echo ""
  91. test-symbolicator:
  92. @echo "--> Running symbolicator tests"
  93. pytest tests/symbolicator -vv --cov . --cov-report="xml:.artifacts/symbolicator.coverage.xml" --junit-xml=".artifacts/symbolicator.junit.xml"
  94. @echo ""
  95. test-chartcuterie:
  96. @echo "--> Running chartcuterie tests"
  97. pytest tests/chartcuterie -vv --cov . --cov-report="xml:.artifacts/chartcuterie.coverage.xml" --junit-xml=".artifacts/chartcuterie.junit.xml"
  98. @echo ""
  99. test-acceptance: node-version-check
  100. @echo "--> Building static assets"
  101. @$(WEBPACK)
  102. make run-acceptance
  103. test-plugins:
  104. @echo "--> Running plugin tests"
  105. pytest tests/sentry_plugins -vv --cov . --cov-report="xml:.artifacts/plugins.coverage.xml" --junit-xml=".artifacts/plugins.junit.xml" || exit 1
  106. @echo ""
  107. test-relay-integration:
  108. @echo "--> Running Relay integration tests"
  109. pytest tests/relay_integration -vv
  110. @echo ""
  111. test-api-docs:
  112. @echo "--> Generating testing api doc schema"
  113. yarn run build-derefed-docs
  114. @echo "--> Validating endpoints' examples against schemas"
  115. yarn run validate-api-examples
  116. pytest tests/apidocs/endpoints
  117. @echo ""
  118. review-python-snapshots:
  119. @cargo insta --version &> /dev/null || cargo install cargo-insta
  120. @cargo insta review --workspace-root `pwd` -e pysnap
  121. accept-python-snapshots:
  122. @cargo insta --version &> /dev/null || cargo install cargo-insta
  123. @cargo insta accept --workspace-root `pwd` -e pysnap
  124. reject-python-snapshots:
  125. @cargo insta --version &> /dev/null || cargo install cargo-insta
  126. @cargo insta reject --workspace-root `pwd` -e pysnap
  127. lint-js:
  128. @echo "--> Linting javascript"
  129. bin/lint --js --parseable
  130. @echo ""
  131. .PHONY: build