Skip to content

CI: Simplify testing by running all tests in a single command #1218

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

Merged
merged 6 commits into from
Apr 18, 2025

Conversation

albertvillanova
Copy link
Member

Simplify testing by running all tests in a single command.

This PR simplifies the CI testing by using a single pytest command to run all tests instead of separate commands for each test file.

This change is the foundation for enabling parallel test execution in a future PR (using pytest-xdist or similar tools), which could significantly reduce CI execution time.

run: |
pytest ./tests/test_default_tools.py
if: ${{ success() || failure() }}
pytest ./tests/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Won't that also run doc tests (pytest ./tests/test_all_docs.py) that we wanted to exclude?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! Let me think how to avoid this... 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

I checked the CI run and the test_all_docs.py were skipped: https://github.com/huggingface/smolagents/actions/runs/14516429844/job/40726458962

tests/test_all_docs.py::TestDocs::test_single_doc[guided_tour] SKIPPED
tests/test_all_docs.py::TestDocs::test_single_doc[index] SKIPPED (re...)
tests/test_all_docs.py::TestDocs::test_single_doc[intro_agents] SKIPPED
tests/test_all_docs.py::TestDocs::test_single_doc[react] SKIPPED (re...)
tests/test_all_docs.py::TestDocs::test_single_doc[tools0] SKIPPED (r...)
tests/test_all_docs.py::TestDocs::test_single_doc[secure_code_execution] SKIPPED
tests/test_all_docs.py::TestDocs::test_single_doc[inspect_runs] SKIPPED
tests/test_all_docs.py::TestDocs::test_single_doc[memory] SKIPPED (r...)
tests/test_all_docs.py::TestDocs::test_single_doc[building_good_agents] SKIPPED
tests/test_all_docs.py::TestDocs::test_single_doc[tools1] SKIPPED (r...)
tests/test_all_docs.py::TestDocs::test_single_doc[models] SKIPPED (r...)
tests/test_all_docs.py::TestDocs::test_single_doc[agents] SKIPPED (r...)
tests/test_all_docs.py::TestDocs::test_single_doc[text_to_sql] SKIPPED
tests/test_all_docs.py::TestDocs::test_single_doc[multiagents] SKIPPED
tests/test_all_docs.py::TestDocs::test_single_doc[rag] SKIPPED (requ...)
tests/test_all_docs.py::TestDocs::test_single_doc[web_browser] SKIPPED

I checked the test_all_docs.py file and the reason is that these tests are marked with @require_run_all. So no further fix is needed!

@albertvillanova albertvillanova merged commit dacb076 into huggingface:main Apr 18, 2025
3 checks passed
@albertvillanova albertvillanova deleted the run-all-tests branch April 18, 2025 11:59
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