-
Notifications
You must be signed in to change notification settings - Fork 25
Testing
Existing tests are located in the following locations:
- Infobase unit tests: /infobase/tests
- Utils unit tests: /utils/tests
- "Infogami test suite" originally run using
functest
: /tests - Webtests: /test
Needs further investigation:
- Possible doc tests though the Python code?
- js tests -- don't appear to be any. TODO readme note to 'add'? js test suite.
- Test script? https://github.com/internetarchive/infogami/blob/master/scripts/test
We want to run tests using pytest
, so there will be some (minor) work updating the existing tests from the original test frameworks.
All tests should run on Travis CI via pytest
: https://travis-ci.org/internetarchive/infogami/
The current Open Library Docker development environment can be used by developers to run tests locally in a representative environment using the oldev
container, from the root directory of your infogami
repo:
Infogami unit tests:
docker run --rm -tv $PWD:/openlibrary/infogami -w /openlibrary/infogami oldev pytest
OR for all of the tests:
docker run --rm -tv $PWD:/openlibrary/vendor/infogami -w /openlibrary/vendor/infogami oldev pytest
This requires the Open Library oldev
image to have been built following the instructions. This method is targeted toward current Open Library developers and guarantees a compatible environment to support our Open Library production deployment. We are not targeting independent Infogami instances with our current efforts.
su postgres -c "psql -c 'create database infobase_test;' -U postgres"
export USER=postgres
There seems to be a problem locally with the postgres user expecting to have a blank pw.
pytest tests
fails with E OperationalError: FATAL: Peer authentication failed for user "postgres"