-
Notifications
You must be signed in to change notification settings - Fork 224
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
Deduplicate code for tests of archive migration code #3924
Deduplicate code for tests of archive migration code #3924
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3924 +/- ##
===========================================
- Coverage 78.21% 78.21% -0.01%
===========================================
Files 460 460
Lines 34035 34036 +1
===========================================
Hits 26620 26620
- Misses 7415 7416 +1
Continue to review full report at Codecov.
|
4cc5289
to
0662057
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like an update that should've been done some time ago... :)
Concerning my comments, I am aware of the more weird things happening from v0.3 to v0.4, which is due to a migration (TrajectoryData
) needing the folder
and the node files, and not just the metadata
and data
JSON files. If it is not possible to use the new migrate
method from ArchiveMigrationTest
, then that's fine, but should maybe be commented upon, if it isn't already somewhere in there.
Also, the test function name can still be updated to match the rest :)
But all in all, no major changes to be done here that I can find - as long as all tests pass and the coverage does not change significantly.
@CasperWA I addressed your comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes!
I found a single pylint disable comment that can be removed, and to round it off, I think there may be an a
too much in your first commit message.
After these very minor updates I will approve this as is.
@@ -432,7 +432,7 @@ def add_extras(data): | |||
data.update({'node_extras': node_extras, 'node_extras_conversion': node_extras_conversion}) | |||
|
|||
|
|||
def migrate_v3_to_v4(metadata, data, folder, *args): # pylint: disable=unused-argument | |||
def migrate_v3_to_v4(metadata, data, *args): # pylint: disable=unused-argument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def migrate_v3_to_v4(metadata, data, *args): # pylint: disable=unused-argument | |
def migrate_v3_to_v4(metadata, data, *args): |
Each archive migration was being tested on a archives included in this repo in `tools/fixtures/export/migrate` and the test was always the same. Simply take an archive, migrate it to the next version with the appropriate method and check that both metadata and data dictionaries of the migrated data match that of the reference archive. This same test was implemented for each migration method, but has now been centralized in a single test using pytest to parametrize the versions. The testing on external archives from `aiida-export-migration-testing` has also been streamlined a bit, by defining a new base class called `ArchiveMigrationTest` that provides some utility methods.
e03d572
to
dd3d0e9
Compare
Thanks for the review 👍
Done
I might be blind to double a's as a result of my name, because I could not spot it. |
So very true. And so very tragic... 😆 Anyway, there is something funky with your first commit in the first sentence, around |
Fixes #3923
Each archive migration was being tested on a archives included in this
repo in
tools/fixtures/export/migrate
and the test was always thesame. Simply take an archive, migrate it to the next version with the
appropriate method and check that both metadata and data dictionaries of
the migrated data match that of the reference archive. This same test
was implemented for each migration method, but has now been centralized
in a single test using pytest to parametrize the versions.
The testing on external archives from
aiida-export-migration-testing
has also been streamlined a bit, by defining a new base class called
ArchiveMigrationTest
that provides some utility methods.