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.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.
Running all tests
The recommended way to run the full suite is through themake target:
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:
What the tests cover
The suite is composed of three test files inside thetests/ 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_informadawith"bfs") — breadth-first search; finds the shallowest solution. - UCS (
busqueda_no_informadawith"ucs") — uniform-cost search; finds the minimum-cost solution. - DFS (
busqueda_no_informadawith"dfs") — depth-first search with cycle avoidance. - A* (
busqueda_informadawith"a_estrella") — also verifies that all passengers are collected and that the path ends at the correct destination cell. - Greedy / Avara (
busqueda_informadawith"avara") — also verifies passenger collection and destination correctness.
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 detection —
es_valida(0, 0)returnsTrue;es_valida(10, 10)returnsFalse. - Transitability —
es_transitable(0, 0)returnsTrue;es_transitable(0, 1)returnsFalsefor a wall cell. - Movement cost —
costo_movimiento(0, 0)returns1(normal road);costo_movimiento(1, 6)returns7(FLUJO_ALTOcell). - Neighbour generation —
get_vecinosis 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 oftest_bfs.py produces output similar to the following:
Running a specific test file directly
You can bypass themake 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:
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:- Python version compatibility
tkinteravailability (required for the map file dialog in the GUI)pygameinstallation- Whether a graphical display is available (not required for
make test, but needed formake run)