Skip to content

Commit 69ad3d6

Browse files
committed
Clean up
1 parent 3324278 commit 69ad3d6

3 files changed

Lines changed: 7 additions & 202 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 5 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ on:
1313
- ".github/workflows/e2e.yml"
1414
workflow_dispatch: {}
1515

16-
env:
17-
TUSK_CLI_UNDER_TEST_REF: socket-location
18-
1916
jobs:
2017
discover:
2118
name: Discover Tests
@@ -45,45 +42,9 @@ jobs:
4542
echo "e2e_matrix=$E2E_TESTS" >> $GITHUB_OUTPUT
4643
echo "stack_matrix=$STACK_TESTS" >> $GITHUB_OUTPUT
4744
48-
build-cli-under-test:
49-
name: Build Tusk CLI Under Test
50-
runs-on: ubuntu-latest
51-
steps:
52-
- name: Checkout Tusk CLI under test
53-
uses: actions/checkout@v6
54-
with:
55-
repository: Use-Tusk/tusk-drift-cli
56-
ref: ${{ env.TUSK_CLI_UNDER_TEST_REF }}
57-
path: tusk-drift-cli-src
58-
fetch-depth: 1
59-
60-
- name: Setup Go
61-
uses: actions/setup-go@v5
62-
with:
63-
go-version-file: tusk-drift-cli-src/go.mod
64-
cache-dependency-path: tusk-drift-cli-src/go.sum
65-
66-
- name: Build Tusk CLI under test
67-
working-directory: tusk-drift-cli-src
68-
env:
69-
CGO_ENABLED: "0"
70-
GOOS: linux
71-
GOARCH: amd64
72-
run: |
73-
mkdir -p "$RUNNER_TEMP/tusk-cli-under-test"
74-
go build -trimpath -o "$RUNNER_TEMP/tusk-cli-under-test/tusk" .
75-
76-
- name: Upload Tusk CLI under test
77-
uses: actions/upload-artifact@v4
78-
with:
79-
name: tusk-cli-under-test-linux-amd64
80-
path: ${{ runner.temp }}/tusk-cli-under-test/tusk
81-
if-no-files-found: error
82-
retention-days: 1
83-
8445
e2e:
8546
name: E2E - ${{ matrix.library }}
86-
needs: [discover, build-cli-under-test]
47+
needs: discover
8748
runs-on: ubuntu-latest
8849
timeout-minutes: 30
8950
strategy:
@@ -108,15 +69,6 @@ jobs:
10869
with:
10970
driver: docker
11071

111-
- name: Download Tusk CLI under test
112-
uses: actions/download-artifact@v4
113-
with:
114-
name: tusk-cli-under-test-linux-amd64
115-
path: ./.tmp/tusk-cli-under-test
116-
117-
- name: Make Tusk CLI under test executable
118-
run: chmod +x ./.tmp/tusk-cli-under-test/tusk
119-
12072
- name: Install SDK dependencies
12173
run: uv sync --all-extras
12274

@@ -149,9 +101,7 @@ jobs:
149101
150102
- name: Run E2E tests for ${{ matrix.library }}
151103
env:
152-
COMPOSE_FILE: docker-compose.yml:${{ github.workspace }}/drift/instrumentation/e2e_common/docker-compose.cli-override.yml
153104
DOCKER_DEFAULT_PLATFORM: linux/amd64
154-
TUSK_CLI_BIND_PATH: ${{ github.workspace }}/.tmp/tusk-cli-under-test/tusk
155105
TUSK_CLI_VERSION: ${{ steps.tusk-version.outputs.version }}
156106
TUSK_USE_RUST_CORE: "1"
157107
run: |
@@ -189,6 +139,7 @@ jobs:
189139
name: e2e-${{ matrix.library }}-replay-logs
190140
path: ./drift/instrumentation/${{ matrix.library }}/e2e-tests/.tusk/logs
191141
if-no-files-found: ignore
142+
include-hidden-files: true
192143

193144
- name: Cleanup Docker resources
194145
if: always()
@@ -203,7 +154,7 @@ jobs:
203154
204155
stack:
205156
name: Stack - ${{ matrix.test }}
206-
needs: [discover, build-cli-under-test]
157+
needs: discover
207158
if: ${{ needs.discover.outputs.stack_matrix != '[]' && needs.discover.outputs.stack_matrix != '' }}
208159
runs-on: ubuntu-latest
209160
timeout-minutes: 30
@@ -229,15 +180,6 @@ jobs:
229180
with:
230181
driver: docker
231182

