Skip to content

Commit

Permalink
fix(ci): Fix Xatu Sentry smoke test (#327)
Browse files Browse the repository at this point in the history
* ci: Update GitHub Actions workflow for Xatu stack

* ci: Update wait-on command in smoke test workflow

* feat: Update Kurtosis config file path

* chore: Remove unnecessary GitHub workflow step

* fix: Update ClickHouse container name in smoke test workflow
  • Loading branch information
samcm authored Jun 4, 2024
1 parent c149d5a commit 57d07e7
Showing 1 changed file with 17 additions and 38 deletions.
55 changes: 17 additions & 38 deletions .github/workflows/sentry-smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,12 @@ jobs:
run: |
docker build -t ethpandaops/xatu:local .
echo "Xatu image is built."
- name: Install Kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli
- name: Create Kurtosis config file
run: |
cat <<EOF > network_params.yaml
cat <<EOF > /tmp/network_params.yaml
participants:
- el_type: geth
cl_type: teku
cl_image: ethpandaops/teku:master-16c4354
- el_type: nethermind
cl_type: prysm
- el_type: erigon
Expand All @@ -56,38 +50,23 @@ jobs:
- voluntary_exit
- contribution_and_proof
<<EOF
- name: Start Ethereum network with Kurtosis and Run Xatu stack in parallel
timeout-minutes: 20
- name: Run Xatu stack
timeout-minutes: 10
shell: bash
run: |
echo "Starting Kurtosis..."
kurtosis run --enclave xatu github.com/kurtosis-tech/ethereum-package --args-file network_params.yaml &
KURTOSIS_PID=$!
echo "Starting Xatu stack..."
docker compose up --detach --quiet-pull &
XATU_STACK_PID=$!
echo "Waiting for Kurtosis to start..."
wait $KURTOSIS_PID
KURTOSIS_EXIT_CODE=$?
if [ $KURTOSIS_EXIT_CODE -ne 0 ]; then
echo "Kurtosis failed to start."
exit $KURTOSIS_EXIT_CODE
fi
echo "Waiting for Xatu stack to start..."
wait $XATU_STACK_PID
XATU_STACK_EXIT_CODE=$?
if [ $XATU_STACK_EXIT_CODE -ne 0 ]; then
echo "Xatu stack failed to start."
exit $XATU_STACK_EXIT_CODE
fi
echo "Kurtosis and Xatu stack have started successfully."
- name: Setup kurtosis testnet and run assertoor tests
id: kurtosis-setup
uses: ethpandaops/kurtosis-assertoor-github-action@v1
with:
ethereum_package_args: /tmp/network_params.yaml
await_assertoor_tests: false
enclave_name: xatu
- name: Show all kurtosis containers
env:
SERVICES: ${{ steps.kurtosis-setup.outputs.services }}
run: |
echo $SERVICES
- name: Add all xatu-sentry containers to the xatu network
run: |
for container in $(docker ps --filter name=xatu-sentry --format "{{.Names}}"); do docker network connect xatu_xatu-net $container; echo $container; docker restart $container; done
Expand Down Expand Up @@ -139,7 +118,7 @@ jobs:
# Check for any data in the tables before digging in to the individual sentries
for table in "${tables[@]}"; do
pretty_print "Checking $table table..." "none"
data_count=$(docker exec clickhouse-01 clickhouse-client --query "SELECT COUNT(*) FROM default.$table" || true)
data_count=$(docker exec xatu-clickhouse-01 clickhouse-client --query "SELECT COUNT(*) FROM default.$table" || true)
if [[ $data_count -gt 0 ]]; then
pretty_print "$table table has $data_count entries" "green"
else
Expand All @@ -155,7 +134,7 @@ jobs:
for sentry in "${all_sentries[@]}"; do
pretty_print "Checking $table table for $sentry..." "none"
while true; do
data_count=$(docker exec clickhouse-01 clickhouse-client --query "SELECT COUNT(*) FROM default.$table WHERE meta_client_name = '$sentry'" || true)
data_count=$(docker exec xatu-clickhouse-01 clickhouse-client --query "SELECT COUNT(*) FROM default.$table WHERE meta_client_name = '$sentry'" || true)
if [[ $data_count -gt 0 ]]; then
pretty_print "$table has $data_count entries from $sentry" "green"
break
Expand Down

0 comments on commit 57d07e7

Please sign in to comment.