snuba-integration-test.yml 2.4 KB

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