aiida-core icon indicating copy to clipboard operation
aiida-core copied to clipboard

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

Open GeigerJ2 opened this issue 1 year ago • 2 comments
trafficstars

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

GeigerJ2 avatar May 17 '24 10:05 GeigerJ2

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

sphuber avatar May 17 '24 10:05 sphuber

Alright, cool! Should be done by #6403.

GeigerJ2 avatar May 17 '24 12:05 GeigerJ2