Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Juan-Carlos-Cruz/robotaxi-zoox/llms.txt

Use this file to discover all available pages before exploring further.

The Robotaxi Zoox test suite validates the correctness of every search algorithm without requiring Pygame, a graphical display, or a running audio device. The tests import the world model and algorithm wrappers directly, load a real map file from disk, and verify that solutions are found and that the returned metrics make sense. This makes the suite safe to run in CI pipelines, Docker containers, and headless servers where no display is available.

Running all tests

The recommended way to run the full suite is through the make target:
make test
This invokes scripts/test.sh, which locates a usable Python interpreter, creates or reuses a virtual environment, installs pygame if it is not already present, and then delegates to scripts/bootstrap.py test to execute every test file. You can also call the shell script directly:
bash scripts/test.sh
On Windows, use the equivalent batch launcher instead:
launchers\windows\test.bat

What the tests cover

The suite is composed of three test files inside the tests/ directory.

test_bfs.py

This is the primary algorithm validation file. It loads mapas/test/Prueba1.txt via leer_mapa, constructs a Grid, and sequentially runs all five search algorithms:
  • BFS (busqueda_no_informada with "bfs") — breadth-first search; finds the shallowest solution.
  • UCS (busqueda_no_informada with "ucs") — uniform-cost search; finds the minimum-cost solution.
  • DFS (busqueda_no_informada with "dfs") — depth-first search with cycle avoidance.
  • A* (busqueda_informada with "a_estrella") — also verifies that all passengers are collected and that the path ends at the correct destination cell.
  • Greedy / Avara (busqueda_informada with "avara") — also verifies passenger collection and destination correctness.
For each algorithm the script prints whether a solution was found along with its key metrics (path, nodes expanded, depth, cost). For the informed algorithms it additionally checks that resultado['camino'][-1] == grid.destino and that every passenger cell appears in the returned path.

test_grid.py

Exercises the Grid class directly via probar_grid. Checks performed include:
  • Cell detectiones_valida(0, 0) returns True; es_valida(10, 10) returns False.
  • Transitabilityes_transitable(0, 0) returns True; es_transitable(0, 1) returns False for a wall cell.
  • Movement costcosto_movimiento(0, 0) returns 1 (normal road); costo_movimiento(1, 6) returns 7 (FLUJO_ALTO cell).
  • Neighbour generationget_vecinos is called on the start node and the resulting positions are printed for manual inspection.

test_visualizer.py

Exercises the full rendering pipeline end-to-end. It loads a map via leer_mapa, constructs a Grid, runs A* via busqueda_informada, then instantiates Visualizador and calls vis.animar_camino to animate the solution path. Because it opens a Pygame window and drives the animation loop, this file requires a graphical display and is intended to be run interactively rather than in a headless CI environment.

Example console output

A successful run of test_bfs.py produces output similar to the following:
✅ BFS - Solución encontrada!
Camino: [(2, 0), ...]
Nodos expandidos: 142
Profundidad: 28
Costo: 28
✅ bcu - Solución encontrada!
Camino: [(2, 0), ...]
Nodos expandidos: 136
Profundidad: 28
Costo: 28
✅ dfs - Solución encontrada!
Camino: [(2, 0), ...]
Nodos expandidos: 58
Profundidad: 44
Costo: 44
Informed algorithm blocks (A* and Greedy) additionally print passenger and destination verification:
✅ SOLUCIÓN ENCONTRADA
Costo: 35
Nodos expandidos: 87
Profundidad: 31
Pasos: 32

Pasajeros recogidos: [(1, 4)]
✅ Todos los pasajeros fueron recogidos
✅ Termina en destino correcto

Running a specific test file directly

You can bypass the make wrapper and run a single test module with the Python interpreter. This is useful when iterating on a specific algorithm and you want a faster feedback loop:
python3 tests/test_bfs.py
python3 tests/test_grid.py
Make sure you run these from the project root directory so that the sys.path manipulation inside each file resolves the mundo and algoritmosBusqueda packages correctly.

Diagnostics

If the test run fails due to a missing dependency or an incompatible Python version, run the doctor command to get a checklist:
make doctor
Or call the script directly:
bash scripts/doctor.sh
The doctor script checks:
  • Python version compatibility
  • tkinter availability (required for the map file dialog in the GUI)
  • pygame installation
  • Whether a graphical display is available (not required for make test, but needed for make run)
Use make test in CI environments — it exercises BFS, UCS, DFS, A*, and Greedy against a real map file and verifies correctness of paths, passenger collection, and destination arrival, all without any GUI dependency.

Build docs developers (and LLMs) love