Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

add test data creation to makefile and test it

Swifty3c16de22ef50
diff --git a/autogpt_platform/Makefile b/autogpt_platform/Makefile
index b8a3261fcf..fde25ac136 100644
--- a/autogpt_platform/Makefile
+++ b/autogpt_platform/Makefile
@@ -35,6 +35,9 @@ 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:"
diff --git a/autogpt_platform/backend/test/test_data_creator.py b/autogpt_platform/backend/test/test_data_creator.py
index 6bb3b9c4e2..53a8a5ba50 100644
--- a/autogpt_platform/backend/test/test_data_creator.py
+++ b/autogpt_platform/backend/test/test_data_creator.py
@@ -19,7 +19,7 @@ images: {
import asyncio
import random
from datetime import datetime
-
+import pytest
import prisma.enums
from autogpt_libs.api_key.keysmith import APIKeySmith
from faker import Faker
@@ -498,9 +498,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 +567,14 @@ async def main():
print("Test data creation completed successfully!")
+async def test_main_function_runs_without_errors():
+ try:
+ await main()
+ except Exception as e:
+ assert False, f"main() raised an exception: {e}"
+
+
if __name__ == "__main__":
asyncio.run(main())