Add Missing Endpoint Tests & Fix parameters.value bug #342
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will close #270
Description
This PR adds endpoint tests to match the example queries given in the example implementation of the search API. The linked issue shows which tests were missing, and below shows a list of those query names alongside the corresponding Pytest parameter names which I've added:
Two of the example queries are reliant on ICAT 5 - I've added these tests and added skips to them until ICAT 5 exists. In #310, we should unskip these tests. I've made a best attempt at writing the query parameters and the test data for those tests, but small adjustments will probably need to be made (e.g. when we know what the techniques test data will look like).
Whilst writing these tests, I came across a bug when a request contains a WHERE filter with a between operator on
parameters.value
. Query datasets where the photon energy range is 880-990 eV is an example where this bug would occur. This has been fixed in 3fe8dfe by detecting this use case and checking the type of the first value in the list (e.g. between [20, 30]). I added a test intest_search_api_where_filter.py
to test this at the WHERE filter level; the endpoint tests added in this PR also test this at an endpoint level.A fix version bump will be applied when merging this PR (print-version command currently says 4.1.2).
Testing Instructions
Test the
parameters.value
between operator has been fixedicatdb Generator Script Consistency Test
CI job fails, is this because of a deliberate change made to the script to change generated data (which isn't actually a problem) or is here an underlying issue with the changes made?fix:
,feat:
orBREAKING CHANGE:
so a release is automatically made via GitHub Actions upon merge?parameters.value
that uses abetween
operator should return a 200 with relevant dataAgile Board Tracking
Connect to #270