Skip to content

Testing

Benson King'ori edited this page Jun 11, 2025 · 2 revisions

Our project uses pytest for automated backend testing and an interactive playground for debugging individual AI agents.

Running the Django Unit & Integration Tests

We have a collection of unit tests for the Django application's models and business logic. A helper script is provided to run all tests easily.

  1. Ensure Docker Containers are Running: If your services aren't running, start them with docker-compose up.

  2. Execute the Test Script: From the root directory of the project, run the run_tests.sh script.

    ./run_tests.sh

    This script executes pytest inside the web container and will run all tests found in the users and scans apps. It will print a detailed report of passing and failing tests.

Testing AI Agents Locally

Testing the multi-agent orchestration requires running both the OrchestratorAgent and its "worker" agents simultaneously on your local machine.

Step 1: Run the Worker Agent (e.g., WebSearchAgent)

The worker agent must be running first so the orchestrator has an endpoint to call.

  1. Open Terminal 1.
  2. Navigate to the worker agent's directory: cd agents/websearchagent/.
  3. Run the local playground. It will start on its default port (e.g., 8501).
    make playground
  4. Keep this terminal running.

Step 2: Run the Orchestrator Agent

  1. Open a new terminal (Terminal 2).
  2. Navigate to the orchestrator's directory: cd agents/orchestratoragent/.
  3. Run its playground. The Makefile for the orchestrator is configured to use a different port (e.g., 8502) to avoid conflicts.
    make playground
  4. Keep this terminal running.

Step 3: Interact with the Orchestrator

  • You now have two agent servers running locally.
  • Open your web browser and go to the Orchestrator's UI address (e.g., http://localhost:8502).
  • When you submit a prompt to the orchestrator, you can watch both terminal windows to see the log output as the orchestrator makes an API call to the worker agent. This is the primary way to debug the full multi-agent workflow.

Clone this wiki locally