You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is a place to stash notes about testing the backend APIs, in particular to support testing endpoints that require custom database migrations not included in the dockerfile and test data not yet included in the project.
{"id":"itemless-collection", "title": "Test collection without items", "description":"An itemless collection.","stac_version":"1.0.0","license":"public-domain","links":[],"extent":{"spatial":{"bbox":[[-180,-90,180,90]]},"temporal":{"interval":[["2005-01-01T00:00:00Z","null"]]}}}
Subset collection
A subset limited-spatial-extent-collection with a smaller spatial and temporal extent than the noaa-emergency-response collection
limited-spatial-extent-collection.json
{"id":"limited-spatial-extent-collection", "title": "Collection with small spatial extent", "description":"Test collection with small spatial extent.","stac_version":"1.0.0","license":"public-domain","links":[],"extent":{"spatial":{"bbox":[[-86.9501, 36.1249, -86.4499, 36.2251]]},"temporal":{"interval":[["2020-03-10T00:00:00Z","2020-03-11T00:00:00Z"]]}}}
With the local stack running and data in postgres, the tests in .github/workflows/tests can be run with pytest.
Sample requests
These example requests require loading the noaa-emergency-response and limited-spatial-extent-collection collections and corresponding items. The examples are for the collection-id-search endpoint which is not yet tested in the github workflows. The request format and queries should be interchangeable with the item /search endpoint [POST].
What
This issue is a place to stash notes about testing the backend APIs, in particular to support testing endpoints that require custom database migrations not included in the dockerfile and test data not yet included in the project.
Running locally
Install requirements
Start up a local stack
The local stac-api should be running on 8081 and the raster-api should be running on 8082 (you can confirm these ports in docker-compose.yml).
Loading data
With your app running locally, ingest some STAC records following the github actions test workflow in .github/workflows/pr.yml.
Additional test collections and items can be loaded using the same pypgstac commands as the github actions, for example:
A collection with 0 items
itemless-collection.json
Subset collection
A subset
limited-spatial-extent-collection
with a smaller spatial and temporal extent than the noaa-emergency-response collectionlimited-spatial-extent-collection.json
limited-spatial-extent-items.json
Run tests
With the local stack running and data in postgres, the tests in .github/workflows/tests can be run with
pytest
.Sample requests
These example requests require loading the noaa-emergency-response and limited-spatial-extent-collection collections and corresponding items. The examples are for the collection-id-search endpoint which is not yet tested in the github workflows. The request format and queries should be interchangeable with the item
/search
endpoint [POST].Collection-id-search no filters
All collections with items
Collection-id-search temporal filter
One collection excluded by datetime filter
Collection-id-search spatial filter
Spatial filter excludes one collection
The text was updated successfully, but these errors were encountered: