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

Export current extract parquet files over FTPS #264

Merged
merged 32 commits into from
Feb 5, 2024

Conversation

ruaridhg
Copy link
Contributor

@ruaridhg ruaridhg commented Jan 29, 2024

Closes #192
Changes:

  • Change SendViaStow to SendViaFTPS in orthanc-anon
  • upload_parquet_files added to core module
  • Tear down test data through docker otherwise later tests fail
  • Tests for successful upload and exception thrown in nothing to export
  • app in pixl_ehr to SendViaFTPS

@ruaridhg ruaridhg marked this pull request as ready for review January 30, 2024 13:58
@ruaridhg ruaridhg changed the title WIP: Checking CI tests work for FTPS Parquet upload Checking CI tests work for FTPS Parquet upload Jan 30, 2024
@ruaridhg ruaridhg requested a review from a team January 30, 2024 13:59
stefpiatek
stefpiatek previously approved these changes Jan 30, 2024
Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of suggestions 🎉

pixl_core/tests/conftest.py Outdated Show resolved Hide resolved
pixl_ehr/src/pixl_ehr/main.py Outdated Show resolved Hide resolved
@milanmlft milanmlft changed the title Checking CI tests work for FTPS Parquet upload Export current extract parquet files over FTPS Jan 30, 2024
@milanmlft milanmlft self-requested a review January 30, 2024 18:44
Copy link
Member

@milanmlft milanmlft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the problem with the FTP_HOST key not being found. I think what happened is that by moving the FTP uploading functionality into export_patient_data(), the unit tests would try to run this but then fail because it can't find that environment variable. Further on that, it also needs an actual FTP server to be up and running, so added that to the docker-compose.yml as well (though this will need to be updated after merging #268).

The CI is currently still failing because of some missing files, so I think there is still a wrongly configured file path somewhere.
That being said, I don't see any actual unit tests that check wether the parquet files have been uploaded to the FTP server, like we're doing in pixl_core/tests/test_upload.py for the DICOM images. So probably still need to add that?

@stefpiatek
Copy link
Contributor

stefpiatek commented Jan 30, 2024

@milanmlft

That being said, I don't see any actual unit tests that check wether the parquet files have been uploaded to the FTP server, like we're doing in pixl_core/tests/test_upload.py for the DICOM images. So probably still need to add that?

Are they not also in pixl_core/tests/test_upload.py test_upload_parquet?

I'm confused though, why are we testing in ehr, when all of this functionality that we care about is in core (which already covers the test)?

@stefpiatek
Copy link
Contributor

stefpiatek commented Jan 31, 2024

I agree with keeping the FTPS-related testing in core. But then we should probably monkeypatch the ehr tests so that it doesn't try to connect to an FTPS server (and then we can remove the FTPS setup in ehr again).

👌 second option is to create a separte function export_reports_to_parquet and test that instead of testing the REST API call. That feels like less faffing around but I'm easy

milanmlft
milanmlft previously approved these changes Jan 31, 2024
Copy link
Member

@milanmlft milanmlft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think it's looking good now! Just the osimis/orthanc docker image seems to have some problems upstream. Just re-running the CI might work 🤷‍♂️

pixl_ehr/tests/conftest.py Outdated Show resolved Hide resolved
pixl_ehr/tests/docker-compose.yml Outdated Show resolved Hide resolved
@stefpiatek stefpiatek self-requested a review January 31, 2024 15:25
@@ -346,7 +346,6 @@ async def test_radiology_export_multiple_projects(example_messages, tmp_path) ->
await process_message(mess)

# ACT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this test is still calling export_radiology_as_parquet below and not export_patient_data

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌 second option is to create a separte function export_reports_to_parquet and test that instead of testing the REST API call. That feels like less faffing around but I'm easy

I assumed this is what you meant by having export_radiology_as_parquet and send_via_ftps as separate functions called in a single API endpoint i.e. export_patient_data but testing just export_radiology_as_parquet in test_processing since send via ftps is tested elsewhere

@milanmlft
Copy link
Member

System test is failing now because of the call to export_patient_data() in pixl export-patient-data which in turn calls send_via_ftps() (which we want I think!). However, this branch doesn't have an FTPS server set up yet for the system tests (that's under way in #268), so it's failing because of the same reason as before.

I think we can leave this for now and wait until #268 is fixed and merged and then merge main into this branch and add an additional check in the system tests to verify the successful upload of the parquet files.

@stefpiatek stefpiatek dismissed stale reviews from milanmlft and themself February 2, 2024 14:27

Will want final review after system tests are merged in

Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Can you add in a check for the parquet files existing in the system test?

@milanmlft
Copy link
Member

milanmlft commented Feb 5, 2024

System test currently failing because we're missing the radiology.parquet file for some reason 😕

@milanmlft milanmlft requested a review from stefpiatek February 5, 2024 15:42
Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@milanmlft milanmlft enabled auto-merge (squash) February 5, 2024 17:53
@milanmlft milanmlft merged commit 898f96b into main Feb 5, 2024
8 checks passed
@milanmlft milanmlft deleted the milanmlft/radiology-upload-ftps branch February 5, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export current extract parquet files to DSH
4 participants