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

Capture ImportTestRun as dry-run success #6403

Merged
merged 2 commits into from
May 27, 2024

Conversation

GeigerJ2
Copy link
Contributor

Fixes #6401

In the _import_archive_and_migrate function, the ImportTestRun exception is specifically captured, success communicated to the user, and the function returned to not print the final echo_successs which is issued after actual archive import into the profile.

Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @GeigerJ2 Changes look good. Just kind of surprised that this wasn't tested yet. Could you please add a quick test? Should be very straightforward to add in tests/cmdline/commands/test_archive_import.py. Just need to make sure the command finishes correctly as opposed to excepting like it does now 😄

src/aiida/cmdline/commands/cmd_archive.py Outdated Show resolved Hide resolved
src/aiida/cmdline/commands/cmd_archive.py Outdated Show resolved Hide resolved
@GeigerJ2 GeigerJ2 force-pushed the dry-archive-import branch from 70949c7 to 7f377fc Compare May 27, 2024 11:56
Copy link

codecov bot commented May 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.67%. Comparing base (ef60b66) to head (0e48f48).
Report is 112 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6403      +/-   ##
==========================================
+ Coverage   77.51%   77.67%   +0.16%     
==========================================
  Files         560      562       +2     
  Lines       41444    41660     +216     
==========================================
+ Hits        32120    32354     +234     
+ Misses       9324     9306      -18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@GeigerJ2 GeigerJ2 force-pushed the dry-archive-import branch from 7f377fc to b0b0606 Compare May 27, 2024 12:57
@GeigerJ2 GeigerJ2 force-pushed the dry-archive-import branch from f2cc633 to 2ca485c Compare May 27, 2024 13:04
@sphuber sphuber self-requested a review May 27, 2024 15:54
Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @GeigerJ2

@sphuber sphuber merged commit 36991c6 into aiidateam:main May 27, 2024
16 of 17 checks passed
mikibonacci pushed a commit to mikibonacci/aiida-core that referenced this pull request Sep 3, 2024
aiidateam#6403)

The import module raises `ImportTestRun` after a dry-run of a importing
archive has finished successfully. This was not caught separately by
the `verdi archive import` command resulting in a critical error being
returned even in the case of a successful dry-run. The exception is now
caught and a success message is logged instead.
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.

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