aiidateam / aiida-test-cache

A pytest plugin to simplify testing of AiiDA plugins.
MIT License
5 stars 8 forks source link

Plan for a coding week #74

Open danielhollas opened 1 day ago

danielhollas commented 1 day ago

Here's a rough plan for my work on this package during the AiiDA coding. I'll see how far I'll get, since I also want to work on AiiDAlab related things.

This is the list of tasks, roughly in the order they need to be done

danielhollas commented 1 day ago

CC @giovannipizzi @ltalirz @unkcpz Let me know if the plan above sounds good, and please tag people who you know might be interested in this (and potentially available to review the PRs).

DropD commented 44 minutes ago

What I would like to see is an integrated way to skip running a "mock code". Instead, I would like to get a calcjob node instance, which has the inputs and cached outputs connected to it. This could be used to unit test parsers, workchain logic etc. I've seen custom implementations for this in many plugins for testing parsers, including the two I (co-)authored, aiida-vasp and aiida-icon.

Having this integrated would be nice for two reasons:

ltalirz commented 17 minutes ago

You seem to be describing what export_cache/archive_cache does.

Both the mock code and the archive_cache have use cases.

I'll paste here what I wrote to Daniel in reply to his email, perhaps this can be integrated in the repo README

Edit: Maybe I'm wrong about the "cannot test parsers" in export_cache- I've never used it

=== I would say aiida-testing solves the following problem in the testing of AiiDA plugins: What do you do, if you can't run the executable your plugin is wrapping in your continuous integration tests? (because you need to test runs that are too expensive to run on the CI runners / because the license forbids it / ...)

It solves it in two different ways, each of which have their pros and cons:

I do think that this use case continues to exist (aiida-vasp, ...) and requires a working solution. Besides keeping it compatible with the new backends, perhaps one of the most impactful things to do would be to improve the documentation of aiida-testing to the point where someone can come to the plugin repo and understand what I wrote above.