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

Test harness in CATMAID #13

Open
clbarnes opened this issue May 26, 2017 · 4 comments
Open

Test harness in CATMAID #13

clbarnes opened this issue May 26, 2017 · 4 comments

Comments

@clbarnes
Copy link
Collaborator

As discussed elsewhere, the integration tests should be done as part of CATMAID's build because it's not worth standing up a whole instance of CATMAID for testing this library, and any breaking API changes by CATMAID which affect this library will also affect users and so should be addressed by the CATMAID maintainers as a priority.

@clbarnes
Copy link
Collaborator Author

clbarnes commented Jun 6, 2017

Alternatively, we could simply stand up an instance of CATMAID using the (eventual) docker image, but it would mean that the tests would be in a separate repo to the fixtures they've be asserting against.

@aschampion
Copy link
Contributor

I like the docker image test idea. If we set up the docker image right, we should be able to keep the fixtures here in catpy. One of the goals of the docker image is easy DB import for the purpose of hosting published/curated exports.

@clbarnes
Copy link
Collaborator Author

clbarnes commented Oct 5, 2017

Been thinking about this a bit more in the context of the extension apps - might it be sensible to have a catpy_integration_tests package in the catpy repo, which could be installed with an extra flag for the setup script? This could be a Django app with just an appconfig, fixtures and tests, and we can let Django run the tests. That way catpy has control over all the fixtures, and doesn't need to worry about setup of the CATMAID environment other than installing itself in there before collectstatic is called. On the downside, having server and client running in the same (potentially dockerised) python environment potentially isn't as isolated as we'd like, especially if there are version or dependency clashes.

I'm definitely all for separating unit tests and integration tests within catpy, just thought this might be a nice way of using django's infrastructure to make sure the database is getting sufficiently cleaned up.

@clbarnes
Copy link
Collaborator Author

clbarnes commented Dec 5, 2018

Minor step relevant to this: pytest now accepts a --credentials_json=path/to/file.json argument. There is a credentials fixture which will skip the test if this argument is not given; otherwise it will return the deserialised object in the JSON file, which can be used to instantiate the CatmaidClient object. That will make it trivial to run tests against whatever instance of CATMAID we would want to use.

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

No branches or pull requests

2 participants