Skip to content

Commit 156da8e

Browse files
feat: Implement a new database connection verification script and update CI to use it with Python 3.13.
1 parent b0986dc commit 156da8e

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up Python
2424
uses: actions/setup-python@v4
2525
with:
26-
python-version: "3.11"
26+
python-version: "3.13"
2727

2828
- name: Install backend dependencies
2929
run: |
@@ -41,7 +41,9 @@ jobs:
4141
4242
- name: Verify Backend APIs
4343
run: |
44-
python backend/app/routes/api/v1/health.py
44+
cd backend
45+
export PYTHONPATH=$(pwd)
46+
python app/routes/api/v2/verify_db.py
4547
4648
frontend-build:
4749
runs-on: ubuntu-latest
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import asyncio
2+
from motor.motor_asyncio import AsyncIOMotorClient
3+
from app.core.config import settings
4+
5+
async def verify():
6+
print(f"Connecting to {settings.MONGODB_URL}...")
7+
try:
8+
client = AsyncIOMotorClient(settings.MONGODB_URL)
9+
await client.admin.command('ping')
10+
print("SUCCESS: Connection verified!")
11+
except Exception as e:
12+
print(f"FAILURE: {e}")
13+
14+
if __name__ == "__main__":
15+
asyncio.run(verify())

0 commit comments

Comments
 (0)