chore: Parallelize pytest runs #889
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: debug traces don't work since pytest-xdist spawns multiple processes, this PR also adds new
-debug
commands to run pytests without the-n
flagAI Description
This PR introduces several changes to the project's testing infrastructure, focusing on unit tests and community tests. It adds new dependencies, modifies test assertions, and enhances error logging.
run-unit-tests-debug
andrun-community-tests-debug
commands enable more detailed testing and debugging.poetry.lock file has been updated with new dependencies:
execnetand
pytest-xdist. These additions are reflected in the
pyproject.toml` file, ensuring consistent dependency management.src/backend/tests/unit/tools/test_lang_chain.py
, the test assertions have been modified to use theToolError
class frombackend.tools.base
. This change provides more informative error messages and a consistent error handling approach.src/backend/tools/base.py
file has been updated to include anevent
keyword argument in the error logging statement. This enhancement provides additional context when logging errors, making debugging more efficient.src/backend/tests/unit/README.md
file has been updated to reflect the new testing commands and provide guidance on writing unit tests.