Skip to content

Commit 768ec85

Browse files
fix: use setup-sentry action instead of manual pip install
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 93ca315 commit 768ec85

1 file changed

Lines changed: 22 additions & 43 deletions

File tree

‎.github/workflows/relay-native-v2-smoke.yml‎

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,62 +7,40 @@ concurrency:
77
group: relay-native-v2-${{ github.sha }}
88
cancel-in-progress: true
99

10+
env:
11+
SNUBA_NO_WORKERS: 1
12+
1013
jobs:
1114
smoke-test:
12-
runs-on: ubuntu-22.04
13-
timeout-minutes: 15
15+
runs-on: ubuntu-24.04
16+
timeout-minutes: 20
1417
env:
15-
MIGRATIONS_TEST_MIGRATE: 0
16-
PYTEST_ADDOPTS: '--no-header -q'
17-
SENTRY_SKIP_BACKEND_VALIDATION: 1
1818
XDIST_PER_WORKER_SNUBA: '1'
1919
XDIST_WORKERS: '2'
2020
PYTHONHASHSEED: '0'
2121

2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2424

25-
- name: Set up Python 3.13.1
26-
uses: actions/setup-python@v5
25+
- name: Setup sentry env (Full Snuba stack)
26+
uses: ./.github/actions/setup-sentry
27+
id: setup
2728
with:
28-
python-version: 3.13.1
29-
30-
- name: Set up outputs
31-
id: config
32-
env:
33-
MATRIX_INSTANCE: 0
34-
run: echo "matrix-instance-number=$(($MATRIX_INSTANCE + 1))" >> "$GITHUB_OUTPUT"
35-
36-
- name: Install system deps
37-
run: sudo apt-get update && sudo apt-get install -y libxmlsec1-dev libmaxminddb-dev
38-
39-
- name: Set up pip
40-
uses: ./.github/actions/setup-pip
41-
id: pip
42-
43-
- name: pip install
44-
run: |
45-
python -m pip install --upgrade pip wheel
46-
pip install -e ".[dev]"
47-
48-
- name: Set up devservices (backend-ci)
49-
env:
50-
NEED_KAFKA: 'true'
51-
NEED_SNUBA: 'true'
52-
run: |
53-
sentry init
54-
sentry devservices up --mode backend-ci
29+
mode: backend-ci
5530

5631
- name: Extract Relay binary from Docker image
5732
run: |
5833
echo "=== Extracting Relay binary from Docker image ==="
59-
RELAY_IMAGE="${RELAY_TEST_IMAGE:-ghcr.io/getsentry/relay:nightly}"
34+
# Find the relay image used by devservices
35+
RELAY_IMAGE=$(docker inspect sentry_relay --format '{{.Config.Image}}' 2>/dev/null || \
36+
docker inspect relay-relay-1 --format '{{.Config.Image}}' 2>/dev/null || \
37+
echo "ghcr.io/getsentry/relay:nightly")
6038
echo "Image: $RELAY_IMAGE"
6139
6240
# Create a temporary container to copy the binary out
6341
docker create --name relay_extract "$RELAY_IMAGE"
6442
65-
# The binary location in the image (try common paths)
43+
# The binary location in the image
6644
for bin_path in /bin/relay /usr/local/bin/relay /usr/bin/relay; do
6745
if docker cp "relay_extract:${bin_path}" /tmp/relay 2>/dev/null; then
6846
echo "Found binary at $bin_path"
@@ -98,26 +76,27 @@ jobs:
9876
{"secret_key":"OxE6Du8quMxWj19f7YDCpIxm6XyU9nWGQJkMWFlkchA","public_key":"SMSesqan65THCV6M4qs4kBzPai60LzuDn-xNsvYpuP8","id":"88888888-4444-4444-8444-cccccccccccc"}
9977
CRED
10078
101-
# Just test that it starts (will fail to connect to upstream, but won't crash with "not compiled with processing")
10279
timeout 3 /tmp/relay run --config "$TEST_DIR" 2>&1 | head -20 || true
10380
echo "Processing support verified (no 'not compiled with processing' error)"
10481
rm -rf "$TEST_DIR"
10582
10683
- name: Create per-worker ClickHouse databases and Snuba instances
10784
run: |
10885
echo "Setting up $XDIST_WORKERS per-worker ClickHouse databases + Snuba instances ..."
109-
SNUBA_IMAGE=$(docker inspect --format='{{.Config.Image}}' sentry_snuba 2>/dev/null || echo "ghcr.io/getsentry/snuba:nightly")
86+
SNUBA_IMAGE=$(docker inspect sentry_snuba --format '{{.Config.Image}}' 2>/dev/null || docker inspect snuba-snuba-1 --format '{{.Config.Image}}' 2>/dev/null || echo "ghcr.io/getsentry/snuba:nightly")
87+
SNUBA_NETWORK=$(docker inspect sentry_snuba --format '{{range $k, $v := .NetworkSettings.Networks}}{{$k}}{{end}}' 2>/dev/null || docker inspect snuba-snuba-1 --format '{{range $k, $v := .NetworkSettings.Networks}}{{$k}}{{end}}' 2>/dev/null || echo "devservices")
11088
11189
for i in $(seq 0 $(($XDIST_WORKERS - 1))); do
11290
DB_NAME="default_gw${i}"
11391
SNUBA_PORT=$((1230 + i))
11492
CONTAINER_NAME="sentry_snuba_gw${i}"
11593
116-
docker exec sentry_clickhouse clickhouse-client --query "CREATE DATABASE IF NOT EXISTS ${DB_NAME}"
94+
docker exec sentry_clickhouse clickhouse-client --query "CREATE DATABASE IF NOT EXISTS ${DB_NAME}" 2>/dev/null || \
95+
docker exec clickhouse-clickhouse-1 clickhouse-client --query "CREATE DATABASE IF NOT EXISTS ${DB_NAME}"
11796
11897
docker run -d \
11998
--name "$CONTAINER_NAME" \
120-
--network devservices \
99+
--network "$SNUBA_NETWORK" \
121100
-p "${SNUBA_PORT}:1218" \
122101
-e SNUBA_SETTINGS=docker \
123102
-e CLICKHOUSE_HOST=clickhouse \
@@ -143,7 +122,6 @@ jobs:
143122
run: |
144123
echo "=== Native binary Relay + per-worker xdist smoke test ==="
145124
echo "RELAY_NATIVE_BIN=$RELAY_NATIVE_BIN"
146-
echo "Running 4 relay_integration tests with -n 2 workers"
147125
echo ""
148126
149127
py.test tests/relay_integration/test_message_filters.py \
@@ -166,4 +144,5 @@ jobs:
166144
167145
echo ""
168146
echo "=== Kafka topics ==="
169-
docker exec sentry_kafka kafka-topics --list --bootstrap-server localhost:9093 2>/dev/null || true
147+
docker exec sentry_kafka kafka-topics --list --bootstrap-server localhost:9093 2>/dev/null || \
148+
docker exec kafka-kafka-1 kafka-topics --list --bootstrap-server localhost:9093 2>/dev/null || true

0 commit comments

Comments
 (0)