Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:okfn/ckan into 1038-organization-…
…hierarchy Conflicts: ckan/config/deployment.ini_tmpl ckan/new_authz.py ckan/templates/organization/read.html ckan/tests/logic/test_auth.py doc/configuration.rst doc/solr-setup.rst
- Loading branch information
Showing
175 changed files
with
3,699 additions
and
1,432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# Exit immediately if any command fails | ||
set -e | ||
|
||
# Drop Travis' postgres cluster if we're building using a different pg version | ||
TRAVIS_PGVERSION='9.1' | ||
if [ $PGVERSION != $TRAVIS_PGVERSION ] | ||
then | ||
sudo -u postgres pg_dropcluster --stop $TRAVIS_PGVERSION main | ||
# Make psql use $PGVERSION | ||
export PGCLUSTER=$PGVERSION/main | ||
fi | ||
|
||
# Install postgres and solr | ||
sudo apt-get update -qq | ||
sudo apt-get install postgresql-$PGVERSION solr-jetty libcommons-fileupload-java:amd64=1.2.2-1 | ||
|
||
if [ $PGVERSION == '8.4' ] | ||
then | ||
# force postgres to use 5432 as it's port | ||
sudo sed -i -e 's/port = 5433/port = 5432/g' /etc/postgresql/8.4/main/postgresql.conf | ||
fi | ||
|
||
sudo service postgresql restart | ||
|
||
# Setup postgres' users and databases | ||
sudo -u postgres psql -c "CREATE USER ckan_default WITH PASSWORD 'pass';" | ||
sudo -u postgres psql -c "CREATE USER datastore_default WITH PASSWORD 'pass';" | ||
sudo -u postgres psql -c 'CREATE DATABASE ckan_test WITH OWNER ckan_default;' | ||
sudo -u postgres psql -c 'CREATE DATABASE datastore_test WITH OWNER ckan_default;' | ||
|
||
export PIP_USE_MIRRORS=true | ||
pip install -r requirements.txt | ||
pip install -r dev-requirements.txt | ||
|
||
python setup.py develop | ||
|
||
# Install npm dpes for mocha | ||
npm install -g mocha-phantomjs phantomjs | ||
|
||
paster db init -c test-core.ini | ||
|
||
# If Postgres >= 9.0, we don't need to use datastore's legacy mode. | ||
if [ $PGVERSION != '8.4' ] | ||
then | ||
sed -i -e 's/.*datastore.read_url.*/ckan.datastore.read_url = postgresql:\/\/datastore_default:pass@\/datastore_test/' test-core.ini | ||
paster datastore set-permissions postgres -c test-core.ini | ||
else | ||
sed -i -e 's/.*datastore.read_url.*//' test-core.ini | ||
fi | ||
|
||
cat test-core.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
# Configure Solr | ||
echo "NO_START=0\nJETTY_HOST=127.0.0.1\nJETTY_PORT=8983\nJAVA_HOME=$JAVA_HOME" | sudo tee /etc/default/jetty | ||
sudo cp ckan/config/solr/schema.xml /etc/solr/conf/schema.xml | ||
sudo service jetty restart | ||
|
||
# Run mocha front-end tests | ||
# We need ckan to be running for some tests | ||
paster serve test-core.ini & | ||
sleep 5 # Make sure the server has fully started | ||
mocha-phantomjs http://localhost:5000/base/test/index.html | ||
# Did an error occur? | ||
MOCHA_ERROR=$? | ||
# We are done so kill ckan | ||
killall paster | ||
|
||
# And finally, run the nosetests | ||
nosetests --ckan --reset-db --with-pylons=test-core.ini --nologcapture ckan ckanext | ||
# Did an error occur? | ||
NOSE_ERROR=$? | ||
|
||
[ "0" -ne "$MOCHA_ERROR" ] && echo MOCKA tests have failed | ||
[ "0" -ne "$NOSE_ERROR" ] && echo NOSE tests have failed | ||
|
||
# If an error occurred in our tests make sure travis knows | ||
exit `expr $MOCHA_ERROR + $NOSE_ERROR` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.