Makefile 4.7 KB

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