-
Notifications
You must be signed in to change notification settings - Fork 70
Re-structured functional tests. #402
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
Conversation
94d6357 to
9fef5fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uv sounds promising, it really is faster than alternatives. If this indeed fixes our nix setup, more than happy to make this change.
Just some minor nits from me. I've ran the tests and works fine
e87cb0b to
0d4618e
Compare
Optmize developer flow and the experience with tests tool through: * a replacement of the current python package management; * a more organized folder tree strucutre inside tests/; and * 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: * built with rust; * faster than poetry; * cleanup some unecessary python dependencies; * more readable pyproject.toml; * compatible with python pip install -r approach (for old-school pythonists). Until now, a CON is: * 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: * install uv; * configure functional test environment; * format code; * lint code; * run tests. It also updated .gitignore so it can help to avoid add .venv folder that is created by uv tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 1beb0be
|
Im up with the changes but, before acking this i have to ask @Davidson-Souza about some CI logic that this Pr implies along with the changes needed for #391. Should linting and formatting fail the test execution ? Youll see the commands to check lint and formatting are included in CI but outside |
This make sense in another workflow, as another checker, triggered before the If it pass, go to |
It should break CI. Perhaps getting the python lint check inside our |
Maybe it will break CI regardless of where it is run if we don't do something like: # .github/workflows/rust.yml
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Prepare environment
run: uv sync --all-extras --dev
- name: Run black formatting
continue-on-error: true # <----------------
run: uv run black --check --verbose ./tests
- name: Run pylint linter
continue-on-error: true # <----------------
run: uv run pylint --verbose ./tests
- name: Install latest nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- name: Run cargo fmt
run: cargo +nightly fmt --all --check
- name: Run cargo clippy
run: cargo +nightly clippy --all-targets -- -D warningsThis could be applied on - name: Run black formatting
continue-on-error: true # <----------------
run: uv run black --check --verbose ./tests
- name: Comment on PR if black failed
if: failure()
uses: thollander/actions-comment-pull-request@v3
with:
message: |
... |
Yeah, the current way it will break. No reason to change IMO |
Okie Dokie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 1beb0be
Improves #252
What is the purpose of this pull request?
Which crates are being modified?
Description
This re-structure aims to optmize developer flow and the experience with tests tool through:
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:
pythonists).
Until now, a CON is:
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-suitethat will search for a foldertests/<test-suite>. It was also necessary to changetests/prepare.shand
tests/run.shto replace poetry to uv.The README helps the developer to:
It also updated .gitignore so it can help to avoid add .venv folder that
is created by uv tool.
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
just lintcargo test