Merge branch 'swiftyos/open-2791-featplatform-add-easy-test-data-creation' into dev

This commit is contained in:
Swifty
2025-10-18 12:28:17 +02:00
2 changed files with 18 additions and 4 deletions

View File

@@ -8,6 +8,11 @@ start-core:
stop-core:
docker compose stop deps
reset-db:
rm -rf db/docker/volumes/db/data
cd backend && poetry run prisma migrate deploy
cd backend && poetry run prisma generate
# View logs for core services
logs-core:
docker compose logs -f deps
@@ -35,13 +40,18 @@ run-backend:
run-frontend:
cd frontend && pnpm dev
test-data:
cd backend && poetry run python test/test_data_creator.py
help:
@echo "Usage: make <target>"
@echo "Targets:"
@echo " start-core - Start just the core services (Supabase, Redis, RabbitMQ) in background"
@echo " stop-core - Stop the core services"
@echo " reset-db - Reset the database by deleting the volume"
@echo " logs-core - Tail the logs for core services"
@echo " format - Format & lint backend (Python) and frontend (TypeScript) code"
@echo " migrate - Run backend database migrations"
@echo " run-backend - Run the backend FastAPI server"
@echo " run-frontend - Run the frontend Next.js development server"
@echo " run-frontend - Run the frontend Next.js development server"
@echo " test-data - Run the test data creator"

View File

@@ -21,6 +21,7 @@ import random
from datetime import datetime
import prisma.enums
import pytest
from autogpt_libs.api_key.keysmith import APIKeySmith
from faker import Faker
from prisma import Json, Prisma
@@ -498,9 +499,6 @@ async def main():
if store_listing_versions and random.random() < 0.5
else None
),
"agentInput": (
Json({"test": "data"}) if random.random() < 0.3 else None
),
"onboardingAgentExecutionId": (
random.choice(agent_graph_executions).id
if agent_graph_executions and random.random() < 0.3
@@ -570,5 +568,11 @@ async def main():
print("Test data creation completed successfully!")
@pytest.mark.asyncio
@pytest.mark.integration
async def test_main_function_runs_without_errors():
await main()
if __name__ == "__main__":
asyncio.run(main())