232-
- name: Download Tusk CLI under test
233-
uses: actions/download-artifact@v4
234-
with:
235-
name: tusk-cli-under-test-linux-amd64
236-
path: ./.tmp/tusk-cli-under-test
237-
238-
- name: Make Tusk CLI under test executable
239-
run: chmod +x ./.tmp/tusk-cli-under-test/tusk
240-
241183
- name: Install SDK dependencies
242184
run: uv sync --all-extras
243185

@@ -270,9 +212,7 @@ jobs:
270212
271213
- name: Run stack tests for ${{ matrix.test }}
272214
env:
273-
COMPOSE_FILE: docker-compose.yml:${{ github.workspace }}/drift/instrumentation/e2e_common/docker-compose.cli-override.yml
274215
DOCKER_DEFAULT_PLATFORM: linux/amd64
275-
TUSK_CLI_BIND_PATH: ${{ github.workspace }}/.tmp/tusk-cli-under-test/tusk
276216
TUSK_CLI_VERSION: ${{ steps.tusk-version.outputs.version }}
277217
TUSK_USE_RUST_CORE: "1"
278218
run: |
@@ -310,6 +250,7 @@ jobs:
310250
name: stack-${{ matrix.test }}-replay-logs
311251
path: ./drift/stack-tests/${{ matrix.test }}/.tusk/logs
312252
if-no-files-found: ignore
253+
include-hidden-files: true
313254

314255
- name: Cleanup Docker resources
315256
if: always()
@@ -324,7 +265,6 @@ jobs:
324265
325266
non-rust-smoke:
326267
name: E2E Non-Rust Smoke - requests
327-
needs: build-cli-under-test
328268
runs-on: ubuntu-latest
329269
timeout-minutes: 30
330270
steps:
@@ -344,15 +284,6 @@ jobs:
344284
with:
345285
driver: docker
346286

347-
- name: Download Tusk CLI under test
348-
uses: actions/download-artifact@v4
349-
with:
350-
name: tusk-cli-under-test-linux-amd64
351-
path: ./.tmp/tusk-cli-under-test
352-
353-
- name: Make Tusk CLI under test executable
354-
run: chmod +x ./.tmp/tusk-cli-under-test/tusk
355-
356287
- name: Install SDK dependencies
357288
run: uv sync --all-extras
358289

@@ -385,9 +316,7 @@ jobs:
385316
386317
- name: Run non-rust smoke test
387318
env:
388-
COMPOSE_FILE: docker-compose.yml:${{ github.workspace }}/drift/instrumentation/e2e_common/docker-compose.cli-override.yml
389319
DOCKER_DEFAULT_PLATFORM: linux/amd64
390-
TUSK_CLI_BIND_PATH: ${{ github.workspace }}/.tmp/tusk-cli-under-test/tusk
391320
TUSK_CLI_VERSION: ${{ steps.tusk-version.outputs.version }}
392321
TUSK_USE_RUST_CORE: "0"
393322
run: |
@@ -425,6 +354,7 @@ jobs:
425354
name: requests-smoke-replay-logs
426355
path: ./drift/instrumentation/requests/e2e-tests/.tusk/logs
427356
if-no-files-found: ignore
357+
include-hidden-files: true
428358

429359
- name: Cleanup Docker resources
430360
if: always()

drift/instrumentation/e2e_common/docker-compose.cli-override.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

drift/instrumentation/grpc/e2e-tests/src/grpc_server.py

