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

Add simplified Docker Compose support for tests #210

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

kjsanger
Copy link
Member

@kjsanger kjsanger commented Aug 22, 2024

Remove the requirement to set up iRODS client wrappers before tests will run.

Support both plain CLI and IDEs.

GitHub CI is not using this to run tests, although potentially it could. That would need additional parameters for Docker to select the correct iRODS server and clients, which is currently hard-coded into the Dockerfile.dev

@kjsanger kjsanger added the enhancement New feature or request label Aug 22, 2024
@kjsanger
Copy link
Member Author

I'm hoping that this will simplify things, but I'd lke some feedback on whether that's actually the case. It works for me and I can get rid of the iRODS wrappers and extra client container.

Remove the requirement to set up iRODS client wrappers before tests
will run.

Support both plain CLI and IDEs.
@mksanger
Copy link
Contributor

This seems better for me as well, it makes setup less complicated and eliminates the errors that occur because of running the tests on a mac. It did take my mac more than 15 minutes to build the docker image on the first run (70% of which was installing python), but after that it was faster than the old setup (possibly due to those mac induced failures). Perhaps mention that the initial run time will be long in the README?

Copy link
Contributor

@marcomoscasgr marcomoscasgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran it on my vm with ubuntu and I got 89 passed tests and 2 skipped:

- s It: tests/test_irods.py::TestDataObject::test_verify_checksum_good - Can have its checksum verified as good
- s It: tests/test_irods.py::TestDataObject::test_verify_checksum_bad - Can have its checksum verified as bad

While installing python 3.12.3, this error appeared but did not affect the build or tests:

Downloading Python-3.12.3.tar.xz...
-> https://www.python.org/ftp/python/3.12.3/Python-3.12.3.tar.xz
Installing Python-3.12.3...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/app/.pyenv/versions/3.12.3/lib/python3.12/ctypes/__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
WARNING: The Python ctypes extension was not compiled. Missing the libffi lib?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/app/.pyenv/versions/3.12.3/lib/python3.12/sqlite3/__init__.py", line 57, in <module>
    from sqlite3.dbapi2 import *
  File "/app/.pyenv/versions/3.12.3/lib/python3.12/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/app/.pyenv/versions/3.12.3/lib/python3.12/lzma.py", line 27, in <module>
    from _lzma import *
ModuleNotFoundError: No module named '_lzma'
WARNING: The Python lzma extension was not compiled. Missing the lzma lib?
Installed Python-3.12.3 to /app/.pyenv/versions/3.12.3

This is a very useful feature for testing... probably every repository should have a containerised env for tests

README.md Outdated Show resolved Hide resolved
@kjsanger
Copy link
Member Author

WARNING: The Python lzma extension was not compiled. Missing the lzma lib?

The lines like this are warnings which occur because I have not installed some optional development apt packages. We could add these later to make the warnings go away.

@kjsanger kjsanger merged commit 21dd029 into wtsi-npg:devel Aug 28, 2024
5 checks passed
@kjsanger kjsanger deleted the feature/tests-in-docker branch August 28, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants