Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ways committed Nov 29, 2024
1 parent f66930b commit c48c7f0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## What is sedr?

An experimental validator for OGC EDR APIs using schemathesis. Main focus will be on the Rodeo Profile, which is a subset of the OGC EDR API.
An experimental validator for OGC EDR APIs. Main focus will be on the Rodeo Profile, which is a subset of the OGC EDR API.

## Who is responsible?

Expand Down Expand Up @@ -40,6 +40,10 @@ Run manually as noted in [Test it out](#test-it-out), or add it to your CI using

## Overview of architecture

- __init__ includes tests from ogcapi, edrreq and rodeoprofile at startup. Tests are categorized as landing, conformance and collection.
- Landing and conformance tests are run first, in the preflight phase.
- Then schemathesis will validate the OpenAPI spec and run lots of automatic tests, including fuzzing of query parameters. Collection tests are run during this phase.

## Documentation

### Limitations
Expand All @@ -48,9 +52,13 @@ Run manually as noted in [Test it out](#test-it-out), or add it to your CI using
- Assuming OGC EDR API version 1.2 (draft)
- Few, basic tests for now
- Will focus more on profiles (limitations within the EDR spec) like <https://github.com/EURODEO/rodeo-edr-profile> than the full EDR spec.
- Use --rodeo-profile to force a test against the profile (will happen automatically if conformance includes the profile)
- Use --rodeo-profile to force a test against the profile

### Testing the sedr code to look for regressions

For development, source a venv and run `tox p` to run all tests.

### Understanding errors
### Understanding errors from schemathesis

For each "FAILED" line, you can scroll back to see the full error and, if relevant, with a curl-example to reproduce it.

Expand Down Expand Up @@ -96,7 +104,7 @@ ERROR sedr/schemat.py - schemathesis.exceptions.SchemaError: Failed to load sche
#### Wrong API version / missing conformance link
Sedr supports EDR 1.1, but the API is EDR 1.0.
Sedr wants EDR 1.1, but the API is EDR 1.0.
```python
if not requirementA2_2_A5:
Expand Down
8 changes: 4 additions & 4 deletions sedr/schemat.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ def test_edr_collections(case):
"test_collections found collection id %s", collection_json["id"]
)

# Validation done in requrementA5_2
extent = util.parse_spatial_bbox(collection_json)
extents[collection_url] = tuple(extent[0])

# Run edr, ogc, profile tests
for f in util.test_functions["collection"]:
status, msg = f(collection_json)
Expand All @@ -127,6 +123,10 @@ def test_edr_collections(case):
raise AssertionError(f"Test {f.__name__} failed with message: {msg}")
util.logger.info("Test %s passed. (%s)", f.__name__, msg)

# Validation of spatial_bbox done above
extent = util.parse_spatial_bbox(collection_json)
extents[collection_url] = tuple(extent[0])


for p in schema.raw_schema["paths"].keys():
# Optionally include endpoints if they exist, otherwise schemathesis will refuse to run
Expand Down

0 comments on commit c48c7f0

Please sign in to comment.