Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write Tests to Cover Example Queries #270

Closed
1 task
MRichards99 opened this issue Sep 23, 2021 · 1 comment · Fixed by #342
Closed
1 task

Write Tests to Cover Example Queries #270

MRichards99 opened this issue Sep 23, 2021 · 1 comment · Fixed by #342
Assignees
Labels
enhancement New feature or request expands-search-api Issues relating to the ExPaNDS Search API section of this repo

Comments

@MRichards99
Copy link
Collaborator

Description:
The documentation details a number of example queries, for dataset, document and instrument endpoints. We should write tests to cover these (using Flask's test client like in test/icat/endpoints/test_findone.py). I'm not sure whether we'll be able to replicate the exact data they use (stored in a json file which I guess gets loaded in somewhere) but we should at least demonstrate that the functionality demonstrated in those examples does work. If we had to use their data for that, I guess you could write a script using that json file and create the data in ICAT (perhaps using the PaNOSC data model modelled in the repo with classes?).

Acceptance criteria:

  • Write tests using Flask test client to show the functionality in the example queries works in our implementation
@MRichards99 MRichards99 added enhancement New feature or request expands-search-api Issues relating to the ExPaNDS Search API section of this repo labels Sep 23, 2021
@VKTB VKTB self-assigned this Feb 21, 2022
@VKTB
Copy link
Contributor

VKTB commented Feb 21, 2022

I had a look at our endpoint tests and discovered that we do not have tests for the below example queries. Please note that we test filters with structures as the ones in the below example queries at a SearchAPIQueryFilterFactory, NestedWhereFilters etc. class level but not an endpoint level.

✔️ - Yes
❌ - No

Example query Requires ICAT 5 Any other endpoint level tests with such filter structure already in place Notes
Query datasets acquired using X-Ray Absorption ✔️
Query datasets where the photon energy range is 880-990 eV
Query datasets with a solid sample or copper
Query datasets where temperature is below 80°C
Query datasets with files matching a string using full text search
Query documents of type proposal containing my own data
Query documents where wavelength is 1000-1100 nm The filter has the same structure as the Query datasets where the photon energy range is 880-990 eV example query so writing a test for one of the cases should probably be enough.
Query documents containing datasets where wavelength is 1000-1100 nm
Query documents investigating a particular sample using a certain technique ✔️

@MRichards99 MRichards99 assigned MRichards99 and unassigned VKTB Feb 23, 2022
MRichards99 added a commit that referenced this issue Feb 24, 2022


- Some tests rely on ICAT 5 so have been skipped until this is released
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request expands-search-api Issues relating to the ExPaNDS Search API section of this repo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants