snuba-integration-test.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. name: snuba integration
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - releases/**
  7. pull_request:
  8. jobs:
  9. test:
  10. name: snuba test
  11. runs-on: ubuntu-18.04
  12. timeout-minutes: 30
  13. strategy:
  14. matrix:
  15. python-version: [3.8.12]
  16. # XXX: When updating this, make sure you also update MATRIX_INSTANCE_TOTAL.
  17. instance: [0, 1]
  18. env:
  19. # XXX: MATRIX_INSTANCE_TOTAL must be hardcoded to the length of strategy.matrix.instance.
  20. MATRIX_INSTANCE_TOTAL: 2
  21. USE_SNUBA: 1
  22. MIGRATIONS_TEST_MIGRATE: 1
  23. steps:
  24. - uses: actions/checkout@v2
  25. with:
  26. # Avoid codecov error message related to SHA resolution:
  27. # https://github.com/codecov/codecov-bash/blob/7100762afbc822b91806a6574658129fe0d23a7d/codecov#L891
  28. fetch-depth: '2'
  29. # If we make these jobs "required" to merge on GH, then on every PR, GitHub automatically
  30. # creates a status check in the "pending" state. This means that the workflow needs to run
  31. # for every PR in order to update the status checks.
  32. #
  33. # In order to optimize CI usage, we want the tests to only run when python files change,
  34. # since frontend changes should have no effect on these test suites. We cannot use GH workflow
  35. # path filters because entire workflow would be skipped vs skipping individual jobs which
  36. # would still allow this status check to pass.
  37. - name: Check for python file changes
  38. uses: getsentry/paths-filter@v2
  39. id: changes
  40. with:
  41. token: ${{ github.token }}
  42. filters: .github/file-filters.yml
  43. - name: Setup sentry env (python ${{ matrix.python-version }})
  44. uses: ./.github/actions/setup-sentry
  45. if: steps.changes.outputs.backend == 'true'
  46. id: setup
  47. with:
  48. python-version: ${{ matrix.python-version }}
  49. pip-cache-version: ${{ secrets.PIP_CACHE_VERSION }}
  50. snuba: true
  51. kafka: true
  52. - name: Run snuba test (${{ steps.setup.outputs.matrix-instance-number }} of ${{ steps.setup.outputs.matrix-instance-total }})
  53. if: steps.changes.outputs.backend == 'true'
  54. run: |
  55. make test-snuba
  56. - name: Handle artifacts
  57. uses: ./.github/actions/artifacts