aiidateam / aiida-testing

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

mock-code: allow passing custom hash function via callback #48

Closed ltalirz closed 1 year ago

ltalirz commented 3 years ago

Unfortunately, there are simulation codes whose input files are not portable (e.g. because they require the absolute path to some data directory... no idea why).

For such cases, the current hash function will not work on CI since even when the data directory is provided, the absolute path to it will differ.

One might argue that it is really the simulation code that should be rewritten here, but unfortunately that is not always an option. For such cases, it would be useful to be able to pass a custom hash function to the mock_code_factory fixture.

greschd commented 3 years ago

I think this issue is closely related to #6 - we should probably combine the discussion.

ltalirz commented 3 years ago

Indeed - passing a callback to the standalone executable would be a bit of a pain... pickle pickle

ltalirz commented 1 year ago

This has been addressed by @chrisjsewell in a different way in https://github.com/aiidateam/aiida-testing/pull/65 (alternative hasher class is implemented in the test script and loaded dynamically by the mock executable via importlib).