Просмотр исходного кода

ci: Initial self-hosted end-to-end Github Action (#42124)

This adds a new action that runs the self-hosted end-to-end tests in a
Github Action. For now it polls from Google Cloud Build, but eventually
it will build the image itself.

Co-authored-by: anthony sottile <103459774+asottile-sentry@users.noreply.github.com>
Co-authored-by: Chad Whitacre <chadwhitacre@sentry.io>
Ethan Smith 2 лет назад
Родитель
Сommit
474d2e0e24
2 измененных файлов с 58 добавлено и 2 удалено
  1. 56 0
      .github/workflows/self-hosted-e2e-tests.yml
  2. 2 2
      src/sentry/event_manager.py

+ 56 - 0
.github/workflows/self-hosted-e2e-tests.yml

@@ -0,0 +1,56 @@
+name: Self-hosted Sentry end to end tests
+on:
+  push:
+    branches:
+      - master
+      - releases/**
+  pull_request:
+
+# Cancel in progress workflows on pull_requests.
+# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
+concurrency:
+  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+  cancel-in-progress: true
+
+jobs:
+  self-hosted-end-to-end:
+    name: self-hosted tests
+    runs-on: ubuntu-20.04
+    # temporary, remove once we are confident the action is working
+    continue-on-error: true
+    timeout-minutes: 30
+    steps:
+      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8  # v3.1.0
+
+      - name: Check for backend file changes
+        uses: getsentry/paths-filter@4512585405083f25c027a35db413c2b3b9006d50  # v2.11.1
+        id: changes
+        with:
+          token: ${{ github.token }}
+          filters: .github/file-filters.yml
+
+      - name: Pull the test image
+        if: steps.changes.outputs.backend_all == 'true'
+        id: image_pull
+        env:
+          SENTRY_TEST_IMAGE: us.gcr.io/sentryio/sentry:${{ github.event.pull_request.head.sha || github.sha }} 
+        run: |
+          echo "We poll for the Sentry Docker image that the GCB build produces until it succeeds or this job times out."
+          if [[ -z "$SENTRY_TEST_IMAGE" ]]; then
+              echo "The SENTRY_TEST_IMAGE needs to be set" 1>&2
+              exit 1
+          fi
+          echo "Polling for $SENTRY_TEST_IMAGE"
+          until docker pull "$SENTRY_TEST_IMAGE" 2>/dev/null; do
+              sleep 10
+          done
+          echo "sentry-test-image-name=$SENTRY_TEST_IMAGE" >> "$GITHUB_OUTPUT"
+
+      # TODO: push the image here
+      - name: Run Sentry self-hosted e2e CI
+        if: steps.changes.outputs.backend_all == 'true'
+        uses: getsentry/action-self-hosted-e2e-tests@fa5b8240848f0e645ac2918c530e60ec8f50e4b8
+        with:
+          project_name: sentry
+          local_image: ${{ steps.image_pull.outputs.sentry-test-image-name }}
+          docker_repo: docker.io/getsentry/sentry

+ 2 - 2
src/sentry/event_manager.py

@@ -2209,8 +2209,8 @@ def _save_grouphash_and_group(
 def _message_from_metadata(meta: Mapping[str, str]) -> str:
     title = meta.get("title", "")
     location = meta.get("location", "")
-    seperator = ": " if title and location else ""
-    return f"{title}{seperator}{location}"
+    separator = ": " if title and location else ""
+    return f"{title}{separator}{location}"
 
 
 @metrics.wraps("save_event.save_aggregate_performance")