Skip to content

Conversation

tianjing-li
Copy link
Collaborator

@tianjing-li tianjing-li commented Dec 30, 2024

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 flag
AI 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.

  • New Testing Commands: The Makefile now includes new commands for running unit and community tests with debugging capabilities. The run-unit-tests-debug and run-community-tests-debug commands enable more detailed testing and debugging.
  • Dependency Updates: The poetry.lock file has been updated with new dependencies: execnetandpytest-xdist. These additions are reflected in the pyproject.toml` file, ensuring consistent dependency management.
  • Test Assertion Changes: In src/backend/tests/unit/tools/test_lang_chain.py, the test assertions have been modified to use the ToolError class from backend.tools.base. This change provides more informative error messages and a consistent error handling approach.
  • Enhanced Error Logging: The src/backend/tools/base.py file has been updated to include an event keyword argument in the error logging statement. This enhancement provides additional context when logging errors, making debugging more efficient.
  • README Update: The src/backend/tests/unit/README.md file has been updated to reflect the new testing commands and provide guidance on writing unit tests.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.84%. Comparing base (131a1a2) to head (6643a47).

Files with missing lines Patch % Lines
src/backend/tests/unit/tools/test_lang_chain.py 33.33% 2 Missing ⚠️
src/backend/tools/base.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #889   +/-   ##
=======================================
  Coverage   77.84%   77.84%           
=======================================
  Files         259      259           
  Lines       11176    11177    +1     
=======================================
+ Hits         8700     8701    +1     
  Misses       2476     2476           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tianjing-li tianjing-li merged commit 2d457df into main Jan 8, 2025
8 checks passed
@tianjing-li tianjing-li deleted the parallelize-tests branch January 8, 2025 17:15
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.

3 participants