Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,16 @@ jobs:
- name: Pre-download nltk ressources
run: uv run python -c "import nltk; nltk.download('punkt_tab')"

- name: Run AgentLab Unit Tests
- name: Run AgentLab Unit Tests with Coverage
env:
MINIWOB_URL: "http://localhost:8080/miniwob/"
run: uv run pytest -n 5 --durations=10 -m 'not pricy' -v tests/
run: |
uv run python -m coverage run -m pytest -n 5 --durations=10 -m 'not pricy' -v tests/
uv run python -m coverage report
uv run python -m coverage html

- name: Upload Coverage Reports
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ run-tests:
@MINIWOB_URL="http://localhost:8080/miniwob/" pytest -n 5 --durations=10 -m 'not pricy' tests/
@echo "Tests completed"

run-coverage:
@MINIWOB_URL="http://localhost:8080/miniwob/" coverage run -m pytest -n 5 --durations=10 -m 'not pricy' tests/
@coverage report
@coverage html
@echo "Coverage completed - see htmlcov/index.html"

test-coverage: setup miniwob check-miniwob run-coverage stop-miniwob

test: setup miniwob check-miniwob run-tests stop-miniwob

lint: setup
Expand All @@ -49,4 +57,4 @@ osworld:
@echo "Next steps:"
@echo "1. Configure your VM (VMware/VirtualBox) according to OSWorld documentation"
@echo "2. Download or set up the Ubuntu VM image"
@echo "3. Run AgentLab with OSWorld tasks"
@echo "3. Run AgentLab with OSWorld tasks"
25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ dev = [
"flaky",
"pytest-xdist",
"pytest-playwright",
"coverage[toml]>=7.0",
]
# tapeagents = [
# "tapeagents[converters]",
Expand Down Expand Up @@ -109,3 +110,27 @@ hint = [
[project.scripts]
agentlab-assistant = "agentlab.ui_assistant:main"
agentlab-xray = "agentlab.analyze.agent_xray:main"

[tool.coverage.run]
source = ["src"]
omit = [
"*/tests/*",
"*/test_*",
"setup.py",
"*/venv/*",
"*/.venv/*",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
]
show_missing = true
precision = 2

[tool.coverage.html]
directory = "htmlcov"
Loading
Loading