Makefile 4.4 KB

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