-
Notifications
You must be signed in to change notification settings - Fork 112
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: Add a container to run the tests #479
Conversation
Install PostgreSQL and PostGIS:: | ||
|
||
$ sudo apt-get install postgresql postgis | ||
$ sudo apt-get install postgresql postgresql-14-postgis-3 postgresql-14-postgis-3-scripts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without installing postgresql-14-postgis-3-scripts
running CREATE EXTENSION postgis
fails
https://gis.stackexchange.com/questions/71302/running-create-extension-postgis-gives-error-could-not-open-extension-control-fi
why isn't psycopg2 included in requirements.txt? |
Interesting, thanks! |
Nice work! I tried to run it locally and I had 2 errors. ➜ ./test_container/build.sh
[+] Building 0.1s (2/2) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount3630990460/Dockerfile: no such file or directory I was able to run this script properly by running ➜ ./test_container/run.sh
starting postgres
starting mysql
* Starting MySQL database server mysqld su: warning: cannot change directory to /nonexistent: No such file or directory
[ OK ]
waiting for mysql to start
###############################
GeoAlchemy2 Test Container
run tests with `tox --workdir /output -vv`
###############################
root@e97b7e2cfa5e:/geoalchemy2# tox --workdir /output -vv
using tox.ini: /geoalchemy2/tox.ini (pid 395)
using tox-3.21.4 from /usr/lib/python3/dist-packages/tox/__init__.py (pid 395)
GLOB start: packaging
GLOB sdist-make: /geoalchemy2/setup.py
[412] /geoalchemy2$ /usr/bin/python3 setup.py sdist --formats=zip --dist-dir /output/dist >../output/log/GLOB-0.log
ERROR: invocation failed (exit code 1), logfile: /output/log/GLOB-0.log
==================================================================================================== log start ====================================================================================================
/usr/lib/python3/dist-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
Traceback (most recent call last):
File "/geoalchemy2/setup.py", line 4, in <module>
setup(
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 152, in setup
_install_setup_requires(attrs)
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 147, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 812, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 771, in resolve
dist = best[req.key] = env.best_match(
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1056, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1068, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 883, in fetch_build_egg
return fetch_build_egg(self, req)
File "/usr/lib/python3/dist-packages/setuptools/installer.py", line 87, in fetch_build_egg
wheel.install_as_egg(dist_location)
File "/usr/lib/python3/dist-packages/setuptools/wheel.py", line 95, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/usr/lib/python3/dist-packages/setuptools/wheel.py", line 103, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/usr/lib/python3/dist-packages/setuptools/wheel.py", line 124, in _convert_metadata
os.mkdir(destination_eggdir)
OSError: [Errno 30] Read-only file system: '/geoalchemy2_read_only/.eggs/setuptools_scm-8.0.4-py3.10.egg'
===================================================================================================== log end =====================================================================================================
ERROR: FAIL could not package project - v = InvocationError('/usr/bin/python3 setup.py sdist --formats=zip --dist-dir /output/dist', 1) Do you know why? |
|
I also had to |
I tested the new version and everything works fine now! The last improvement I can see is in the |
I can make this change |
Are these changes what you were asking for? |
Yes, exactly, thanks! |
Thank you very much for this work @mbway !!! |
Description
in the process of investigating the issue with #478 I had to run the tests, but this was easier said than done as there are a lot of tricky requirements needed to set up an environment where the tests can be run.
To help with this, I set up a docker image that can be built and used to run the tests with tox.
Checklist
This pull request is:
Fixes: #<issue number>
in the description if it solves an existing issue(which must include a complete example of the issue).
main
branch and pass with the provided fix.Fixes: #<issue number>
in the description if it solves an existing issue(which must include a complete example of the feature).