Astrophysic Data System's library service
100K+
Astrophysic Data System's library service
A Vagrantfile and puppet manifest are available for development within a virtual machine. To use the vagrant VM defined here you will need to install Vagrant and VirtualBox.
To load and enter the VM: vagrant up && vagrant ssh
Run the tests using py.test:
docker run --name some-postgres -e POSTGRES_PASSWORD= -d -p 1234:5432 postgres
virtualenv python
source python/bin/activate
pip install -r requirements.txt
pip install -r dev-requirements.txt
py.tests biblib/tests/
Tests are split into three (excessive) stages:
All tests have been written top down, or in a Test-Driven Development approach, so keep this in mind when reading the tests. All the logic has been built based on these tests, so if you were to add something, I'd advise you first create a test for your expected behaviour, and build the logic until it works.
The only thing to take care of when making a deployment is the migration of the backend database. Libraries uses specific features of PostgreSQL, such as UUID and JSON-store, so you should think carefully if you wish to change the backend. It is recommended you implement the migrations using the Flask-migrate scripts within manage.py and not use alembic as is used elsewhere. When you have access to the DB:
cd biblib/
python manage.py db upgrade
If you wish to do anything else, then just look at the default behaviour of Flask-migrate scripts (https://flask-migrate.readthedocs.io/en/latest/) or within the source code.
Please see the issues page for lists of features that have been kept in mind during the building of private libraries.
Content type
Image
Digest
Size
271.1 MB
Last updated
over 8 years ago
docker pull adsabs/biblib-service