Add Unit Tests (#4)
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user