Skip to content

Commit 1427c8c

Browse files
vadikko2Π’Π°Π΄ΠΈΠΌ ΠšΠΎΠ·Ρ‹Ρ€Π΅Π²ΡΠΊΠΈΠΉcoderabbitai[bot]
authored
Add new banchmarks (#52)
* Added new speed banchmarks * Fixes after pre-commit * Separate dataclasses and pydantic banchmarks * Fixes after pre-commit * πŸ“ Add docstrings to `add-new-banchmarks` (#53) Docstrings generation was requested by @vadikko2. * #52 (comment) The following files were modified: * `benchmarks/dataclasses/test_benchmark_cor_request_handler.py` * `benchmarks/dataclasses/test_benchmark_event_handling.py` * `benchmarks/dataclasses/test_benchmark_request_handling.py` * `benchmarks/dataclasses/test_benchmark_saga_fallback.py` * `benchmarks/dataclasses/test_benchmark_saga_memory.py` * `benchmarks/dataclasses/test_benchmark_saga_sqlalchemy.py` * `benchmarks/dataclasses/test_benchmark_stream_request_handler.py` * `benchmarks/pydantic/test_benchmark_cor_request_handler.py` * `benchmarks/pydantic/test_benchmark_event_handling.py` * `benchmarks/pydantic/test_benchmark_request_handling.py` * `benchmarks/pydantic/test_benchmark_saga_fallback.py` * `benchmarks/pydantic/test_benchmark_saga_memory.py` * `benchmarks/pydantic/test_benchmark_saga_sqlalchemy.py` * `benchmarks/pydantic/test_benchmark_serialization.py` * `benchmarks/pydantic/test_benchmark_stream_request_handler.py` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update ci files * move banchmark tests * Try to fix banchmarks * Try to fix banchmarks * Try to fix banchmarks --------- Co-authored-by: Π’Π°Π΄ΠΈΠΌ ΠšΠΎΠ·Ρ‹Ρ€Π΅Π²ΡΠΊΠΈΠΉ <v.kozyrevskiy@timeweb.ru> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent a6c7dd0 commit 1427c8c

26 files changed

Lines changed: 4300 additions & 21 deletions

β€Ž.github/workflows/codspeed.ymlβ€Ž

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,42 @@ jobs:
2929
python -m pip install --upgrade pip
3030
pip install -e ".[dev]"
3131
32+
- name: Start infrastructure
33+
run: |
34+
docker compose -f docker-compose-test.yml up -d
35+
36+
- name: Wait for MySQL
37+
run: |
38+
for i in $(seq 1 30); do
39+
if docker compose -f docker-compose-test.yml exec -T mysql_tests mysqladmin ping -h localhost -ucqrs -pcqrs --silent 2>/dev/null; then
40+
echo "MySQL is ready"
41+
exit 0
42+
fi
43+
echo "Waiting for MySQL... ($i/30)"
44+
sleep 2
45+
done
46+
echo "MySQL did not become ready in time"
47+
exit 1
48+
49+
- name: Wait for Redis
50+
run: |
51+
for i in $(seq 1 15); do
52+
if docker compose -f docker-compose-test.yml exec -T redis_tests redis-cli ping 2>/dev/null | grep -q PONG; then
53+
echo "Redis is ready"
54+
exit 0
55+
fi
56+
echo "Waiting for Redis... ($i/15)"
57+
sleep 1
58+
done
59+
echo "Redis did not become ready in time"
60+
exit 1
61+
3262
- name: Run benchmarks
3363
uses: CodSpeedHQ/action@v4
3464
with:
3565
mode: simulation
36-
run: pytest benchmarks/ --codspeed
66+
run: pytest -c ./tests/pytest-config.ini tests/benchmarks/ --codspeed
67+
68+
- name: Stop infrastructure
69+
if: always()
70+
run: docker compose -f docker-compose-test.yml down -v

β€Ž.github/workflows/tests.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
121121
- name: Run all tests with coverage
122122
run: |
123-
pytest -c ./tests/pytest-config.ini --cov=src --cov-report=xml --cov-report=term -o cache_dir=/tmp/pytest_cache ./tests
123+
pytest -c ./tests/pytest-config.ini --cov=src --cov-report=xml --cov-report=term -o cache_dir=/tmp/pytest_cache ./tests/unit ./tests/integration
124124
125125
- name: Upload coverage to Codecov
126126
uses: codecov/codecov-action@v4

β€Ž.pre-commit-config.yamlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ repos:
22
- hooks:
33
- id: check-docstring-first
44
- id: check-ast
5-
- exclude: (^tests/mock/|^tests/integration/|^tests/fixtures)
5+
- exclude: (^tests/mock/|^tests/integration/|^tests/fixtures|benchmarks)
66
id: trailing-whitespace
77
- id: end-of-file-fixer
88
- id: check-yaml

β€Žpyrightconfig.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"venvPath": ".",
33
"venv": "venv",
4-
"include": ["src", "tests"],
4+
"include": ["src", "tests", "benchmarks"],
55
"exclude": ["**/__pycache__", "venv", "**/*_pb2.py"],
66
"reportMissingImports": "error",
77
"reportMissingTypeStubs": false,

0 commit comments

Comments
Β (0)