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

DSERV-727 new acceptance/response time test script #368

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/response_time_testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# End-to-end and Response Time Testing

The current state of the IGVF Catalog API can be evaluated by running the `response_times.py` script present at `tests/response_times`.

The `urls.txt` file contains a list of API calls covering all available endpoints of the IGVF Catalog Production API with a combination of params. This file serves as input for the testing script.

Each JSON response for each API call will be stored in a folder called `responses`. Each filename is an MD5 of the entire URL string, so we avoid very large filenames. If a conflicting response from a previous execution is already present in the folder, the script will compare values. Any differences in any response will be reported in the `differences.txt` file.

In case any endpoint fails (HTTP response != 200), the error message will be printed on the screen and saved in the `responses` folder.

Each response time will be stored in the `average_response_time.csv` file. If the same call has already been performed and stored in the CSV file, the script will compute the average between the response times and save in the same CSV file. It gives the feature of running the script multiple times to get fair response time values.

Testing against our development environment is also available by running the same script and setting the global variable `TEST_DEV = True` at the top of the script.

```
$ tests/response_times> cd tests/response_times; python3 response_times.py
Fetching: https://api.catalog.igvf.org/api/variants?spdi=NC_000020.11%3A3658947%3AA%3AG&organism=Homo%20sapiens&page=0
Fetching: https://api.catalog.igvf.org/api/variants?hgvs=NC_000020.11%3Ag.3658948A%3EG&organism=Homo%20sapiens&page=0
Fetching: https://api.catalog.igvf.org/api/variants?region=chr1%3A1157520-1158189&organism=Homo%20sapiens&page=0
Fetching: https://api.catalog.igvf.org/api/variants?mouse_strain=A_J&organism=Mus%20musculus&page=0
...

Saved responses in 'responses/', average times in 'average_response_time.csv', and differences in 'differences.txt' if any.
```
131 changes: 0 additions & 131 deletions tests/acceptance_tests/api_test.py

This file was deleted.

Loading