Lines changed: 2 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""gRPC server for e2e tests."""
22

3-
import os
4-
import stat
53
import time
64
from concurrent import futures
75

@@ -11,114 +9,6 @@
119
import grpc
1210

1311

14-
def _log_selected_env():
15-
"""Print relevant environment variables for sandbox debugging."""
16-
interesting_prefixes = ("TUSK_", "PYTHON", "LD_")
17-
interesting = {
18-
key: value
19-
for key, value in os.environ.items()
20-
if key.startswith(interesting_prefixes)
21-
}
22-
if not interesting:
23-
print("[grpc probe] interesting env: <none>", flush=True)
24-
return
25-
26-
for key in sorted(interesting):
27-
print(f"[grpc probe] env {key}={interesting[key]}", flush=True)
28-
29-
30-
def _log_mountinfo(prefix: str):
31-
"""Print mountinfo entries rooted at a given mount prefix."""
32-
try:
33-
with open("/proc/self/mountinfo", encoding="utf-8") as handle:
34-
found = False
35-
for raw_line in handle:
36-
line = raw_line.rstrip("\n")
37-
left, separator, _right = line.partition(" - ")
38-
if not separator:
39-
continue
40-
fields = left.split()
41-
if len(fields) < 5:
42-
continue
43-
mount_point = fields[4]
44-
if mount_point == prefix or mount_point.startswith(f"{prefix}/"):
45-
print(f"[grpc probe] mountinfo {mount_point}: {line}", flush=True)
46-
found = True
47-
if not found:
48-
print(f"[grpc probe] mountinfo: no entries found for {prefix}", flush=True)
49-
except OSError as exc:
50-
print(
51-
f"[grpc probe] read(/proc/self/mountinfo) failed: errno={exc.errno} strerror={exc.strerror}",
52-
flush=True,
53-
)
54-
55-
56-
def _log_device_probe(path: str):
57-
"""Print detailed device diagnostics for sandbox debugging."""
58-
try:
59-
info = os.stat(path)
60-
device_kind = "char" if stat.S_ISCHR(info.st_mode) else "other"
61-
device_id = "-"
62-
if stat.S_ISCHR(info.st_mode):
63-
device_id = f"{os.major(info.st_rdev)}:{os.minor(info.st_rdev)}"
64-
print(
65-
f"[grpc probe] {path}: mode={oct(stat.S_IMODE(info.st_mode))} "
66-
f"kind={device_kind} rdev={device_id} "
67-
f"readable={os.access(path, os.R_OK)} writable={os.access(path, os.W_OK)}",
68-
flush=True,
69-
)
70-
except OSError as exc:
71-
print(
72-
f"[grpc probe] stat({path}) failed: errno={exc.errno} strerror={exc.strerror}",
73-
flush=True,
74-
)
75-
return
76-
77-
try:
78-
fd = os.open(path, os.O_RDONLY)
79-
try:
80-
data = os.read(fd, 1)
81-
print(f"[grpc probe] read({path}) ok: bytes={len(data)}", flush=True)
82-
finally:
83-
os.close(fd)
84-
except OSError as exc:
85-
print(
86-
f"[grpc probe] open/read({path}) failed: errno={exc.errno} strerror={exc.strerror}",
87-
flush=True,
88-
)
89-
90-
91-
def _log_startup_probe():
92-
"""Emit diagnostics to pinpoint sandbox/device failures in CI."""
93-
print(
94-
f"[grpc probe] pid={os.getpid()} uid={os.getuid()} euid={os.geteuid()} cwd={os.getcwd()}",
95-
flush=True,
96-
)
97-
_log_selected_env()
98-
_log_mountinfo("/dev")
99-
try:
100-
dev_entries = ", ".join(sorted(os.listdir("/dev")))
101-
print(f"[grpc probe] /dev entries: {dev_entries}", flush=True)
102-
except OSError as exc:
103-
print(
104-
f"[grpc probe] listdir(/dev) failed: errno={exc.errno} strerror={exc.strerror}",
105-
flush=True,
106-
)
107-
108-
for device_path in ("/dev/urandom", "/dev/random", "/dev/null"):
109-
_log_device_probe(device_path)
110-
111-
if hasattr(os, "getrandom"):
112-
try:
113-
sample = os.getrandom(1)
114-
print(f"[grpc probe] getrandom() ok: bytes={len(sample)}", flush=True)
115-
except OSError as exc:
116-
print(
117-
f"[grpc probe] getrandom() failed: errno={exc.errno} strerror={exc.strerror}",
118-
flush=True,
119-
)
120-
121-
12212
class GreeterServicer(greeter_pb2_grpc.GreeterServicer):
12313
"""Implementation of the Greeter service."""
12414

@@ -171,19 +61,11 @@ def Chat(self, request_iterator, context):
17161

17262
def serve(port: int = 50051):
17363
"""Start the gRPC server."""
174-
print("[grpc probe] before startup probe", flush=True)
175-
_log_startup_probe()
176-
print("[grpc probe] before grpc.server()", flush=True)
17764
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
178-
print("[grpc probe] after grpc.server()", flush=True)
17965
greeter_pb2_grpc.add_GreeterServicer_to_server(GreeterServicer(), server)
180-
print("[grpc probe] after add_GreeterServicer_to_server()", flush=True)
181-
bound_port = server.add_insecure_port(f"[::]:{port}")
182-
print(f"[grpc probe] add_insecure_port returned {bound_port}", flush=True)
183-
print("[grpc probe] before server.start()", flush=True)
66+
server.add_insecure_port(f"[::]:{port}")
18467
server.start()
185-
print("[grpc probe] after server.start()", flush=True)
186-
print(f"gRPC server started on port {port}", flush=True)
68+
print(f"gRPC server started on port {port}")
18769
return server
18870

18971

0 commit comments

Comments
 (0)