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

[Tool Test] Add test for tools #273

Merged
merged 18 commits into from
Jan 10, 2024

Conversation

wj-Mcat
Copy link
Collaborator

@wj-Mcat wj-Mcat commented Jan 8, 2024

No description provided.

@@ -3,3 +3,6 @@ pytest == 7.4.2
pytest-asyncio
pytest-cov
uvicorn
pymupdf
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ScraperTool 的有依赖这几个

@@ -36,11 +36,11 @@ def avaliable_free_port(self, exclude=None):
raise ValueError("can not get valiable port in [8000, 8200]")

def setUp(self) -> None:
from multiprocessing import Process
from threading import Thread
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

用线程额方式来测试,否则单测覆盖率检测不到子进程中的代码覆盖情况


class Config:
use_enum_values = True
model_config = ConfigDict(use_enum_values=True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pydantic 2.0 里面已经不推荐 config-class base 的配置方法,所以调整了。

Comment on lines +16 to +17
from langchain_community.document_loaders import PyMuPDFLoader
from langchain_community.retrievers import ArxivRetriever
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个应该是比较近期的改动。需要在我们的requirements.txt里面加入对于langchain >= 拆分后的版本吗?

check_json_length(fake_json_data)


def test_tool_string_format():
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个测试和remote toolkit没啥关系呀

@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.15%. Comparing base (6fbc099) to head (7d66f25).
Report is 47 commits behind head on develop.

Files Patch % Lines
...bot-agent/src/erniebot_agent/tools/tool_manager.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #273      +/-   ##
===========================================
+ Coverage    69.37%   72.15%   +2.78%     
===========================================
  Files           63       63              
  Lines         3236     3229       -7     
===========================================
+ Hits          2245     2330      +85     
+ Misses         991      899      -92     

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

Comment on lines 22 to 23
print(cur_time)
print(tool)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@sijunhe sijunhe merged commit ed42aa0 into PaddlePaddle:develop Jan 10, 2024
4 of 5 checks passed
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