Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

138 Commits

Repository files navigation

geocontext-test

This repository contains an integration test suite designed to validate the correct behavior of the MCP server ignfab/geocontext across different language models.

Purpose

The main goal is to ensure that end-to-end interactions with ignfab/geocontext remain stable and consistent when switching model providers or model versions.

What is tested

  • Agent creation using a configured model name
  • Real model invocation through integration scenarios
  • Functional response checks for expected outputs

Quick Start

See CODING.md for comprehensive setup instructions including:

  • Environment configuration and API key setup
  • Running tests with different models
  • Testing a local version of geocontext
  • Debugging and troubleshooting

Reports

Generated with geocontext v0.9.8 :

About ERP, see gpf-schema-store#48 and gpf-schema-store#56

Running the tests also writes the details of each conversation to reports/<model>/<test name>.txt (not versioned, see CODING.md).

Usage

Testing with reports

export ANTHROPIC_API_KEY=YourKey
# to run with some anthropic model
uv run scripts/run_tests.py config/models-anthropic.yaml
# to rerun with a single model
uv run scripts/run_tests.py config/models-anthropic.yaml --model=claude-haiku-4-5

Testing with anthropic models

export MODEL_NAME="anthropic:claude-sonnet-4-6"export ANTHROPIC_API_KEY=YourKey
uv run pytest

Testing with google models

export MODEL_NAME="google_genai:gemini-3.5-flash"export GOOGLE_API_KEY=YourKey
uv run pytest
export MODEL_NAME="google_genai:gemini-3.1-flash-lite-preview"export GOOGLE_API_KEY=YourKey
uv run pytest

Tests

Tests directs (un seul outil)

TestFichierOutilDescription
test_france_capitaltest_france_capital.pyaucun (LLM seul)Test basique sans MCP — vérifie que le LLM répond "Paris"
test_geocodetest_geocode.pygeocodeCoordonnées du 1 rue de Rivoli, Paris
test_altitudetest_altitude.pyaltitudeAltitude au point (6.87, 45.92) — zone de Chamonix (~1000m)
test_adminexpresstest_adminexpress.pyadminexpressCommune/département à partir de coordonnées (2.35, 48.85) → Paris, 75
test_cadastretest_cadastre.pycadastreParcelle cadastrale au 73 av. de Paris, Saint-Mandé
test_urbanismetest_urbanisme.pyurbanismeRègles d'urbanisme pour la parcelle 94067000AI0042
test_assiette_suptest_assiette_sup.pyassiette_supServitudes d'utilité publique aux coordonnées (4.83, 45.76) — Lyon
test_describe_typetest_describe_type.pygpf_wfs_describe_typeAttributs de la table BDTOPO_V3:batiment
test_get_featurestest_get_features.pygpf_wfs_get_featuresBâtiments BDTOPO proches de Chamonix
test_get_feature_by_idtest_get_feature_by_id.pygpf_wfs_get_feature_by_idObjet commune.8952 → Aurel (INSEE 26019)
test_search_batimenttest_search_batiment.pygpf_wfs_search_typesRecherche de tables contenant des bâtiments
test_search_ecolestest_search_ecoles.pygpf_wfs_search_typesRecherche de tables contenant des écoles

Tests de chaînage (multi-outils)

TestFichierChaîne d'outilsDescription
test_chaining_geocodetest_chaining_geocode_altitude.pygeocodealtitudeAltitude de la mairie de Chamonix (~1036m)
test_chaining_geocode_adminexpresstest_chaining_geocode_adminexpress.pygeocodeadminexpress1 rue de Rivoli → commune/département
test_chaining_geocode_assiette_suptest_chaining_geocode_assiette_sup.pygeocodeassiette_sup10 place Bellecour, Lyon → servitudes
test_chaining_cadastre_urbanismetest_chaining_cadastre_urbanisme.pygeocodecadastreurbanismeAdresse → parcelle → règles PLU
test_chaining_discoverytest_chaining_discovery.pygpf_wfs_search_typesgpf_wfs_describe_typegpf_wfs_get_featuresDécouverte complète : cours d'eau à Toulouse

Tests négatifs

TestFichierDescription
test_geocode_address_not_foundtest_geocode_address_not_found.pyAdresse fictive — vérifie que l'agent signale l'absence de résultat

Cas critiques non couverts

CasCriticitéDescription
Adresse ambiguëMoyennePas de test avec une adresse qui matche plusieurs résultats (ex: "rue de la République" sans ville)
DOM-TOM / Outre-merMoyennePas de test sur les territoires ultramarins (Réunion, Guadeloupe)
Erreur réseau / tool error recoveryBassePas de test sur la capacité de l'agent à retenter après une erreur d'outil

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages