Skip to content

Commit

Permalink
run_experimental_simulator and use it from hive-experimental workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fgimenez committed Aug 19, 2024
1 parent f003c19 commit 391aea2
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/assets/hive/run_experimental_simulator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# set -x

cd hivetests/

sim="${1}"
limit="${2}"

run_hive() {
sed -ie 's/RUST_LOG=info $reth node $FLAGS/RUST_LOG=info $reth node --engine.experimental $FLAGS/' clients/reth/reth.sh
hive --sim "${sim}" --sim.limit "${limit}" --sim.parallelism 4 --client reth 2>&1 | tee /tmp/log || true
}

check_log() {
tail -n 1 /tmp/log | sed -r 's/\x1B\[[0-9;]*[mK]//g'
}

attempt=0
max_attempts=5

while [ $attempt -lt $max_attempts ]; do
run_hive

# Check if no tests were run. sed removes ansi colors
if check_log | grep -q "suites=0"; then
echo "no tests were run, retrying in 10 seconds"
sleep 10
attempt=$((attempt + 1))
continue
fi

# Check the last line of the log for "finished", "tests failed", or "test failed"
if check_log | grep -Eq "(finished|tests? failed)"; then
exit 0
else
exit 1
fi
done
exit 1
1 change: 0 additions & 1 deletion .github/assets/hive/run_simulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ sim="${1}"
limit="${2}"

run_hive() {
sed -ie 's/RUST_LOG=info $reth node $FLAGS/RUST_LOG=info $reth node --engine.experimental $FLAGS/' clients/reth/reth.sh
hive --sim "${sim}" --sim.limit "${limit}" --sim.parallelism 4 --client reth 2>&1 | tee /tmp/log || true
}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hive-experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ jobs:
path: hivetests

- name: Run ${{ matrix.sim }} simulator
run: .github/assets/hive/run_simulator.sh "${{ matrix.sim }}$" "${{matrix.limit}}/${{join(matrix.include, '|')}}"
run: .github/assets/hive/run_experimental_simulator.sh "${{ matrix.sim }}$" "${{matrix.limit}}/${{join(matrix.include, '|')}}"

- name: Parse hive output
run: |
Expand Down

0 comments on commit 391aea2

Please sign in to comment.