aiidateam / aiida-testing

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

mock-code: allow ignoring files based on path #44

Closed ltalirz closed 3 years ago

ltalirz commented 3 years ago

The current code for the ignore_files parameter allows ignoring files only based on their filename, not based on their path in the the run directory

https://github.com/aiidateam/aiida-testing/blob/4aa5c3eaea1f4cb55f5a3d6be015e35867a3c77c/aiida_testing/mock_code/_cli.py#L55-L60

However, I have a use case where a code creates a bunch of folders and I simply want to ignore the content of some of these - e.g. I'd like to ignore 'VTK/*'

An ignore_paths approach seems generally more powerful to me, so I propose to add this.

greschd commented 3 years ago

Yeah, that sounds like a good idea.

Should it still be possible to ignore specific file names by just specifying 'file_name', or would that have to be changed to '*/file_name'?

ltalirz commented 3 years ago

For the moment I was thinking of just adding ignore_paths (and keeping ignore_files) in order not to break existing code.

If you prefer another solution, let me know.

greschd commented 3 years ago

Ah, I see. Well, if it's generic enough we could just deprecate ignore_files.

in order not to break existing code

In principle the status of this project is such that we can still break whatever we like 🙃 but it'll probably be less headache for ourselves if we "properly" deprecate stuff.