Skip to content

Commit 0b275f3

Browse files
committed
Test postgres
1 parent 84e4609 commit 0b275f3

File tree

7 files changed

+36
-5
lines changed

7 files changed

+36
-5
lines changed

.github/workflows/main.yml

+27
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
push:
77
branches:
88
- main
9+
- feature/pytest
910
pull_request:
1011

1112
jobs:
@@ -26,6 +27,32 @@ jobs:
2627

2728
- name: Run Ruff
2829
run: ruff check backend # Lint the entire repository
30+
31+
- name: Run Ruff
32+
run: ruff check backend # Lint the entire repository
33+
backend-test:
34+
runs-on: ubuntu-latest
35+
services:
36+
# Label used to access the service container
37+
postgres:
38+
# Docker Hub image
39+
image: postgres
40+
# Provide the password for postgres
41+
env:
42+
POSTGRES_PASSWORD: postgres
43+
# Set health checks to wait until postgres has started
44+
options: >-
45+
--health-cmd pg_isready
46+
--health-interval 10s
47+
--health-timeout 5s
48+
--health-retries 5
49+
steps:
50+
- name: Check out repository code
51+
uses: actions/checkout@v4
52+
53+
- uses: eifinger/setup-rye@v4
54+
- name: Run tests
55+
run: rye run pytest
2956
frontend-lint:
3057
runs-on: ubuntu-latest
3158

backend/app/main.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
from .app import app
2-
3-
__all__ = [app]

backend/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies = [
2020
"psycopg2>=2.9.10",
2121
"sqlalchemy-utils>=0.41.2",
2222
"pydantic-settings>=2.6.0",
23+
"mypy>=1.13.0",
2324
]
2425
readme = "README.md"
2526
requires-python = ">= 3.8"

backend/requirements-dev.lock

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ markupsafe==3.0.2
7272
mdurl==0.1.2
7373
# via markdown-it-py
7474
mypy==1.13.0
75+
# via task-management
7576
mypy-extensions==1.0.0
7677
# via black
7778
# via mypy

backend/requirements.lock

+5
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ markupsafe==3.0.2
6868
# via jinja2
6969
mdurl==0.1.2
7070
# via markdown-it-py
71+
mypy==1.13.0
72+
# via task-management
73+
mypy-extensions==1.0.0
74+
# via mypy
7175
packaging==24.1
7276
# via pytest
7377
passlib==1.7.4
@@ -125,6 +129,7 @@ typer==0.12.5
125129
# via fastapi-cli
126130
typing-extensions==4.12.2
127131
# via fastapi
132+
# via mypy
128133
# via pydantic
129134
# via pydantic-core
130135
# via sqlalchemy

backend/tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from sqlmodel import Session
77

88
from app.main import app
9-
from backend.app.users.models import User
9+
from app.users.models import User
1010
from app.auth import get_current_active_user, hash_password
1111
from app.db import (
1212
get_engine,

backend/tests/test_tasks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from fastapi.testclient import TestClient
22
from sqlmodel import Session
3-
from backend.app.tasks.models import Task
3+
from app.tasks.models import Task
44

55

66
def test_create_task(client: TestClient):

0 commit comments

Comments
 (0)