aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
412 stars 184 forks source link

Don't raise exception for successful `verdi archive import -n` #6401

Closed GeigerJ2 closed 1 month ago

GeigerJ2 commented 1 month ago

When doing a dry-run of an archive import, the import_archive function raises the ImportTestRun('test run complete') exception, resulting in a user-facing Critical: output. Is there any particular reason for this behavior, rather than just a Report: that the dry-run is done?

Relevant code here: https://github.com/aiidateam/aiida-core/blob/be0db3cc49506294ae1845b6e746e40cd76f39a9/src/aiida/cmdline/commands/cmd_archive.py#L516-L525

https://github.com/aiidateam/aiida-core/blob/be0db3cc49506294ae1845b6e746e40cd76f39a9/src/aiida/tools/archive/imports.py#L198-L200

sphuber commented 1 month ago

s there any particular reason for this behavior, rather than just a Report: that the dry-run is done?

Don't think so. Likely just an oversight. We should really just be catching the ImportTestRun exception separately and issues an echo_success message

GeigerJ2 commented 1 month ago

Alright, cool! Should be done by #6403.