open-contracting-archive / kingfisher-vagrant

Abandoned as not kept up-to-date with Kingfisher components
BSD 3-Clause "New" or "Revised" License
5 stars 5 forks source link

kf-views tests fail in clean install in vagrant #358

Closed robredpath closed 3 years ago

robredpath commented 4 years ago

I followed the steps in https://kingfisher-vagrant.readthedocs.io/en/latest/#setting-up-repositories , then:

vagrant ssh
(vagrant) cd /vagrant/views
(vagrant) source .ve/bin/activate
(vagrant) pytest

I expected the tests to pass, as I'd made no changes

Instead, see https://gist.github.com/robredpath/2c7418bfbf957ec80a79a74cf363b2d5 for the output.

Installation went ok - see https://gist.github.com/robredpath/c29855ab226a22865ce045fe97e0d502 for output.

odscjames commented 4 years ago

This is because file permissions go funny in a Vagrant Synced folder. The tests try and set the file permissions on the pgpass files to 600, which is what they need to be before pgpass will recognise them but it doesn't work.

The tests in tests/test_config.py all have no external dependencies, so these can be run outside vagrant in a normal virtualenv with:

pytest tests/test_config.py

Not sure what best solution here is.

odscjames commented 4 years ago

kf-views tests fail in clean install in vagrant

jpmckinney commented 3 years ago

Since we now use a simple connection URI (and psycopg2 automatically checks pgpass if no password is set in the URI), those tests are gone, so the new tests should pass.