- Configures Sentry automatically using a SENTRY_DSN environment variable.
To install ckanext-datagovuk:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-datagovuk Python package into your virtual environment:
pip install ckanext-datagovuk
Add
datagovuk
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/production.ini
).Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Document any optional config settings here.
ckan.datagovuk.trim_strings_for_index_limit
: when indexing packages, string fields will be truncated to this length unless they are known to be under a text-indexed key. Solr 6 has a field limit of 32k for string fields, but note that our truncation is applied per-json-value, and a Solr value can contain multiple json values which then get squashed together to a single field value, so using a number under half Solr's limit is wise.
To install ckanext-datagovuk for development, activate your CKAN virtualenv and do:
git clone https://github.com/alphagov/ckanext-datagovuk.git cd ckanext-datagovuk python setup.py develop pip install -r dev-requirements.txt
To run the tests, do:
nosetests -v --nologcapture --with-pylons=test.ini --ckan ckanext.datagovuk
To run the tests and produce a coverage report, first make sure you have
coverage installed in your virtualenv (pip install coverage
) then run:
nosetests -v --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.datagovuk --cover-inclusive --cover-erase --cover-tests --ckan ckanext.datagovuk
In order to be able to run the (CKAN functional tests)[https://github.com/alphagov/ckan-functional-tests] we need to create test data.
Before running the paster command set the environment varibales: - CKAN_INI - location of CKAN ini file, this is already set on the docker stack - CKAN_TEST_SYSADMIN_NAME and CKAN_TEST_SYSADMIN_PASSWORD
Then run the paster command:
paster --plugin=ckanext-datagovuk create_dgu_test_data -c $CKAN_INI
In order to remove the test data:
paster --plugin=ckanext-datagovuk remove_dgu_test_data -c $CKAN_INI