-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add math test #555
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
Add math test #555
Changes from all commits
d39e293
84c303c
a11831a
b759541
6e34f78
69b253a
44bf6fa
7e4cbb7
05e4cf1
63c6320
6e0324b
c80e366
3210eee
86ae46d
189a4d3
c0dfd3d
9396960
9735537
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ on: | |
| - 'setup.py' | ||
|
|
||
| jobs: | ||
| RetrieveChatTest: | ||
| OpenAI4ContribTests: | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest] | ||
|
|
@@ -37,19 +37,38 @@ jobs: | |
| pip install -e . | ||
| python -c "import autogen" | ||
| pip install coverage pytest-asyncio | ||
| - name: Install packages for test when needed | ||
| - name: Install packages for Retrievechat | ||
| run: | | ||
| pip install docker | ||
| pip install qdrant_client[fastembed] | ||
| pip install -e .[retrievechat] | ||
| - name: Coverage | ||
| - name: Coverage Retrievechat | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} | ||
| AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }} | ||
| OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }} | ||
| run: | | ||
| coverage run -a -m pytest test/agentchat/contrib/test_retrievechat.py test/agentchat/contrib/test_qdrant_retrievechat.py | ||
|
|
||
| - name: Install packages for MathChat | ||
| id: install_mathchat | ||
| if: ${{ always() }} | ||
| run: | | ||
| pip install docker | ||
| pip install -e .[mathchat] | ||
| - name: Coverage MathChat | ||
| if: ${{ always() && steps.install_mathchat.outcome == 'success' }} | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} | ||
| AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }} | ||
| OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }} | ||
| run: | | ||
| coverage run -a -m pytest test/agentchat/contrib/test_math_user_proxy_agent.py | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like the output of coverage run will overwrite the output of the former step. In the end, only one step of coverage will be uploaded.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we add different names to the output of different steps and combine them at the upload step?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
| - name: convert coverage to xml | ||
| run: | | ||
| coverage xml | ||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v3 | ||
|
|
||
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.
One problem with this approach is that the previous installed dependencies will remain in the later steps. That makes the test environment not clean for later steps. Is it possible to reset the environment for later steps?
Uh oh!
There was an error while loading. Please reload this page.
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.
I haven't found any good way to clear up the environment. A possible solution is to use virtual env, but different os needs different syntax, which makes it complex. The other way is just putting them in different jobs.
I guess there are two problems to consider here:
pip install autogen[retrievechat, mathchat], and they expect things just work?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.
I think it's pretty important for the automatic jobs to test different contributed agents in different environments, each with just its own dependencies, whether this is done through separate virtual envs, different jobs, or some other mechanism. Wish I had more experience in setting up such tests.
Uh oh!
There was an error while loading. Please reload this page.
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.
will test all files in the contrib folder, while only dependencies for Retrievechat is installed. This will result in error in the future if a contrib agent requires other packages to be installed.
https://github.com/microsoft/autogen/blob/fda7a39dd9ede1c115d37c2a454f55b7f22c8193/.github/workflows/contrib-tests.yml#L52C38-L52C38