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
26 changes: 26 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[run]
source = src/agentlab
omit =
*/tests/*
*/test_*
*/__pycache__/*
*/venv/*
*/env/*
*/virtualenv/*
setup.py

[report]
exclude_lines =
pragma: no cover
def __repr__
if self.debug:
if settings.DEBUG
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:
class .*\bProtocol\):
@(abc\.)?abstractmethod

[html]
directory = htmlcov
12 changes: 10 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ 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 pytest -n 5 --durations=10 -m 'not pricy' --cov=src/agentlab --cov-report=xml --cov-report=html --cov-report=term-missing -v tests/

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ run-tests:
@MINIWOB_URL="http://localhost:8080/miniwob/" pytest -n 5 --durations=10 -m 'not pricy' tests/
@echo "Tests completed"

run-tests-coverage:
@MINIWOB_URL="http://localhost:8080/miniwob/" pytest -n 5 --durations=10 -m 'not pricy' --cov=src/agentlab --cov-report=html --cov-report=term-missing tests/
@echo "Tests with coverage completed"
@echo "Coverage report available at htmlcov/index.html"

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

lint: setup
@black src/ --check --diff
Expand All @@ -49,4 +55,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"
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dev = [
"blacken-docs",
"pre-commit",
"pytest==7.3.2",
"pytest-cov>=4.0.0",
"flaky",
"pytest-xdist",
"pytest-playwright",
Expand Down Expand Up @@ -109,3 +110,22 @@ hint = [
[project.scripts]
agentlab-assistant = "agentlab.ui_assistant:main"
agentlab-xray = "agentlab.analyze.agent_xray:main"

[tool.coverage.run]
source = ["src/agentlab"]
omit = ["*/tests/*"]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod"
]
fail_under = 70
Loading
Loading