Skip to content

Feat: move two-step shell script into test_runner.py#891

Open
jaoleal wants to merge 2 commits intogetfloresta:masterfrom
jaoleal:merge_prepaseandrun_exposeutreexorev
Open

Feat: move two-step shell script into test_runner.py#891
jaoleal wants to merge 2 commits intogetfloresta:masterfrom
jaoleal:merge_prepaseandrun_exposeutreexorev

Conversation

@jaoleal
Copy link
Copy Markdown
Collaborator

@jaoleal jaoleal commented Mar 13, 2026

Description and Notes

Replace integration test shell script with tests/test_framework/setup.py for binary preparation and directory schema orchestration.

  • test_runner.py is now the single entry point — handles building/downloading binaries and running the suite.
  • Keep --force-rebuild, --release, and --preserve-data-dir flags.
  • Add option to directly download utreexod pre compiled binary, also expose UTREEXO_REVISION. (defaults to 0.4.0 now, which mitigates the problem were having right now with tests).
  • Clean stale data/ and logs/ directories before each run so failed runs don't lead any run into a corrupted state.
  • Update doc/running-tests.md accordingly.

Why ? : I expect for this changes to provide more quality of use while running locally the tests by solving edge cases that break the test environment and by gathering the steps to run the tests into a single one, uv run ./test/test_runner.py.

How to verify the changes you have done?

I tried to make a logical flow of the changes that got from having two shell scripts to extend the test runner with the same functionality. The first commit merge both ./test/prepare.sh and ./test/run.sh into run_funtcional.sh, the second one is the one rewriting it into the test_runner.py.

@jaoleal jaoleal requested a review from moisesPompilio March 13, 2026 20:42
@jaoleal jaoleal changed the title Merge prepaseandrun exposeutreexorev Feat: move two-step shell script into test_runner.py Mar 13, 2026
@jaoleal jaoleal requested review from Davidson-Souza and csgui March 13, 2026 20:43
@jaoleal jaoleal mentioned this pull request Mar 13, 2026
@jaoleal jaoleal force-pushed the merge_prepaseandrun_exposeutreexorev branch from 0e67a53 to 9e77d00 Compare March 16, 2026 20:11
@jaoleal
Copy link
Copy Markdown
Collaborator Author

jaoleal commented Mar 16, 2026

Defaulted the UTREEXOD_REVISION to 0.5.0-beta, all test passes. soory guys, fake news.

I also included a option to expose the general TIMEOUT, with that, people that have constrained environments to run the tests can have better control over the tests runtime. For example, on my laptop i needed to use: just test-functional "-O 120 -T 1" so it works.

@jaoleal jaoleal force-pushed the merge_prepaseandrun_exposeutreexorev branch from 9e77d00 to bf984e0 Compare March 16, 2026 21:47
@jaoleal
Copy link
Copy Markdown
Collaborator Author

jaoleal commented Mar 16, 2026

Okay guys, i changed UTREEXOD_REVISION to 878794f30cf0ffd499bc03551186ce6a5c16b67e it appears to be the correct commit to update the service flags problem.

@luisschwab luisschwab added the code quality Generally improves code readability and maintainability label Mar 17, 2026
Copy link
Copy Markdown
Collaborator

@moisesPompilio moisesPompilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than having test_runner call setup, setup should be the entry point and trigger the process. We're migrating to pytest, so test_runner will be removed. It's better for this Python script to behave like the .sh we used and be decoupled from the code.

return temp_dir

git_desc = _git_describe()
temp_dir = f"/tmp/floresta-func-tests.{git_desc}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bf984e0

Only the log folder includes git_describe; the other folders don't. This prevents re-downloading the commit each time a test session creates a commit.

@jaoleal jaoleal force-pushed the merge_prepaseandrun_exposeutreexorev branch from bf984e0 to 687e610 Compare March 18, 2026 06:09
The two-step workflow (prepare.sh then run.sh) required callers to
run scripts in sequence and share FLORESTA_TEMP_DIR between them.
Merge both into a single run_functional.sh that builds all binaries,
runs the test suite, and cleans up — in one invocation.

Also pins utreexod to v0.4.0 by default via UTREEXOD_REVISION and
updates the justfile, CI workflow, and docs accordingly.
@jaoleal jaoleal force-pushed the merge_prepaseandrun_exposeutreexorev branch 2 times, most recently from 8c150b3 to af5ff29 Compare March 18, 2026 19:47
@jaoleal
Copy link
Copy Markdown
Collaborator Author

jaoleal commented Mar 18, 2026

Rather than having test_runner call setup, setup should be the entry point and trigger the process. We're migrating to pytest, so test_runner will be removed. It's better for this Python script to behave like the .sh we used and be decoupled from the code.

okay, after some changes, setup.py now is a module that hold these methods for getting the environment up, it has a single entry, that being prepare_binaries which can be called inside validate_and_check_environment here or similar.

Replace the shell-based test setup (run_functional.sh) with a Python
module (tests/test_framework/setup.py) that implements the same approach:
build or download utreexod and bitcoind, and always build florestad,
before running the test suite.

The test runner (tests/test_runner.py) becomes the single entry point,
keeping the flags: --force-rebuild, --release, and --preserve-data-dir.

Also updates doc/running-tests.md accordingly.
@jaoleal jaoleal force-pushed the merge_prepaseandrun_exposeutreexorev branch from af5ff29 to 0a9b5ce Compare March 18, 2026 22:14
@jaoleal jaoleal added functional tests Integration Issues related to our integration tests architecture labels Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

architecture code quality Generally improves code readability and maintainability functional tests Integration Issues related to our integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants