Makefile 4.4 KB

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