pynwb icon indicating copy to clipboard operation
pynwb copied to clipboard

[Feature]: a way to disable all tests requiring dynamic downloads OR a static archive for test data

Open TheChymera opened this issue 1 year ago • 4 comments

What would you like to see added to PyNWB?

One of the tests ( tests/read_dandi/test_read_dandi.py::TestReadNWBDandisets::test_read_first_nwb_asset ) fails in a network sandbox.

Here is the full build log ( https://ppb.chymera.eu/4949b9.log ) but I think it's pretty clear what the issue is.

Is your feature request related to a problem?

No response

What solution would you like?

In case there will be more tests requiring network connectivity it would be great to either have an option to disable them globally (so they don't have to be explicitly listed subject to change etc.) or to have a static test data archive the checksum of which can be recorded.

Do you have any interest in helping implement the feature?

Yes, but I would need guidance.

Code of Conduct

TheChymera avatar Dec 12 '23 03:12 TheChymera

disable them globally

How do other packages handle this? Would it be sufficient to check for an environment variable, e.g., PYNWB_NO_NETWORK_TESTS=1?

rly avatar Dec 12 '23 06:12 rly

@rly yes, that's how most packages do this.

TheChymera avatar Dec 12 '23 15:12 TheChymera

I actually prefer to use pytest markers for different properties of tests, see https://docs.pytest.org/en/6.2.x/example/markers.html#mark-run.

t-b avatar Dec 12 '23 15:12 t-b

In the ros3 tests we use the following check to detect whether network (and ros3) are available to automatically skip the test.

https://github.com/NeurodataWithoutBorders/pynwb/blob/87a7c578e806f3679fc7b8c5e9777f382406db6a/tests/integration/ros3/test_ros3.py#L21C1-L27

We could do the same here.

oruebel avatar Dec 12 '23 18:12 oruebel