Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-structured functional tests. #402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qlrd
Copy link
Contributor

@qlrd qlrd commented Mar 7, 2025

Improves #252

What is the purpose of this pull request?

  • Bug fix
  • Documentation update
  • New feature
  • Test
  • Other:

Which crates are being modified?

  • floresta-chain
  • floresta-cli
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other: .

Description

This re-structure aims to optmize developer flow and the experience with tests tool through 1) a replacement of the current python package management; 2) a more organized folder tree strucutre inside tests/; and 3) changes in tests/run_tests.py, tests/prepare.sh and tests/run.sh to comply with the already mentioned changes.

The replacement in python package management is from poetry to uv (a rust-based python management tool); this approach have some PROS: (i) built with rust; (ii) faster than poetry; (iii) cleanup some unecessary python dependencies; (iv) more readable pyproject.toml; (v) compatible with python pip install -r approach (for old-school pythonists). Until now, a CON is: (i) this remove some poetry macros. Still seems like a good replacement.

The folder structure organization allows you to define test suites in separate folders (e.g. "florestad", "floresta-cli") without needing to define each of them in pyproject.toml. Files ending with "-test.py" in each folder will be recognized and executed.

To comply with above mentioned changes, tests/run_tests.py was modified to inlcude an argument --test-suite that will search for a folder tests/<test-suite>. It was also necessary to change tests/prepare.sh and tests/run.sh to replace poetry to uv.

Notes to the reviewers

A better context about this change is available in #252 (comment) and #391. Tested this approach in https://github.com/qlrd/Floresta/actions/runs/13722793641/job/38381971781

Checklist

  • I've signed all my commits
  • I ran just lint
  • I ran cargo test
  • I've checked the integration tests
  • I've followed the contribution guidelines
  • I'm linking the issue being fixed by this PR (if any)

@Davidson-Souza Davidson-Souza added dependencies Pull requests that update a dependency file code quality Generally improves code readability and maintainability functional tests labels Mar 7, 2025
@qlrd qlrd force-pushed the uv-dep-management branch from 89d0798 to 94d6357 Compare March 7, 2025 20:25
This re-structure aims to optmize developer flow and the experience
with tests tool through 1) a replacement of the current python package
management; 2) a more organized folder tree strucutre inside tests/; and
3) changes in tests/run_tests.py, tests/prepare.sh and tests/run.sh
to comply with the already mentioned changes.

The replacement in python package management is from poetry to uv (a rust-based
python management tool); this approach have some PROS: (i) built with rust;
(ii) faster than poetry; (iii) cleanup some unecessary python dependencies;
(iv) more readable pyproject.toml; (v) compatible with python pip install -r
approach (for old-school pythonists). Until now, a CON is: (i) this remove
some poetry macros. Still seems like a good replacement.

The folder structure organization allows you to define test suites in separate
folders (e.g. "florestad", "floresta-cli") without needing to define each of
them in pyproject.toml. Files ending with "-test.py" in each folder will be
recognized and executed.

To comply with above mentioned changes, tests/run_tests.py was modified to
inlcude an argument `--test-suite` that will search for a folder
`tests/<test-suite>`. It was also necessary to change `tests/prepare.sh`
and `tests/run.sh` to replace poetry to uv.

The README helps the developer to: (i) install uv; (ii) configure functional test
environment; (iii) format code; (iv) lint code; (v) run tests.

It also updated .gitignore so it can help to avoid add .venv folder that
is created by uv tool.
@qlrd qlrd force-pushed the uv-dep-management branch from 94d6357 to 9fef5fc Compare March 7, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Generally improves code readability and maintainability dependencies Pull requests that update a dependency file functional tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants