Add Unit Tests (#4)
This commit is contained in:
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Create a report to help us improve
|
||||
title: '[Bug]:'
|
||||
labels: 'bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**<u>AgentScope-Samples is an open-source project. To involve a broader community, we recommend asking your questions in English.</u>**
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
|
||||
1. You code
|
||||
2. How to execute
|
||||
3. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Error messages**
|
||||
Detailed error messages.
|
||||
|
||||
**Environment (please complete the following information):**
|
||||
|
||||
- AgentScope-Samples
|
||||
- Python Version: [e.g. 3.10]
|
||||
- OS: [e.g. macos, windows]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
13
.github/ISSUE_TEMPLATE/custom.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/custom.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
name: Custom issue template
|
||||
about: Describe this issue template's purpose here.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**<u>AgentScope-Samples is an open-source project. To involve a broader community, we recommend asking your questions in English.</u>**
|
||||
|
||||
|
||||
|
||||
23
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
23
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Suggest an idea for this project
|
||||
title: '[Feature]: '
|
||||
labels: 'enhancement'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**<u>AgentScope-Samples is an open-source project. To involve a broader community, we recommend asking your questions in English.</u>**
|
||||
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
37
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
37
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
## 📝 PR Type
|
||||
|
||||
- [ ] Add new sample
|
||||
- [ ] Update existing sample
|
||||
- [ ] Add new test cases
|
||||
- [ ] Fix test failures
|
||||
- [ ] Documentation/Configuration update
|
||||
|
||||
---
|
||||
|
||||
## 📚 Description
|
||||
|
||||
[Please briefly describe the background, changes, and purpose of this PR. For example:
|
||||
- Added `game_werewolves` to demonstrate XYZ functionality in `agentscope`.
|
||||
- Fixed test failures in `game_test.py` caused by `agentscope` interface changes.
|
||||
- Updated dependency installation instructions in `README.md` of `agentscope-samples`.]
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Testing Validation
|
||||
|
||||
[Please explain how to validate the changes:
|
||||
1. How to run the added/modified test cases?
|
||||
2. Is integration testing with `agentscope` required?
|
||||
3. Has code been formatted (e.g., `pre-commit`)?]
|
||||
|
||||
---
|
||||
|
||||
## ✅ Checklist
|
||||
|
||||
Please complete the following checks before submitting the PR:
|
||||
|
||||
- [ ] All sample code has been formatted with `pre-commit run --all-files`
|
||||
- [ ] All new/modified test cases have passed (run `pytest tests/`)
|
||||
- [ ] Test coverage has not decreased (if applicable)
|
||||
- [ ] Sample code follows `agentscope` best practices (e.g., config management, logging)
|
||||
- [ ] Related documentation in `agentscope-samples` has been updated (e.g., `README.md`)
|
||||
21
.github/workflows/pre-commit.yml
vendored
Normal file
21
.github/workflows/pre-commit.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Pre-commit
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: True
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
OS: ${{ matrix.os }}
|
||||
PYTHON: '3.10'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
37
.github/workflows/test_agent_deep_research.yml
vendored
Normal file
37
.github/workflows/test_agent_deep_research.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: deep_research_runtime_test
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 */3 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Debug directory structure
|
||||
run: |
|
||||
echo "Current directory: $(pwd)"
|
||||
ls -la
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd deep_research/agent_deep_research
|
||||
pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install pytest pytest-asyncio pytest-mock
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
python -m pytest tests/agent_deep_research_test.py -v
|
||||
48
.github/workflows/test_browser_agent_test.yml
vendored
Normal file
48
.github/workflows/test_browser_agent_test.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: BrowserAgent Tests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 */3 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run Tests (Python ${{ matrix.python-version }})
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
python-version:
|
||||
- "3.10"
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Debug directory structure
|
||||
run: |
|
||||
# ✅ Show actual directory structure
|
||||
echo "Current directory: $(pwd)"
|
||||
ls -la
|
||||
|
||||
- name: Setup Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: pip
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
cd browser_agent/agent_browser
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest pytest-asyncio
|
||||
pip install -r requirements.txt
|
||||
|
||||
- name: Run Tests
|
||||
env:
|
||||
DASHSCOPE_API_KEY: ${{ secrets.DASHSCOPE_API_KEY }}
|
||||
run: |
|
||||
# ✅ Ensure test-results directory exists
|
||||
mkdir -p test-results
|
||||
# ✅ Run tests with XML output
|
||||
python -m pytest tests/browser_agent_test.py -v
|
||||
42
.github/workflows/test_browser_use_fullstack_runtime.yml
vendored
Normal file
42
.github/workflows/test_browser_use_fullstack_runtime.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: browser_use_fullstack_runtime_test
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 */3 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Debug directory structure
|
||||
run: |
|
||||
# ✅ Show actual directory structure
|
||||
echo "Current directory: $(pwd)"
|
||||
ls -la
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# ✅ Use validated path from debug output
|
||||
cd browser_use/browser_use_fullstack_runtime/backend
|
||||
pip install pytest pytest-asyncio
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
DASHSCOPE_API_KEY: ${{ secrets.DASHSCOPE_API_KEY }}
|
||||
run: |
|
||||
# ✅ Use validated path from debug output
|
||||
python -m pytest tests/browser_use_fullstack_runtime_test.py -v
|
||||
36
.github/workflows/test_conversational_agents_chatbot.yml
vendored
Normal file
36
.github/workflows/test_conversational_agents_chatbot.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Conversational Agents Chatbot Test
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 */3 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# ✅ Use correct relative path
|
||||
cd conversational_agents/chatbot
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest pytest-asyncio
|
||||
pip install -r requirements.txt
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
DASHSCOPE_API_KEY: ${{ secrets.DASHSCOPE_API_KEY }}
|
||||
run: |
|
||||
# ✅ Use correct relative path
|
||||
python -m pytest tests/conversational_agents_chatbot_test.py -v
|
||||
37
.github/workflows/test_conversational_agents_chatbot_fullstack_runtime_webserver.yml
vendored
Normal file
37
.github/workflows/test_conversational_agents_chatbot_fullstack_runtime_webserver.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Flask API Runtime Test
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 */3 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Debug directory structure
|
||||
run: |
|
||||
echo "Current directory: $(pwd)"
|
||||
ls -la
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd conversational_agents/chatbot_fullstack_runtime/backend
|
||||
pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install pytest pytest-asyncio
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
python -m pytest tests/conversational_agents_chatbot_fullstack_runtime_webserver_test.py -v
|
||||
38
.github/workflows/test_evaluation.yml
vendored
Normal file
38
.github/workflows/test_evaluation.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: ACE Benchmark Evaluation Test
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 */3 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Debug directory structure
|
||||
run: |
|
||||
echo "Current directory: $(pwd)"
|
||||
ls -la
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade pip
|
||||
pip install pytest pytest-asyncio pytest-mock
|
||||
pip install agentscope ray
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
DASHSCOPE_API_KEY: ${{ secrets.DASHSCOPE_API_KEY }}
|
||||
run: |
|
||||
python -m pytest tests/evaluation_test.py -v
|
||||
38
.github/workflows/test_game.yml
vendored
Normal file
38
.github/workflows/test_game.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Run test_game.py
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 */3 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Debug directory structure
|
||||
run: |
|
||||
# ✅ Show actual directory structure
|
||||
echo "Current directory: $(pwd)"
|
||||
ls -la
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.10
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd games/game_werewolves
|
||||
pip install pytest pytest-asyncio
|
||||
pip install -r requirements.txt
|
||||
|
||||
- name: Run game_test.py
|
||||
env:
|
||||
DASHSCOPE_API_KEY: ${{ secrets.DASHSCOPE_API_KEY }}
|
||||
PYTHONPATH: ${{ env.GITHUB_WORKSPACE }}/games/game_werewolves
|
||||
run: |
|
||||
# ✅ Ensure correct working directory
|
||||
python -m pytest tests/game_test.py -v
|
||||
Reference in New Issue
Block a user