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

python/scripts/run_dicom_archive_validation.py (implement automated tests) #1240

Closed
8 tasks done
cmadjar opened this issue Mar 14, 2025 · 0 comments · Fixed by #1242
Closed
8 tasks done

python/scripts/run_dicom_archive_validation.py (implement automated tests) #1240

cmadjar opened this issue Mar 14, 2025 · 0 comments · Fixed by #1242
Assignees
Labels
27.0-testing Area: CI PR or issue related to continuous integration, including automated tests and static checks

Comments

@cmadjar
Copy link
Collaborator

cmadjar commented Mar 14, 2025

Write automatic tests for:

  • run run_dicom_archive_validation.py -p database_config.py -t <TARCHIVE PATH>
    => should return [ERROR ] argument --upload_id is required and the script help details
    => should return ERROR CODE 3 (MISSING_ARG)
  • run run_dicom_archive_validation.py -p database_config.py -u <UPLOADID>
    => should return [ERROR ] argument --tarchive_path is required and the script help details
    => should return ERROR CODE 3 (MISSING_ARG)
  • run un_dicom_archive_validation.py -z
    => should return [ERROR ] -z is not a valid option for the script
    => should return ERROR CODE 6 (INVALID_ARG)
  • run run_dicom_archive_validation.py -p database_config.py -t <INVALID PATH> -u <VALID UPLOADID>
    => should return [ERROR ] <INVALID PATH> does not exist. Please provide a valid path for --tarchive_path
    => should return ERROR CODE 5 (INVALID_PATH)
  • run run_dicom_archive_validation.py -p database_config.py -u <UPLOADID> -t <TARCHIVE PATH> using inexistant upload ID and random tarchive path
    => should return [ERROR ] Did not find an entry in mri_upload associated with 'UploadID' 16666
    => should return ERROR CODE 23 (SELECT_FAILURE)
  • run run_dicom_archive_validation.py -p database_config.py -u <UPLOADID> -t <TARCHIVE PATH> using valid upload ID and a valid tarchive path but wrong combination of upload ID and tarchive path (a.k.a. tarchive path not corresponding to the tarchive linked to the upload ID)
    => should return [ERROR ] UploadID <UPLOAD ID> and ArchiveLocation <TARCHIVE PATH> do not refer to the same upload
    => should return ERROR CODE 23 (SELECT_FAILURE)
  • run run_dicom_archive_validation.py -p database_config.py -u <UPLOADID> -t <TARCHIVE PATH> using valid upload ID, tarchive path and valid combination of upload ID and tarchive path
    => run smoothly and update fields IsTarchiveValidated and IsCandidateInfoValidated to 1 in the mri_upload table for the Upload ID that has been run.
    => should return ERROR CODE 0 (SUCCESS)

Manual checks:

  • run run_dicom_archive_validation.py -h
    => should print the help of the script. Make sure the help documentation is up to date.

Issues found

@cmadjar cmadjar added 27.0-testing Area: CI PR or issue related to continuous integration, including automated tests and static checks labels Mar 14, 2025
@cmadjar cmadjar self-assigned this Mar 14, 2025
@cmadjar cmadjar closed this as completed Mar 19, 2025
@cmadjar cmadjar changed the title python/dicom_archive_validation.py (implement automated tests) python/scripts/run_dicom_archive_validation.py (implement automated tests) Mar 20, 2025
@cmadjar cmadjar linked a pull request Mar 20, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
27.0-testing Area: CI PR or issue related to continuous integration, including automated tests and static checks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant