Skip to content

Add CI test for remote debugging on localhost #1

Add CI test for remote debugging on localhost

Add CI test for remote debugging on localhost #1

Workflow file for this run

name: CI Tests
on:
push:
branches: [ dev, main ]
pull_request:
branches: [ dev, main ]
jobs:
test-remote-debugging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y lldb
- name: Test Remote Debugging Infrastructure
run: |
cd test
python3 -c "
import os

Check failure on line 30 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test.yml

Invalid workflow file

You have an error in your yaml syntax on line 30
import sys
import time
import platform
import subprocess
import socket
def find_free_port():
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind(('', 0))
s.listen(1)
port = s.getsockname()[1]
return port
port = find_free_port()
host = '127.0.0.1'
# Use helloworld binary for testing
fpath = 'binaries/Linux-x86_64/helloworld'
if not os.path.exists(fpath):
print(f'Test binary not found: {fpath}')
sys.exit(1)
server_cmd = ['lldb-server', 'gdbserver', f'{host}:{port}', fpath]
try:
print(f'Starting lldb-server on {host}:{port} with {fpath}')
server_process = subprocess.Popen(server_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
time.sleep(2)
if server_process.poll() is not None:
stdout, stderr = server_process.communicate()
print(f'lldb-server failed: stdout={stdout.decode()}, stderr={stderr.decode()}')
sys.exit(1)
# Test connection
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.settimeout(10)
s.connect((host, port))
s.sendall(b'+\\$qSupported#37')
response = s.recv(1024)
if response:
print('✓ Remote debugging test successful: Connected to lldb-server on localhost')
else:
print('✗ No response from lldb-server')
sys.exit(1)
finally:
if server_process and server_process.poll() is None:
server_process.terminate()
server_process.wait(timeout=5)
"