Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alyx needs a test suite #41

Open
14 of 18 tasks
k1o0 opened this issue Feb 21, 2019 · 5 comments
Open
14 of 18 tasks

Alyx needs a test suite #41

k1o0 opened this issue Feb 21, 2019 · 5 comments

Comments

@k1o0
Copy link
Contributor

k1o0 commented Feb 21, 2019

Thorough tests required, particularly as the database changes move quite quickly.

The following required adequate tests:

  • getData
  • listSubjects
  • makeEndPoint
  • login
  • postData
  • postWeight
  • postWater
  • registerFile
  • datenum/datestr
  • newExp
  • headless behaviour
  • block2ALF
  • save-loadobj
  • updateNarrative
  • getFile
  • flushQueue
  • parseAlyxInstance
  • registerALF
@oliche
Copy link

oliche commented Feb 21, 2019

For ibllib the tests are run against a alyx test database that is on an open aws instance.
https://test.alyx.internationalbrainlab.org
The database is almost empty, and the rest user password can be on GitHub so anybody can run the tests.

You can have a look here:
https://github.com/int-brain-lab/ibllib/blob/develop/python/tests/oneibl/test_alyxrest.py
https://github.com/int-brain-lab/ibllib/blob/develop/python/tests/oneibl/test_one.py
https://github.com/int-brain-lab/ibllib/tree/develop/matlab/tests/oneibl

This has the advantage of having portable integration tests.

@k1o0
Copy link
Contributor Author

k1o0 commented Feb 22, 2019

Great, is the code always the same as the dev?

@k1o0
Copy link
Contributor Author

k1o0 commented Feb 22, 2019

Also is it repopulated like alyx-dev or do posts remain there for good?

@k1o0
Copy link
Contributor Author

k1o0 commented Feb 22, 2019

@oliche One issue I'm having is that my newExp test fails when using the IBL test instance. I believe this is because base sessions are not permitted on the IBL Alyx?

'{"subject":"ZM_335","procedures":["Behavior training/tasks"],"narrative":"auto-generated session","start_time":"2019-02-22T16:15:12","type":"Base","users":["test_user"]}'

@oliche
Copy link

oliche commented Feb 25, 2019

So every night the database is re-created from input fixtures to its original state. So no worries about creating/patching/deleting stuff.

For the second thing the code is thoroughly identical to the cortexlab Alyx. In this case there wasn't the init fixtures procedures so you couldn't register this session. This is fixed and it works properly now, I was able to register the session represented by the dictionary above:
one.alyx.rest('sessions','create',{"subject":"ZM_335","procedures":["Behavior training/tasks"],"narrative":"auto-generated session","start_time":"2019-02-22T16:15:12","type":"Base","users":["test_user"]})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants