Skip to content

Commit 567218a

Browse files
author
UnicoLab
committed
tests: setting up more tests
1 parent 7c75a93 commit 567218a

14 files changed

Lines changed: 4674 additions & 191 deletions

Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@ help:
1313
@echo " make lint Run linting checks"
1414
@echo " make type-check Run type checking with mypy"
1515
@echo " make test Run tests"
16+
@echo " make test-unit Run unit tests only"
17+
@echo " make test-integration Run integration tests only"
18+
@echo " make test-performance Run performance tests only"
19+
@echo " make test-async Run async tests only"
1620
@echo " make test-parallel Run tests in parallel"
1721
@echo " make test-coverage Run tests with coverage report"
22+
@echo " make test-fast Run fast tests only (exclude slow)"
23+
@echo " make test-all Run all tests including performance"
24+
@echo " make test-ci Run CI test suite"
1825
@echo ""
1926
@echo "Documentation:"
2027
@echo " make docs Build documentation"
@@ -62,6 +69,22 @@ test:
6269
@echo "Running tests..."
6370
pytest tests/ -v
6471

72+
test-unit:
73+
@echo "Running unit tests..."
74+
pytest tests/ -v -m "unit"
75+
76+
test-integration:
77+
@echo "Running integration tests..."
78+
pytest tests/ -v -m "integration"
79+
80+
test-performance:
81+
@echo "Running performance tests..."
82+
pytest tests/ -v -m "performance"
83+
84+
test-async:
85+
@echo "Running async tests..."
86+
pytest tests/ -v -m "async"
87+
6588
test-parallel:
6689
@echo "Running tests in parallel..."
6790
pytest tests/ -v -n auto --dist loadgroup
@@ -71,6 +94,18 @@ test-coverage:
7194
pytest tests/ -v --cov=graphflow --cov-report=html --cov-report=term-missing
7295
@echo "Coverage report generated in htmlcov/index.html"
7396

97+
test-fast:
98+
@echo "Running fast tests only..."
99+
pytest tests/ -v -m "not slow"
100+
101+
test-all:
102+
@echo "Running all tests including performance..."
103+
pytest tests/ -v
104+
105+
test-ci:
106+
@echo "Running CI test suite..."
107+
pytest tests/ -c pytest-fast.ini --cov=graphflow --cov-report=xml --cov-report=html --timeout=180
108+
74109
# Documentation
75110
docs:
76111
@echo "Building documentation..."

UNICOLAB_ADAPTATION_COMPLETE.md

Lines changed: 0 additions & 191 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ dev = [
6969
"pytest-cov>=4.1.0",
7070
"pytest-xdist>=3.3.0",
7171
"pytest-asyncio>=0.21.0",
72+
"pytest-timeout>=2.1.0",
7273
"black>=23.7.0",
7374
"isort>=5.12.0",
7475
"mypy>=1.5.0",

pytest-simple.ini

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[pytest]
2+
testpaths = tests
3+
python_files = test_*.py
4+
python_classes = Test*
5+
python_functions = test_*
6+
addopts =
7+
-v
8+
--tb=short
9+
--strict-markers
10+
--disable-warnings
11+
--cov=graphflow
12+
--cov-report=term-missing
13+
--cov-report=html
14+
--cov-report=xml
15+
--asyncio-mode=auto
16+
markers =
17+
slow: marks tests as slow (deselect with '-m "not slow"')
18+
integration: marks tests as integration tests
19+
unit: marks tests as unit tests
20+
performance: marks tests as performance tests (benchmarks)
21+
async: marks tests as async tests
22+
parallel: marks tests that can run in parallel
23+
asyncio_mode = auto

pytest.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ addopts =
1414
--cov-report=xml
1515
-n auto
1616
--dist loadgroup
17+
--asyncio-mode=auto
1718
markers =
1819
slow: marks tests as slow (deselect with '-m "not slow"')
1920
integration: marks tests as integration tests
2021
unit: marks tests as unit tests
22+
performance: marks tests as performance tests (benchmarks)
23+
async: marks tests as async tests
2124
parallel: marks tests that can run in parallel
25+
asyncio_mode = auto
2226

0 commit comments

Comments
 (0)