-
Notifications
You must be signed in to change notification settings - Fork 0
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
DSEGOG-321 Fully implement delete records #140
Open
MRichards99
wants to merge
10
commits into
main
Choose a base branch
from
DSEGOG-321-delete-records
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ociated images and waveforms
…eletion - I've moved the setup & teardown of the data into a fixture and added an image and waveform channel
- `record` can be a `RecordModel` or a dictionary (whose contents will be put into a `RecordModel` in the init)
…s and images on teardown - I noticed a bug where after running the tests in `test_submit_hdf.py`, images and waveforms for `20200407142816` wouldn't be deleted from Echo - The fixture was trying to remove waveforms from the database so it was obvious that wasn't going to work - Deletion of images wasn't working because `images/` wasn't being prefixed to the path, meaning the files couldn't be found and therefore deleted - Renamed fixture from `reset_databases()` to `reset_record_storage()` - this seems to be a more appropriate name for what the function is doing
- I've added some comments in the test and the docstring of the source code to indicate the check and why it's being mocked in the test
MRichards99
force-pushed
the
DSEGOG-321-delete-records
branch
from
August 15, 2024 11:07
829d6c5
to
d94fa1e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #140 +/- ##
==========================================
+ Coverage 95.61% 95.63% +0.01%
==========================================
Files 72 72
Lines 3719 3733 +14
Branches 383 383
==========================================
+ Hits 3556 3570 +14
Misses 113 113
Partials 50 50 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 adds full implementation to the
DELETE /records/{_id}
endpoint by deleting images and waveforms stored on Echo. Previously, the record would be removed from the database but images & waveforms associated with that record would still be stored in Echo.To do this, a new function has been added to the
EchoInterface
class,delete_directory()
. This allows all of the images or all of the waveforms for a particular record to be removed in one call (two calls total, one for images, one for waveforms). This function is called in the entrypoint function for theDELETE /records/{_id}
endpoint. I've added tests for this new code.I fixed a bug occurring with some of the tests in 95321ba as I noticed images and waveforms weren't being deleted for a particular record ID. In e7ca92f, I improved the integration test for
DELETE /records/{_id}
endpoint by moving the setup and teardown into the fixture (it was in the test itself before).