Skip to content

client-integration-tests #247

client-integration-tests

client-integration-tests #247

name: client-integration-tests
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Daily run to catch upstream changes
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
beacon-integration-test:
timeout-minutes: 20
runs-on:
- self-hosted-ghr
- size-m-x64
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
- name: Build contributoor image
run: |
docker build -f Dockerfile.ci -t ethpandaops/contributoor:local .
echo "Contributoor image is built."
- name: Setup kurtosis testnet
id: kurtosis-setup
uses: ethpandaops/kurtosis-assertoor-github-action@v1.0.1
with:
kurtosis_version: '1.18.3'
ethereum_package_args: .github/workflows/configs/kurtosis-network-params.yaml
await_assertoor_tests: false
enclave_name: contributoor-test
- name: Show all kurtosis services
env:
SERVICES: ${{ steps.kurtosis-setup.outputs.services }}
run: |
echo "Kurtosis services:"
echo $SERVICES
# Save services JSON for the next step
echo "$SERVICES" > /tmp/kurtosis-services.json
- name: Test contributoor against each beacon node
run: |
# Extract beacon node endpoints from the services JSON
BEACON_NODES=""
for service in cl-1-teku-geth cl-2-prysm-geth cl-3-lighthouse-geth cl-4-nimbus-geth cl-5-lodestar-geth cl-6-grandine-geth; do
endpoint=$(jq -r ".\"$service\".http.url // empty" < /tmp/kurtosis-services.json)
if [ -n "$endpoint" ]; then
BEACON_NODES="${BEACON_NODES}${endpoint}\n"
fi
done
if [ -z "$BEACON_NODES" ]; then
echo "No beacon nodes found!"
exit 1
fi
echo "Found beacon nodes:"
echo -e "$BEACON_NODES"
# Test each beacon node
echo -e "$BEACON_NODES" | grep -v "^$" | while read -r beacon; do
NODE_NAME=$(echo "$beacon" | sed 's|http://||' | cut -d':' -f1)
echo ""
echo "======================================"
echo "Testing contributoor against $NODE_NAME"
echo "Endpoint: $beacon"
echo "======================================"
# Run contributoor and capture logs
CONTAINER_NAME="contributoor-test-${NODE_NAME}"
# Start contributoor in background
docker run -d \
--name "$CONTAINER_NAME" \
--network "host" \
ethpandaops/contributoor:local \
--beacon-node-address="$beacon" \
--output-server-address="localhost:8080" \
--log-level=info \
--network=kurtosis \
> /dev/null 2>&1
# Monitor logs for success indicators
SUCCESS=false
NETWORK_DETECTED=false
SERVICE_READY=false
SUMMARY_FOUND=false
echo "Monitoring contributoor logs for success indicators..."
for i in {1..60}; do
# Check for network detection
if ! $NETWORK_DETECTED && docker logs "$CONTAINER_NAME" 2>&1 | grep -q "Detected network and node ID hash"; then
NETWORK_DETECTED=true
echo " ✓ Network detected"
docker logs "$CONTAINER_NAME" 2>&1 | grep "Detected network and node ID hash" | tail -1
fi
# Check for beacon connection
if ! $SERVICE_READY && docker logs "$CONTAINER_NAME" 2>&1 | grep -q "Beacon connected successfully"; then
SERVICE_READY=true
echo " ✓ Beacon connected successfully"
fi
# Check for successful data collection
# Look for summaries that show actual events being collected (not empty summaries)
if ! $SUMMARY_FOUND && docker logs "$CONTAINER_NAME" 2>&1 | grep -E "Summary of the last 10s.*event_stream_events=\"[a-zA-Z]" > /dev/null 2>&1; then
SUMMARY_FOUND=true
echo " ✓ Data collection confirmed (found summary with events)"
# Show the summary line
docker logs "$CONTAINER_NAME" 2>&1 | grep -E "Summary of the last 10s.*event_stream_events=\"[a-zA-Z]" | tail -1
fi
# Check if container is still running
if ! docker ps -q -f name="$CONTAINER_NAME" | grep -q .; then
echo " ✗ Container stopped unexpectedly"
docker logs "$CONTAINER_NAME" 2>&1 | tail -20
exit 1
fi
# Success if all indicators found
if $NETWORK_DETECTED && $SERVICE_READY && $SUMMARY_FOUND; then
SUCCESS=true
break
fi
# Show progress every 10 seconds
if [ $((i % 10)) -eq 0 ] && [ $i -ne 0 ]; then
echo " ... still waiting (${i}s elapsed)"
fi
sleep 1
done
# Stop and remove container
docker stop "$CONTAINER_NAME" > /dev/null 2>&1 || true
docker rm "$CONTAINER_NAME" > /dev/null 2>&1 || true
# Check results
if $SUCCESS; then
echo "✓ Contributoor successfully connected to $NODE_NAME"
else
echo "✗ Contributoor failed verification for $NODE_NAME"
echo " Network detected: $NETWORK_DETECTED"
echo " Beacon connected: $SERVICE_READY"
echo " Data collection: $SUMMARY_FOUND"
echo ""
echo "Last 20 lines of log:"
docker logs "$CONTAINER_NAME" 2>&1 | tail -20 || true
exit 1
fi
done
echo ""
echo "======================================"
echo "✓ All beacon node tests passed!"
echo "======================================"
- name: Collect docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
with:
dest: './logs'
- name: Tar logs
if: failure()
run: tar cvzf ./logs.tgz ./logs
- name: Upload logs to GitHub
if: failure()
uses: actions/upload-artifact@v7
with:
name: logs.tgz
path: ./logs.tgz