Makefile 4.5 KB

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