Skip to main content
After local validation, test the full system: API endpoint, database persistence, and asynchronous processing. This confirms the components work together as expected.

Test Script Overview

GenAI Launchpad includes requests/send_event.py for end-to-end testing. This script:
1

Loads test data

Reads JSON payloads from the requests/events directory
2

Sends HTTP request

Posts the data to your API endpoint
3

Validates response

Confirms the API returns HTTP 202 (Accepted)
4

Triggers background processing

Celery workers process the workflow asynchronously

Running the Test

Here is the test script implementation:
def load_event(event_file: str):
    with open(EVENTS_DIR / event_file, "r") as f:
        return json.load(f)


def send_event(event_file: str):
    payload = load_event(event_file)
    response = requests.post(BASE_URL, json=payload)

    print(f"Testing {event_file}:")
    print(f"Status Code: {response.status_code}")
    print(f"Response: {response.text}")

    assert response.status_code == 202


if __name__ == "__main__":
    send_event(event_file="invoice.json")
The script expects an HTTP 202 response, indicating the request was accepted for asynchronous processing.

Prerequisites

Before running end-to-end tests, ensure:
  • Docker Running: All containers must be up and running via docker ps
  • API Available: The FastAPI service should be accessible at your configured port
  • Celery Workers: Background workers must be running to process tasks
  • Database Ready: PostgreSQL/Supabase must be initialized with migrations applied

Monitoring Results in Supabase Studio

To view the workflow execution results:
1

Access Supabase Studio

Navigate to http://localhost:8000 in your browser
2

Authenticate

Enter the credentials:
  • Username: supabase
  • Password: supabase
3

View Events Table

  1. Click on the Table Editor tab
  2. Select the events table
  3. View your processed events and their status

Troubleshooting

If events are not processing, check Docker containers (docker ps), Celery worker logs, API availability (try a curl request), and that database migrations are applied.
I