Closed amehta-scottlogic closed 4 days ago
Test Analysis
Functionality
Having spoken to Ajay (Mike):
date_from
(datetime), date_to
(datetime), location_type
'city'? - this call returns every site for every city?date_from
(datetime), date_to
(datetime), location_type
'city'?, location_names
(string matching db name?), api_source
(string matching db api_source?) - as above, but filters to specified city and api_source
sitesUser should be able to enter required parameters which will essentially filter/query the DB and return matches in JSON format. Charter 11: Explore GET air‐pollutant measurements In Situ API with creative parameters and headers to discover surprises
location_names
✅ Charter 11200 OK
✅ (Automation)measurement_date
accurately represents the date_from
and date_to
values that were previously entered in the api query. ✅ (Automation)date_from
and measurement_date_to
✅ Charter 11
-> only date_from
and location_type
✅ Charter 11
-> only measurement date_to
and location type
✅ Charter 11
User must be made aware of the missing parameter each time. ✅ Charter 11Verify single city data displayed matches that of the database. ✅ (Automation)
Side by side scan with mongoDB Investigate regularity of new document upsertion/modification How often do we expect in-situ database data to change?
Possible JSON schema enforcement. Seed mongoDB data with various data types to discover surprises upon API call.
Monitor query response time with postman? Exploratory charter here? Monitor performance with different data set sizes, e.g. 10, 20 , 30 seeded results
Must be regressed, important query function.
forecast_api_seeded_data_tests.py
, forecast_api_validation_tests.py
, cams_known_grib_test.py
, forecast_calibration_tests.py
& open_aq_etl_tests.py
tests all passed.
Executed manual test cases, had to make some changes to test assertions, but expected behaviour was observed
api_source
is in response unexpectedlyDescription:
api_source
is not an anticipated field in responseSteps to Reproduce:
/air-pollutant/measurements?date_from=2024-06-21T14%3A00%3A00.000%2B00%3A00&date_to=2024-06-21T16%3A00%3A00.000%2B00%3A00&location_type=city
Expected:
Actual:
location_names
param spelled incorrectlyExpected:
location_names
Actual:
location_name
date_from
and date_to
location_names
and api_sources
don't seem to have any validationapi_source
500Steps to reproduce:
/air-pollutant/measurements
endpoint with date_from
(valid Datetime), date_to
(valid Datetime), location_type
(city) parameters and api_source
set to 'OpenAQ'/air-pollutant/measurements
endpoint with date_from
(valid Datetime), date_to
(valid Datetime), location_type
(city) parameters and api_source
set to 'openaq'Expected:
Actual:
for OpenAQ:
422 status code
for openaq: 500 status code
We discovered that if you send a request to the air-pollutant/measurements
endpoint and have seeded in the in_situ
database data which has an api_source
that also isn't "OpenAQ" you get a 500 response. This has been determined to be expected behaviour so tests have been added for this to make sure this continues. We need to prevent incorrect data entering the database using schema validation which has a ticket in the backlog.
All automated API tests are now passing
Acceptance Criteria
For this ticket to be done it must include automation
Test Checklist: