Skip to content

Continue improving tests #79

Description

@JoeZiminski

I'll put some notes here on the existing test SSH stucture, and what it will be nice to test next.

Existing:

There are two sets of file transfer tests. test_transfer_file.py is the original set of tests that mostly make directories of different data_types and check they are uploaded / downloaded properly. These do not test the newer keys for non-data_type files e.g. "all_non_sub".

test_ssh_file_transfer.py has extended tests thats test files and folders, with lots of permutations of different sub/ses/datatype (including all the new keys (e.g. all_non_sub). This has options for testing over the local filesystem which is always on. It also has option for testing over SSH (and there are also tests in test_ssh_setup.py that test SSH setup). The data transfer tests do not require a password, but the SSH setup tests do. Currently all SSH test settings are stored in a conftest.py, including a path to a txt file containg the password. However, this is bad idea and is probably safest to remove, and just forgot the couple of tests that check SSH key setup.

The idea is that SSH tests are always off on CI, and we can run them just on the dedicated PC we will setup.

As for tests on real data, I had a look into the memory blocking thing for linux but I don't think there is a simple way to make it cross-platform. As such started to put together a fake experimental project folder with real data at: (ceph) X:\neuroinformatics\scratch\datashuttle_tests\real_data/). We can extend this, and then setup real-life test around it that can check long-latency transfers.

Things to test next:

  • need to test what happens when connection drops during transfer. Rclone has protocols for this
    but we need to test our end (notes: https://stackoverflow.com/questions/18601828/python-block-network-connections-for-testing-purposes, but this might be just for dropping access to connection for python not entire machine)
  • Currently the default setting is that we will never overwrite data (there is a config for this can be changed). One problem
    is that if somehow a transfer fails halfway, a corrupt version of the file will exist on remote, but will never be updated
    again, because it will not be overwritten. This shoudl still warn the user, but need to explictly test what happens in
    this case, that the warning is clear and see if there are any nice solutions.
  • currently all test are from one project (local) to another (remote). It will be nice to simulate 2-3 local projects
    and push them all to the remote at the same time. Not 100% sure what rlcone will do in this situation.
  • currently rawdata only tested. WHen extend to derivatives will need to extend the tests
  • switching between local and SSH transfer methods in a single repo (currently these are isolateed tests)
  • SSH tests are very slow on windows due to the way they are checkde through mounted filesystem (see test_ssh_file_transfer.py pathtable_and_project()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions