Skip to content

Commit b688ebf

Browse files
authored
Merge pull request #8 from MLSAKIIT/test_suite
Add build system configuration and optional dependencies for testing
2 parents 1c8d3af + df4f13b commit b688ebf

File tree

12 files changed

+4274
-3
lines changed

12 files changed

+4274
-3
lines changed

.github/workflows/pr-tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PR Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ '*' ]
6+
7+
jobs:
8+
test:
9+
runs-on: windows-latest
10+
11+
steps:
12+
- name: Checkout PR Branch
13+
uses: actions/checkout@v4
14+
with:
15+
ref: ${{ github.event.pull_request.head.ref }}
16+
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v2
19+
with:
20+
version: "latest"
21+
22+
- name: Install dependencies and run tests
23+
run: |
24+
uv sync --extra test
25+
uv run pytest

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ wheels/
1212
*.key
1313
*.json
1414
*.db
15-
vector_db/
15+
vector_db/
16+
.coverage

backend/backend.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class GameDetectionRequest(BaseModel):
1919
message: Optional[str] = None
2020

2121
class KnowledgeSearchRequest(BaseModel):
22-
game_name: str
2322
query: str
2423
content_types: Optional[List[str]] = None
2524
limit: Optional[int] = 5

pyproject.toml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
15
[project]
26
name = "Hacktober-Fest-2025-Pixly"
37
version = "0.1.0"
@@ -22,3 +26,40 @@ dependencies = [
2226
"pandas>=2.0.0",
2327
"lxml>=4.9.0",
2428
]
29+
30+
[project.optional-dependencies]
31+
test = [
32+
"pytest>=7.4.0",
33+
"pytest-asyncio>=0.21.0",
34+
"pytest-mock>=3.11.0",
35+
"pytest-cov>=4.1.0",
36+
"httpx>=0.24.0",
37+
"pytest-xdist>=3.3.0",
38+
]
39+
40+
[tool.pytest.ini_options]
41+
testpaths = ["tests"]
42+
python_files = ["test_*.py"]
43+
python_classes = ["Test*"]
44+
python_functions = ["test_*"]
45+
addopts = [
46+
"-v",
47+
"--tb=short",
48+
"--strict-markers",
49+
"--disable-warnings",
50+
"--cov=backend",
51+
"--cov-report=term-missing",
52+
"--cov-report=html:htmlcov",
53+
]
54+
markers = [
55+
"unit: Unit tests",
56+
"integration: Integration tests",
57+
"slow: Slow running tests",
58+
"api: API endpoint tests",
59+
]
60+
asyncio_mode = "auto"
61+
62+
[tool.setuptools.packages.find]
63+
where = ["."]
64+
include = ["backend*"]
65+
exclude = ["tests*", "vector_db*", "games_info*"]

0 commit comments

Comments
 (0)