fix: improve smoke test to check for successful bot startup instead of just exit code
This commit is contained in:
@@ -155,16 +155,26 @@ run_build() {
|
||||
run_smoke_test() {
|
||||
export GO_ENV="development"
|
||||
export MEV_BOT_ENCRYPTION_KEY="test_key_32_chars_minimum_length_required"
|
||||
run_step "smoke-test" timeout 30s ./bin/mev-bot start || {
|
||||
|
||||
local logfile="$LOG_DIR/smoke-test.log"
|
||||
log "Starting smoke-test"
|
||||
|
||||
# Run the bot with timeout, capture output
|
||||
timeout 30s ./bin/mev-bot start &> "$logfile" || {
|
||||
local exit_code=$?
|
||||
if [[ $exit_code -eq 124 ]]; then
|
||||
log "✅ Smoke test passed (timeout expected after 30s)"
|
||||
|
||||
# Check if the bot successfully started and entered main loop
|
||||
if grep -q "BOT FULLY STARTED" "$logfile"; then
|
||||
log "✅ Completed smoke-test (bot successfully started and then stopped)"
|
||||
return 0
|
||||
elif [[ $exit_code -eq 124 ]]; then
|
||||
log "✅ Completed smoke-test (timeout expected after 30s)"
|
||||
return 0
|
||||
elif [[ $exit_code -eq 0 ]]; then
|
||||
log "✅ Smoke test passed"
|
||||
log "✅ Completed smoke-test"
|
||||
return 0
|
||||
else
|
||||
log "❌ Smoke test failed with exit code $exit_code"
|
||||
log "❌ Failed smoke-test - see $logfile"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user