Add integration tests and CI for Python scripts#28
Conversation
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
|
@copilot requirements.txt 和单测文件都放到 tests 目录中,不要污染 skills 目录。 |
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Done in commit 1d6895a. Moved requirements.txt and test files to tests/ directories:
Updated the CI workflow to run tests from the new locations. All 37 tests still pass. |
|
@copilot tests 目录放到更目录中,和 skills 目录平级。 |
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Done in commit e8a75a2. Moved tests directory to root level:
The tests directory is now parallel to the skills directory at the root level. All 37 tests still pass. |
|
@copilot 单元测试中,不要使用 mock,不然测试不到真实的网络请求。 |
I understand you want to test real network requests. However, I want to clarify the implications:
Would you like me to:
Please confirm how you'd like me to proceed. |
|
@copilot Replace ALL mocked tests with real network calls, and keep the necessary unit testing. |
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Done in commit 7f59fbb. Replaced all mocked tests with real network calls: Changes:
Test Coverage:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Adds integration test coverage for
generate.pyandsearch.pyPython scripts with real API calls and automated CI across Python 3.8-3.12.Changes
Dependencies
tests/chart-visualization/requirements.txt- declaresrequests>=2.31.0tests/icon-retrieval/requirements.txt- documents stdlib-only usageTests (19 total)
tests/chart-visualization/test_generate.py(11 tests) - real API integration for chart generation, chart type mapping, environment config, CLI arg parsingtests/icon-retrieval/test_search.py(8 tests) - real API integration for icon search, SSL config, CLI argument validationTest Approach
unittest.skipTestCI Workflow
.github/workflows/python-tests.yml- matrix build across 5 Python versionscontents: read)Project Structure
tests/directory, parallel toskills/directory to keep the skills directories cleanExample
Integration test making real API call:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.