[P] Add general smoke test and Store incremental test
Some checks failed
Component testing / Hub testing (push) Successful in 23s
Component testing / Store testing (push) Successful in 20s
Component testing / Integration smoke testing (push) Failing after 1m23s

This commit is contained in:
2026-03-23 17:03:17 +02:00
parent 60a846d8b8
commit 16b8fe9d56
6 changed files with 135 additions and 8 deletions

View File

@@ -73,15 +73,11 @@ async def send_data_to_subscribers(user_id: int, data):
# FastAPI CRUDL endpoints
@app.post("/processed_agent_data/")
async def create_processed_agent_data(data: List[ProcessedAgentData], user_id: int = Body(..., embed=True)):
session = SessionLocal()
try:
created_data = [
def ProcessedAgentData_to_td(data: List[ProcessedAgentData]):
return [
{
"road_state": item.road_state,
"user_id": user_id,
"user_id": item.agent_data.user_id,
"x": item.agent_data.accelerometer.x,
"y": item.agent_data.accelerometer.y,
"z": item.agent_data.accelerometer.z,
@@ -91,6 +87,13 @@ async def create_processed_agent_data(data: List[ProcessedAgentData], user_id: i
}
for item in data
]
@app.post("/processed_agent_data/")
async def create_processed_agent_data(data: List[ProcessedAgentData], user_id: int = Body(..., embed=True)):
session = SessionLocal()
try:
created_data = ProcessedAgentData_to_td(data)
stmt = processed_agent_data.insert().values(created_data).returning(processed_agent_data)
result = session.execute(stmt)
created_records = [dict(row._mapping) for row in result.fetchall()]