Skip to content

Conversation

@doitian
Copy link
Member

@doitian doitian commented Nov 28, 2025

Summary

This PR replaces the bash-based e2e test runner in the GitHub Actions workflow with a comprehensive Python script that provides better error handling, process management, and maintainability.

Changes

New Python E2E Test Runner (tests/bruno/e2e/run_e2e_local.py)

  • Comprehensive process management: Properly handles background processes (start.sh, Bruno tests) with signal handlers for graceful shutdown
  • Better error handling: Checks prerequisites, validates workflow directories, and provides clear error messages
  • Improved cleanup: Ensures all processes (ckb, fnn, bitcoind, lnd) are properly terminated on exit or interrupt
  • Real-time output streaming: Streams output from background processes with prefixes for better debugging
  • Maintainability: Single Python script that's easier to understand and modify than complex bash scripts

GitHub Actions Workflow Simplification

  • Simplified .github/workflows/e2e.yml to call the Python script instead of inline bash commands
  • The Python script handles all the complexity (prebuild, starting nodes, waiting for ports, running tests)
  • Maintains the same behavior as before but with better structure

Minor Fix

  • Reduced retry wait time in tests/nodes/wait.sh from 30 seconds to 10 seconds for faster feedback

Benefits

  1. Better maintainability: Python code is easier to read, test, and modify than complex bash scripts
  2. Improved error handling: Proper signal handling and cleanup ensures processes don't leak
  3. Better debugging: Real-time output streaming with prefixes makes it easier to identify issues
  4. Consistency: Same script can be used both locally and in CI

Testing

The script maintains the same behavior as the previous bash-based approach and works with all existing e2e workflows:

  • 3-nodes-transfer
  • cross-chain-hub
  • funding-tx-verification
  • udt

Updated the retry wait time from 30 seconds to 10 seconds when the port file is not found, improving the responsiveness of the script.
The new Python script automates running e2e tests in the background,
allowing you to "fire and forget" while you continue working.

The script provides better process management, cleanup, and local debugging
capabilities while matching the behavior of the GitHub Actions workflow.
@chenyukang
Copy link
Collaborator

I'm not sure whether it's better to maintain, after all it's 551 new lines code added and only 18 lines deleted, i prefer to shorter code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants