Files
geointel/docs/TEST_STRATEGY.md
Jens faeb58ef6d
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
Initial public release
2026-08-31 21:56:53 +02:00

1.8 KiB

Test Strategy

GeoIntel is data-heavy. Tests must focus on contracts, geospatial correctness, and regression safety.

Test layers

1. Unit tests

Backend:

  • Geometry validation.
  • Area calculation.
  • Dataset metadata extraction wrappers.
  • Analysis formulas.
  • QA/QC metrics.

Frontend:

  • API client methods.
  • Basic component rendering.
  • Empty/loading/error states.

2. Integration tests

  • FastAPI endpoint + database session.
  • Project CRUD.
  • Area creation with valid GeoJSON.
  • Dataset metadata refresh with fixture files.
  • Vector clipping using small fixture polygons.
  • QA/QC using fixture detection/reference polygons.

3. Smoke tests

Minimum commands:

# backend
pytest

# frontend
npm run build
npm run lint

4. Geospatial correctness tests

Use small deterministic fixtures:

  • One AOI polygon.
  • Three building polygons.
  • Two detection polygons.
  • Known intersection results.
  • Expected precision/recall/F1.

No huge geospatial datasets in the repo.

Fixtures

Place lightweight fixtures in:

tests/fixtures/
  geojson/
  rasters/
  vectors/

Large datasets are not committed. Document download/setup in docs/FIXTURE_STRATEGY.md.

Required V1 acceptance tests

  • Create project.
  • Create area from GeoJSON.
  • Upload or register vector fixture.
  • Extract vector metadata.
  • Calculate building stats.
  • Create fake detection fixture through service/test-only path.
  • Run QA/QC against reference polygons.
  • Export QA output as GeoJSON or JSON.

Regression rules

  • Do not remove existing tests to make a pass green.
  • When an endpoint changes, update API contract and frontend client together.
  • If a feature is stubbed because dependency is unavailable, it must return an explicit not_configured state, not silent success.